Web application performance problems are not easy to fix properly. The responsiveness of your application at a moment depends on many factors: the application code, installed plugins, AWS load, server type, caching mechanism, etc.

    The most common reason for performance issues is lack of any caching. Turning it on, what for most Bitnami Applications is not that diffucult, dramatically improve the server performance.


    W3 Total Cache

    In most cases, enabling "Page Caching" with "disk" option should be enough.


    If you have problems configuring W3 Total Cache, try to enable Debug mode. Go to the W3 Total Cache admin and select at least "Page Cache" option in the Debug section. Then go to one of your web pages and check the source code. There should be a debug info at the end, this way you can check if caching works properly.

    When WordPress is configured in the /wordpress url location

    You may found problems when your WordPress application is installed in the /wordpress location. There may be a conflict between the permalink rewrites and the ones added for W3 Total Cache plugin. The problem is the order in which those rewrites are evaluated.

    Make sure that all the Rewrite* entries are removed or commented out in the /opt/bitnami/apps/wordpress/conf/httpd-app.conf file:

    Alias /wordpress/ "/opt/bitnami/apps/wordpress/htdocs/"
    Alias /wordpress "/opt/bitnami/apps/wordpress/htdocs"
    <Directory "/opt/bitnami/apps/wordpress/htdocs">
        Options Indexes MultiViews +FollowSymLinks
        AllowOverride None
        <IfVersion < 2.3 >
        Order allow,deny
        Allow from all
        <IfVersion >= 2.3>
        Require all granted
        RewriteEngine On
        RewriteBase /wordpress/
        RewriteRule ^index\.php$ - [L]
        RewriteCond %{REQUEST_FILENAME} !-f
        RewriteCond %{REQUEST_FILENAME} !-d
        RewriteRule . /wordpress/index.php [L]

    WP Super Cache


    If you have problems configuring WP Super Cache, try to enable Debug mode. Go to the WP Super Cache settings, click on "Debug" and enable the "debugging" option. One you have saved the changes you will find the current log file at the top of the web page. 

    If you have WP-Cache installed

    If you have WP-Cache installed already, please disable it. Edit wp-config.php and make sure the WP_CACHE and WPCACHEHOME defines are deleted, and remove the files installdir/apps/wordpress/htdocs/wp-content/wp-cache-config.php and installdir/apps/wordpress/htdocs/wp-content/advanced-cache.php. These will be recreated when you install this plugin.


    Please follow the next steps to install the plugin. 


    1. Download the plugin using the following link:
    2. Upload this directory to your plugins directory. It will create a 'installdir/apps/wordpress/apps/wordpress/htdocs/wp-content/plugins/wp-super-cache/' directory.
    3. If you are using WordPress MU or WordPress Multisite you can install the plugin in the ordinary plugins folder and activate it "network wide".
    4. WordPress users should go to their Plugins page and activate "WP Super Cache".
    5. Now go to Settings->WP Super Cache and enable caching.

    If you choose "Mod Rewrite caching"

    If you want to enable that option, you will have to modify the file at installdir/apps/wordpress/conf/htaccess.conf with the content that the application display when you click on "Update Mod_rewrite rules". You have to block in your htaccess.conf file like this one:


    <Directory "installdir/apps/wordpress/conf">
    # BEGIN WPSuperCache
    <IfModule mod_rewrite.c>
    RewriteEngine On
    # END WPSuperCache

    Moreover, you have to add these lines at the bottom of the file


    <Directory "installdir/apps/wordpress/htdocs/wp-content/cache">
    # BEGIN supercache
    <IfModule mod_mime.c>
            <FilesMatch "\.html\.gz$">
            ForceType text/html
            FileETag None
            AddEncoding gzip .gz
            AddType text/html .gz
    <IfModule mod_deflate.c>
            SetEnvIfNoCase Request_URI \.gz$ no-gzip
    <IfModule mod_headers.c>
            Header set Cache-Control 'max-age=3, must-revalidate'
    <IfModule mod_expires.c>
            ExpiresActive On
            ExpiresByType text/html A3
    </IfModule> `` # END supercache

    Quick Cache

    Permission issues

    Permissions: Please check permissions on /wp-content/cache . Quick Cache needs write-access to this directory. Permissions need to be 755 or higher.
    Permissions: Please check permissions on /wp-config.php . Quick Cache needs write-access to this file. Permissions need to be 755 or higher.

    We usually set the ownership of the application files to "bitnami" user and "daemon" group, so you are able to edit the files directly as the bitnami user and Apache is able to read them. In this case, when you want Apache to be able to modify any files or directories, you need to give write permissions to the group too.

    Execute the commands below to assure both bitnami user and Apache can read and write to the "cache" directory and wp-config file?

    $ sudo chown -R bitnami:daemon /opt/bitnami/apps/wordpress/htdocs/wp-content/cache
    $ sudo find /opt/bitnami/apps/wordpress/htdocs/wp-content/cache -type f -exec chmod 664 {} \;
    $ sudo find /opt/bitnami/apps/wordpress/htdocs/wp-content/cache -type d -exec chmod 775 {} \;
    $ sudo chown bitnami:daemon /opt/bitnami/apps/wordpress/htdocs/wp-config.php
    $ sudo chmod g+w /opt/bitnami/apps/wordpress/htdocs/wp-config.php


    This plugin uses the Minify engine to combine and compress JS and CSS files to improve page load time. There are several plugins for the same purpose: Minify, WP Minify or Better WordPress Minify. You can install one of them and it should improve your page load time. In all cases it is necessary to have WordPress running in the root URL. Check this guide to see how to move your WordPress to the root URL.


    You can enable page caching adding the following entries at the end of the /opt/bitnami/apps/mediawiki/htdocs/LocalSettings.php file:

    $wgUseFileCache = true; /* default: false */
    $wgFileCacheDirectory = "$IP/cache";
    $wgShowIPinHeader = false;

    You will also need to execute this command to set proper directory permissions:

    sudo chmod g+w /opt/bitnami/apps/mediawiki/htdocs/cache

    There are some good articles on this topic:


    Make sure that you have "Normal Caching mode" on in the Drupal Administer/Site Configuration/Performance section.


    Enable all the application cache options in the Magento administration panel (In System -> Cache Management).



    The following procedure describes how to properly activate and configure Varnish in the Bitnami Cloud Hosting machine. For other custom installations, please use the following guide:

    IMPORTANT: We assume that your Web Application instance (for instance WordPress, Drupal, etc.) is already running in the root url location, for instance at or
    • First, connect to your server via SSH. Learn more.
    • Enable and start the Varnish service. You can skip this step if you selected "Varnish" option inside the "Development Options" in the server creation form. Varnish service will be started on port 81 by default so it shouldn't affect any other currently configured componens and web pages. Execute the following commands:
    sudo mv /opt/bitnami/varnish/scripts/ /opt/bitnami/varnish/scripts/
    sudo /opt/bitnami/ start varnish
    • Backup the original Varnish configuration file:
    sudo cp /opt/bitnami/varnish/etc/varnish/default.vcl /opt/bitnami/varnish/etc/varnish/default.vcl.backup

    Configure your application

    IMPORTANT: Varnish is connected to Apache locally so other applications like 'phpMyAdmin', 'phpPgAdmin' or 'server-status' could be public after enabling it. Please check this section to know how to block these apps for security reasons.


    • Add the WordPress-specific Varnish configuration executing the following commands:
    wget -O wordpress.vcl
    sudo cp wordpress.vcl /opt/bitnami/varnish/etc/varnish/default.vcl
    sudo sed -i 's/port\s*=\s*"[^"]*"/port = "80"/g' /opt/bitnami/varnish/etc/varnish/default.vcl


    • Install and enable a proper version of Varnish Drupal module from
    • If you use Drupal 7.x, please add the following at the end of the /opt/bitnami/apps/drupal/htdocs/sites/default/settings.php file:
    $conf['cache_backends'][] = 'sites/all/modules/varnish/';
    $conf['cache_class_cache_page'] = 'VarnishCache';
    $conf['page_cache_invoke_hooks'] = FALSE;
    $conf['reverse_proxy'] = True;
    $conf['cache'] = 1;
    $conf['cache_lifetime'] = 0;
    $conf['page_cache_maximum_age'] = 21600;
    $conf['reverse_proxy_header'] = 'HTTP_X_FORWARDED_FOR';
    $conf['reverse_proxy_addresses'] = array('');
    $conf['omit_vary_cookie'] = True;
    • Modify the Varnish ctl script so it does open the terminal port:
    sudo sed -i 's/VARNISH_OPTIONS="-a/VARNISH_OPTIONS="-T localhost:6082 -a/g' /opt/bitnami/varnish/scripts/
    • Update the Varnish config file:
    wget -O drupal.vcl
    sudo cp drupal.vcl /opt/bitnami/varnish/etc/varnish/default.vcl
    sudo sed -i 's/port\s*=\s*"[^"]*"/port = "80"/g' /opt/bitnami/varnish/etc/varnish/default.vcl


    • Add the Magento-specific Varnish configuration executing the following commands:
    bash < <(curl -s
    source ~/.profile
    cd /opt/bitnami/apps/magento/htdocs
    modman init
    modman clone magneto-varnish
    sudo mv magento-varnish3.vcl /opt/bitnami/varnish/etc/varnish/default.vcl
    sudo sed -i 's/port = "8008"/port = "80"/g' /opt/bitnami/varnish/etc/varnish/default.vcl
    • You may review other settings editing the file /opt/bitnami/varnish/etc/varnish/default.vcl
    • Enable "Varnish" in Magento admin console, System -> Cache Management
    • Flush magento cache:
    sudo rm -rf /opt/bitnami/apps/magento/htdocs/var/cache/*
    sudo rm -rf /opt/bitnami/apps/magento/htdocs/var/sessions/*


    • Add the Ghost-specific Varnish configuration:
    sudo cp default.vcl /opt/bitnami/varnish/etc/varnish/default.vcl
    sudo sed -i 's/port = "[^"]*"/port = "80"/g' /opt/bitnami/varnish/etc/varnish/default.vcl


    • Add the PrestaShop-specific Varnish configuration:
    sudo cp prestashop.vcl /opt/bitnami/varnish/etc/varnish/default.vcl
    sudo sed -i 's/port = "[^"]*"/port = "80"/g' /opt/bitnami/varnish/etc/varnish/default.vcl

    Test and activate the Varnish service

    • Restart the Varnish Service:
    sudo /opt/bitnami/ restart varnish
    • Go to the Manage Server section and open the "Firewall" tab. Click "Add Custom Firewall Rules", enter the value 81 in the port field and click the "Add" button.
    • Check if your website is served properly by Varnish on port 81 (adding ':81' to the domain in your webbrowser):
      You can use one of the online applications like
    • If everything works ok, switch Apache and Varnish ports and activate Varnish as your main frontend on port 80:
    sudo sed -i 's/^\s*Listen .*$/Listen 81/g' /opt/bitnami/apache2/conf/httpd.conf
    sudo sed -i 's/\:80/\:81/g' /opt/bitnami/apache2/conf/bitnami/bitnami.conf
    sudo sed -i 's/\:80/\:81/g' /opt/bitnami/apps/*/conf/httpd-vhosts.conf
    sudo sed -i 's/=80/=81/g' /opt/bitnami/properties.ini
    sudo sed -i 's/port\s*=\s*"[^"]*"/port = "81"/g' /opt/bitnami/varnish/etc/varnish/default.vcl
    sudo sed -i 's/VARNISH_PORT=.*$/VARNISH_PORT=80/g' /opt/bitnami/varnish/scripts/
    sudo /opt/bitnami/ restart
    • Finally, remove the Firewall rule added before for port 81 in the Manage Server section.


    IMPORTANT: Varnish does not cache the content if Apache PageSpeed module is enabled. Please check how to disable this module here.


    IMPORTANT: If you are going to execute bnconfig utility, you should change server port back to 80 in properties.ini while running the utility. Then set back port 81 in order to configure the server correctly.

    sudo sed -i 's/=81/=80/g' /opt/bitnami/properties.ini
    sudo /opt/bitnami/apps/your_app/bnconfig --option parameter
    sudo sed -i 's/=80/=81/g' /opt/bitnami/properties.ini
    sudo /opt/bitnami/ restart


    Tag page (Edit tags)
    • No tags
    Pages that link here
    Page statistics
    54503 view(s), 35 edit(s) and 18738 character(s)


    You must login to post a comment.

    Attach file


    FileSizeDateAttached by 
    No description
    7.11 kB19:18, 28 Jan 2013DanooActions
    PrestaShop default Varnish configuration
    1305 bytes08:24, 23 Jul 2015jorgeActions
    PrestaShop default Varnish configuration
    1410 bytes08:19, 23 Jul 2015jorgeActions