Bitnami WordPress Installer

Description

WordPress is one of the world’s most popular web publishing platforms for building blogs and websites. It can be customized via a wide selection of themes, extensions and plug-ins.

First steps with the Bitnami WordPress Stack

Welcome to your new Bitnami application! Here are a few questions (and answers!) you might need when first starting with your application.

What is the administrator username set for me to log in to the application for the first time?

The username was configured by you when you first installed the application.

What is the administrator password?

The password was configured by you when you first installed the application.

How to connect to the MySQL database?

You can connect to the MySQL database from the same computer where it is installed with the mysql client tool.

$ mysql -u root -p 

You will be prompted to enter the root user password. This is the same as the application password.

The password will be the one entered during the installation process.

How to debug errors in your database?

The main log file is created at installdir/mysql/data/mysqld.log on the MySQL database server host.

How to start or stop the servers?

Linux

Bitnami native installers include a graphical tool to manage services. This tool is named manager-linux-x64.run on Linux and is located in the installation directory. To use this tool, double-click the file and then use the graphical interface to start, stop or restart servers. Server log messages can be checked in the "Server Events" tab.

Management tool

The native installer also includes a command-line script to start, stop and restart applications, named ctlscript.sh. This script can be found in the installation directory and accepts the options start, stop, restart, and status. To use it, log in to the server console and execute it following the examples below:

  • Call it without any service names to start all services:

    $ installdir/ctlscript.sh start
    
  • Use it to restart a specific service only by passing the service name as argument - for example, mysql or apache:

     $ installdir/ctlscript.sh restart mysql
     $ installdir/ctlscript.sh restart apache
    
  • Obtain current status of all services:

     $ installdir/ctlscript.sh status
    

The list of available services varies depending on the required components for each application.

Mac OS X

Bitnami native installers include a graphical tool to manage services. This tool is named manager-osx on Mac OS X and is located in the installation directory. To use this tool, double-click the file and then use the graphical interface to start, stop or restart servers. Server log messages can be checked in the "Server Events" tab.

Management tool

The native installer also includes a command-line script to start, stop and restart applications, named ctlscript.sh. This script can be found in the installation directory and accepts the options start, stop, restart, and status. To use it, log in to the server console and execute it following the examples below:

  • Call it without any service names to start all services:

    $ installdir/ctlscript.sh start
    
  • Use it to restart a specific service only by passing the service name as argument - for example, mysql or apache:

     $ installdir/ctlscript.sh restart mysql
     $ installdir/ctlscript.sh restart apache
    
  • Obtain current status of all services:

     $ installdir/ctlscript.sh status
    

The list of available services varies depending on the required components for each application.

Windows

Bitnami native installers include a graphical tool to manage services. This tool is named manager-windows.exe on Windows and is located in the installation directory. To use this tool, double-click the file and then use the graphical interface to start, stop or restart servers. Server log messages can be checked in the "Server Events" tab.

Management tool

The Windows native installer creates shortcuts to start and stop services created in the Start Menu, under "Programs -> Bitnami APPNAME Stack -> Bitnami Service". Servers can also be managed from the Windows "Services" control panel. Services are named using the format APPNAMESERVICENAME, where APPNAME is a placeholder for the application name and SERVICENAME is a placeholder for the service name. For example, the native installer for the Bitnami WordPress Stack installs services named wordpressApache and wordpressMySQL.

These services will be automatically started during boot. To modify this behaviour, refer to the section on disabling services on Windows.

How to configure the application to run at the root URL of the domain?

This approach describes how to configure your application to run at the root URL of your domain. It also describes how to modify the URL to use a new domain, such as your-domain.com, with the bnconfig tool. The details are described below.

If your application is running at the URL /wordpress, remove the prefix from the URL by executing the following command:

Windows

    $ installdir/apps/wordpress/bnconfig.exe --appurl /

Linux

    $ installdir/apps/wordpress/bnconfig --appurl /

Mac OS X

    $ installdir/apps/wordpress/bnconfig.app/Contents/MacOS/installbuilder.sh --appurl /

(use –help to check if that option is available for your application)

Now you will be able to access to the application at http://localhost instead of http://localhost/wordpress.

Updating the IP address or hostname

WordPress requires updating the IP address/domain name if the machine IP address/domain name changes. The bnconfig tool also has an option which updates the IP address, called –machine_hostname (use –help to check if that option is available for your application). Note that this tool changes the URL to http://NEW_DOMAIN/wordpress.

$ sudo installdir/apps/wordpress/bnconfig --machine_hostname NEW_DOMAIN

If you have configured your machine to use a static domain name or IP address, you should rename or remove the installdir/apps/wordpress/bnconfig file.

$ sudo mv installdir/apps/wordpress/bnconfig installdir/apps/wordpress/bnconfig.disabled
NOTE: Be sure that your domain is propagated. Otherwise, this will not work. You can verify the new DNS record by using the Global DNS Propagation Checker and entering your domain name into the search field.

You can also change your hostname by modifying it in your hosts file. Enter the new hostname using your preferred editor.

$ sudo nano /etc/hosts
  • Add a new line with the IP address and the new hostname. Here's an example. Remember to replace the IP-ADDRESS and DOMAIN placeholders with the correct IP address and domain name.

    IP-ADDRESS DOMAIN

How to reset the MariaDB root password?

If you don't remember your MariaDB root password, you can follow the steps below to reset it to a new value:

  • Create a file in /home/bitnami/mysql-init with the content shown below (replace NEW_PASSWORD with the password you wish to use):

     UPDATE mysql.user SET Password=PASSWORD('NEW_PASSWORD') WHERE User='root';
     FLUSH PRIVILEGES;
    
  • Stop the MariaDB server:

     $ sudo installdir/ctlscript.sh stop mysql
    
  • Start MariaDB with the following command:

     $ sudo installdir/mysql/bin/mysqld_safe --defaults-file=installdir/mysql/my.cnf --pid-file=installdir/mysql/data/mysqld.pid --init-file=/home/bitnami/mysql-init 2> /dev/null &
    
  • Restart the MariaDB server:

     $ sudo installdir/ctlscript.sh restart mysql
    
  • Remove the init script

     $ rm /home/bitnami/mysql-init
    

How to change the MariaDB root password?

You can modify the MariaDB password using the following command at the shell prompt:

$ installdir/mysql/bin/mysqladmin -p -u root password NEW_PASSWORD        

How to reset the WordPress admin password from the command line?

Use the command below to reset the administrator password from the command line. Remember to replace the NEWPASSWORD placeholder with your desired password and the HOSTNAME placeholder with the actual hostname for the database instance or remove that option if necessary.

$ mysql -u root -p -h HOSTNAME -D bitnami_wordpress -e 'UPDATE wp_users SET user_pass=MD5("'NEWPASSWORD'") WHERE ID='1';'

How to create a full backup of WordPress?

Backup

The Bitnami WordPress Stack is self-contained and the simplest option for performing a backup is to copy or compress the Bitnami stack installation directory. To do so in a safe manner, you will need to stop all servers, so this method may not be appropriate if you have people accessing the application continuously.

Follow these steps:

  • Change to the directory in which you wish to save your backup:

      $ cd /your/directory
    
  • Stop all servers using the graphical manager or the command-line script. Here's an example:

      $ sudo installdir/ctlscript.sh stop
    
  • Create a compressed file with the stack contents using a tool like 7-Zip or Winzip (on Windows) or a command like the one below (on Linux and Mac OS X):

      $ sudo tar -pczvf application-backup.tar.gz installdir (on Linux and Mac OS X)
    
  • Restart all servers using the graphical manager or the command-line script:

      $ sudo installdir/ctlscript.sh start
    

You should now download or transfer the application-backup.tar.gz file to a safe location.

Restore

Follow these steps:

  • Change to the directory containing your backup:

      $ cd /your/directory
    
  • Stop all servers using the graphical manager or the command-line script. Here's an example:

      $ sudo installdir/ctlscript.sh stop
    
  • Move the current stack to a different location:

      $ sudo mv installdir /tmp/bitnami-backup (on Linux and Mac OS X)
      $ move installdir C:\Windows\Temp (on Windows)
    
  • Uncompress the backup file to the original directory using a tool like 7-Zip or Winzip (on Windows) or a command like the one below (on Linux and Mac OS X):

      $ sudo tar -pxzvf application-backup.tar.gz -C /
    
  • Start all servers using the graphical manager or the command-line script:

    $ sudo installdir/ctlscript.sh start
    
IMPORTANT: When restoring, remember to maintain the original permissions for the files and folders. For example, if you originally installed the stack as the root user on Linux, make sure that the restored files are owned by root as well.

If you want to create only a database backup, refer to these instructions for MySQL and PostgreSQL.

How to configure outbound email settings?

You can install or enable the "WP Mail SMTP" plugin from the WordPress administration page. Follow these steps to activate this plugin.

  • Log in to the WordPress administration panel.

  • Navigate to "Plugins" and click the "Activate" option for the "WP-Mail-SMTP" plugin.

Activate WP-Mail-SMTP

  • Go to the "Settings -> Email" panel to configure the SMTP settings of your email provider. Here is an example of how to use a Gmail account to send emails from the WordPress application. If you are using a different provider, remember to replace these values with the valid data for your SMTP provider.

  • Make sure that "SMTP Options" are filled as follows:

    • SMTP Host: smtp.gmail.com
    • SMTP Port: 587
    • Encryption: Use TLS encryption.
    • Authentication: Yes. Use SMTP authentication.

WordPress SMTP Options

  • Send a test email to ensure that everything is working smoothly. If you don't receive any email, go to your Google Account security settings page, click in the "Sign-in & Security -> Connected apps & sites" section and turn ON the "Allow less secure apps" option.

Allow less secure apps in Gmail for WordPress SMTP Options

To configure the application to use other third-party SMTP services for outgoing email, such as SendGrid or Mandrill, refer to the FAQ for Linux, Windows and Mac OS X.

How to enable HTTPS support with SSL certificates?

NOTE: The steps below assume that you are using a custom domain name and that you have already configured the custom domain name to point to your cloud server.

Bitnami images come with SSL support already pre-configured and with a dummy certificate in place. Although this dummy certificate is fine for testing and development purposes, you will usually want to use a valid SSL certificate for production use. You can either generate this on your own (explained here) or you can purchase one from a commercial certificate authority.

Once you obtain the certificate and certificate key files, you will need to update your server to use them. Follow these steps to activate SSL support:

  • Use the table below to identify the correct locations for your certificate and configuration files.

    Variable Value
    Current application URL https://[custom-domain]/
      Example: https://my-domain.com/ or https://my-domain.com/appname
    Apache configuration file installdir/apache2/conf/bitnami/bitnami.conf
    Certificate file installdir/apache2/conf/server.crt
    Certificate key file installdir/apache2/conf/server.key
    CA certificate bundle file (if present) installdir/apache2/conf/server-ca.crt
  • Copy your SSL certificate and certificate key file to the specified locations.

NOTE: If you use different names for your certificate and key files, you should reconfigure the SSLCertificateFile and SSLCertificateKeyFile directives in the corresponding Apache configuration file to reflect the correct file names.
  • If your certificate authority has also provided you with a PEM-encoded Certificate Authority (CA) bundle, you must copy it to the correct location in the previous table. Then, modify the Apache configuration file to include the following line below the SSLCertificateKeyFile directive. Choose the correct directive based on your scenario and Apache version:

    Variable Value
    Apache configuration file installdir/apache2/conf/bitnami/bitnami.conf
    Directive to include (Apache v2.4.8+) SSLCACertificateFile "installdir/apache2/conf/server-ca.crt"
    Directive to include (Apache < v2.4.8) SSLCertificateChainFile "installdir/apache2/conf/server-ca.crt"
NOTE: If you use a different name for your CA certificate bundle, you should reconfigure the SSLCertificateChainFile or SSLCACertificateFile directives in the corresponding Apache configuration file to reflect the correct file name.
  • Once you have copied all the server certificate files, you may make them readable by the root user only with the following commands:

     $ sudo chown root:root installdir/apache2/conf/server*
    
     $ sudo chmod 600 installdir/apache2/conf/server*
    
  • Open port 443 in the server firewall. Refer to the FAQ for more information.

  • Restart the Apache server.

You should now be able to access your application using an HTTPS URL.

How to create an SSL certificate?

You can create your own SSL certificate with the OpenSSL binary. A certificate request can then be sent to a certificate authority (CA) to get it signed into a certificate, or if you have your own certificate authority, you may sign it yourself, or you can use a self-signed certificate (because you just want a test certificate or because you are setting up your own CA).

  • Create your private key (if you haven't created it already):

     $ sudo openssl genrsa -out installdir/apache2/conf/server.key 2048
    
  • Create a certificate:

     $ sudo openssl req -new -key installdir/apache2/conf/server.key -out installdir/apache2/conf/cert.csr
    
    IMPORTANT: Enter the server domain name when the above command asks for the "Common Name".
  • Send cert.csr to the certificate authority. When the certificate authority completes their checks (and probably received payment from you), they will hand over your new certificate to you.

  • Until the certificate is received, create a temporary self-signed certificate:

     $ sudo openssl x509 -in installdir/apache2/conf/cert.csr -out installdir/apache2/conf/server.crt -req -signkey installdir/apache2/conf/server.key -days 365
    
  • Back up your private key in a safe location after generating a password-protected version as follows:

     $ sudo openssl rsa -des3 -in installdir/apache2/conf/server.key -out privkey.pem
    

    Note that if you use this encrypted key in the Apache configuration file, it will be necessary to enter the password manually every time Apache starts. Regenerate the key without password protection from this file as follows:

     $ sudo openssl rsa -in privkey.pem -out installdir/apache2/conf/server.key
    

Find more information about certificates at http://www.openssl.org.

How to debug errors in Apache?

Once Apache starts, it will create two log files at installdir/apache2/logs/access_log and installdir/apache2/logs/error_log respectively.

  • The access_log file is used to track client requests. When a client requests a document from the server, Apache records several parameters associated with the request in this file, such as: the IP address of the client, the document requested, the HTTP status code, and the current time.

  • The error_log file is used to record important events. This file includes error messages, startup messages, and any other significant events in the life cycle of the server. This is the first place to look when you run into a problem when using Apache.

If no error is found, you will see a message similar to:

Syntax OK

How to modify PHP settings?

The PHP configuration file allows you to configure the modules enabled, the email settings or the size of the upload files. It is located at installdir/php/etc/php.ini.

After modifying this file, restart both Apache and PHP-FPM:

$ sudo installdir/ctlscript.sh restart apache
$ sudo installdir/ctlscript.sh restart php-fpm

How to access phpMyAdmin?

You should be able to access phpMyAdmin directly, by browsing to http://127.0.0.1/phpmyadmin.

The username is root for phpMyAdmin, and the password is the one specified by you during the installation process.

How to install the memcached module using the libmemcached library?

Memcached is a high-performance, distributed memory object caching system, generic in nature, but intended for use in speeding up dynamic web applications by alleviating database load. This extension uses the libmemcached library to provide an API for communicating with memcached servers.

If this module is not in your stack, you can install it manually following these steps. The steps differ for PHP5 and PHP7, so choose the appropriate section below depending on the PHP version bundled with your stack. To obtain the PHP version, use the command php -v at your console prompt.

Installation

PHP7
  • Install development tools:

     $ sudo apt-get update
     $ sudo apt-get install build-essential libtool autoconf unzip wget git
    
  • Download the latest source code from the web page, uncompress it and compile the library:

     $ wget https://launchpad.net/libmemcached/1.0/1.0.16/+download/libmemcached-1.0.16.tar.gz
     $ tar -zxf libmemcached-1.0.16.tar.gz
     $ cd libmemcached-1.0.16
     $ ./configure --prefix=installdir/common
     $ make
     $ sudo make install
    
  • Download and compile the PHP7 version of the PHP memcached module

     $ export PHP_AUTOCONF=/usr/bin/autoconf
     $ export PHP_PREFIX=installdir/php
     $ cd ~/
     $ git clone https://github.com/php-memcached-dev/php-memcached.git
     $ cd php-memcached
     $ git checkout php7
     $ installdir/php/bin/phpize
     $ ./configure --enable-memcached --with-zlib-dir=installdir/common --with-libmemcached-dir=installdir/common --with-php-config=installdir/php/bin/php-config --disable-memcached-sasl
     $ make
     $ sudo make install
    
  • Enable the module in the php.ini file:

     ...
     extension=memcached.so
     ...
    
  • Start the memcached server by running these commands:

     $ mv installdir/memcached/scripts/ctl.sh.disabled installdir/memcached/scripts/ctl.sh
    
     $ sudo installdir/ctlscript.sh start memcached
    

    If you get an error, check that your stack includes the memcached server:

     $ sudo installdir/ctlscript.sh status memcached
    

    Usually, if you don't see the status, it is because you are using a stack that doesn't bundle the memcached server. To install and start it, run:

     $ sudo apt-get install memcached
     $ sudo /etc/init.d/memcached start
     $ sudo installdir/ctlscript.sh restart apache
    
PHP5
  • Install development tools:

     $ sudo apt-get update
     $ sudo apt-get install build-essential libtool autoconf unzip wget
    
  • Download the latest source code from the web page, uncompress it and compile the module:

     $ wget https://launchpad.net/libmemcached/1.0/1.0.16/+download/libmemcached-1.0.16.tar.gz
     $ tar -zxf libmemcached-1.0.16.tar.gz
     $ cd libmemcached-1.0.16
     $ ./configure --prefix=installdir/common
     $ make
     $ sudo make install
     $ cd ~/
     $ wget http://pecl.php.net/get/memcached-2.1.0.tgz
     $ tar -zxf memcached-2.1.0.tgz
     $ export PHP_AUTOCONF=/usr/bin/autoconf
     $ export PHP_PREFIX=installdir/php
     $ cd memcached-2.1.0
     $ installdir/php/bin/phpize
     $ ./configure --enable-memcached --with-zlib-dir=installdir/common --with-libmemcached-dir=installdir/common --with-php-config=installdir/php/bin/php-config
     $ make
     $ sudo make install
    
  • Enable the module in the php.ini file:

     ...
     extension=memcached.so
     ...
    
  • Start the memcached server by running these commands:

     $ mv installdir/memcached/scripts/ctl.sh.disabled installdir/memcached/scripts/ctl.sh
    
     $ sudo installdir/ctlscript.sh start memcached
    

    If you get an error, check that your stack includes the memcached server:

     $ sudo installdir/ctlscript.sh status memcached
    

    Usually, if you don't see the status, it is because you are using a stack that doesn't bundle the memcached server. To install and start it, run:

     $ sudo apt-get install memcached
     $ sudo /etc/init.d/memcached start
     $ sudo installdir/ctlscript.sh restart apache
    

Testing

Once installed, check if the PHP memcached extension is working properly. To do this, create a PHP script file in your htdocs/ directory with the code below and access it using your Web browser:

    <?php
    $mc = new Memcached();
    $mc->addServer("127.0.0.1", 11211);

    $result = $mc->get("test_key");

    if($result) {
        echo $result;
    } else {
        echo "No data in cache. Please refresh page.";
        $mc->set("test_key", "test data pulled from cache!") or die ("Failed to save data in memcached server");
    }
    ?>

How to translate WordPress to my language?

Bitnami WordPress has already installed English and Spanish translations currently. To change the WordPress language, follow the steps below:

Change language using the WordPress administration panel

If the language you wish to use is already available in WordPress, follow these steps:

  • Log in to the WordPress administration panel.

  • Click on the "Settings -> General" tab located in the menu on the left.

  • Scroll down until "Site Language" and select the one you prefer and click ."Save Changes".

WordPress change language

Change language manually

If the language you wish to use is not available in WordPress, you must first install the necessary translation files:

  • Download the translation files for your language from http://codex.wordpress.org/WordPress_in_Your_Language

  • Once you have downloaded the files, copy the .po and .mo files into the installdir/apps/wordpress/htdocs/wp-content/languages directory. If this directory does not exist, create it manually as follows:

     $ sudo mkdir installdir/apps/wordpress/htdocs/wp-content/languages
    
  • Log in to the WordPress administration panel.

  • Click on the "Settings -> General" tab located in the menu on the left.

  • Scroll down until "Site Language". The newly-installed language should now appear in the list. Select it and click "Save Changes".

WordPress change language

How to change the WordPress domain name?

If you are using WordPress v3.3.1-5 or higher, only specify your domain name in the installdir/apps/wordpress/htdocs/wp-config.php file. Edit and replace the following lines as shown, remembering to replace the DOMAIN placeholder with the actual domain name you wish to use:

define('WP_SITEURL', 'http://' . $_SERVER['HTTP_HOST'] . '/');
define('WP_HOME', 'http://' . $_SERVER['HTTP_HOST'] . '/');

with

define('WP_SITEURL', 'http://DOMAIN/');                   
define('WP_HOME', 'http://DOMAIN/');    
NOTE: Your domain name should be correctly propagated for this to work. You can verify the new DNS record by using the Global DNS Propagation Checker and entering your domain name into the search field.

How to disable the WordPress cron script?

The wp-cron.php script will run once a user visits your site. If you get a lot of traffic, this could be a problem. This cron task is really necessary when you make updates in the blog. You can move this cron script to a system cron task to help lower resource usage on the server.

Disable the wp-cron.php script in the installdir/apps/wordpress/htdocs/wp-config.php file. The location is important - add the line below just before the database settings:

 define('DISABLE_WP_CRON', true);

Then, add the cron task to the system. For example, this cron task will run the wp-cron.php process every hour. You can add it using the following command:

 $ sudo crontab -e
 0 * * * * su daemon -s /bin/sh -c "cd installdir/apps/wordpress/htdocs/; installdir/php/bin/php -q wp-cron.php"

How to enable CORS in WordPress?

Edit the WordPress configuration file for Apache (installdir/apps/wordpress/conf/httpd-app.conf) and add the following line inside the Directory directive

...
<Directory installdir/apps/wordpress/htdocs/>
...
Header set Access-Control-Allow-Origin "*"
...
</Directory>

Enable other methods or headers for other directories (e.g installdir/apps/wordpress/htdocs/wp-admin):

...
<Directory installdir/apps/wordpress/htdocs/wp-admin>
...
Header set Access-Control-Allow-Origin "\*"
Header set Access-Control-Allow-Methods "GET, OPTIONS, POST"
Header set Access-Control-Allow-Headers "origin, x-requested-with, content-type, accept"
...
</Directory>

If the request is an OPTIONS request, the script exits with either access control headers sent, or a 403 response if the origin is not allowed. By default, only the server where the application is hosted is allowed (see installdir/apps/wordpress/htdocs/wp-includes/http.php). For other request methods, you will receive a return value.

How to enable installed plugins?

Bitnami WordPress Stack comes with the following plugins preinstalled but disabled:

  • Akismet
  • All in One Seo Pack
  • All in One WP Migration
  • Google Analytics for WordPress
  • Jetpack
  • Simple tags
  • WordPress MU Domain Mapping
  • WP Mail STMP

Bitnami WordPress Stack v4.5.1-0 removed several plugins, such as "Contact Form", "WP Touch" and "Google XML Sitemaps". The functionality previously provided by those plugins is now included in the Jetpack plugin in form of switchable features.

All the installed plugins are disabled by default. To enable them follow the instructions below:

  • Log in to the WordPress dashboard.
  • Browse to the "Plugins" menu item.
  • Look for the plugin you want to activate and click the "Activate" link that appears below the plugin name.

    WordPress enable plugins

To enable several plugins at once, follow the instructions below:

  • Select the checkboxes of the plugins to be enabled.
  • Click the dropdown that says "Bulk Actions", select "Activate" and click on the "Apply" button next to the dropdown.

    WordPress enable plugins

How to install a plugin on WordPress?

You can install any plugin or theme from the WordPress administration panel.

  • Browse to the "Plugins -> Install Plugins" menu item and then click the "Add New" button to search for plugins.

    WordPress plugin installation

  • Once you find a plugin, click the "Install Now" button to download and install it.

    WordPress plugin installation

  • Once the plugin is installed, activate it from the "Install Plugins" page. You can also deactivate it later if you wish.

    WordPress plugin installation

When using the native installer, it is necessary to specify your FTP credentials.

WordPress FTP Credentials

When using the native installer, you can install plugins, themes or updates if you select "development" mode during the installation. If you selected "production" mode, it is necessary to install a FTP server in your machine to be able to install modules from the admin panel.

For more information about installing and managing plugins, such as Full API Access, refer to the WordPress documentation.

How to install the All-in-One WP migration plugin?

The following steps assume that

  • You are using the Bitnami WordPress Stack (not the WordPress Multisite Stack) and
  • You are able to log in to the WordPress dashboard by visiting http://localhost/wp-login.php.

Follow these steps:

  • Log in to your WordPress dashboard.
  • Select the "Plugins -> Installed Plugins" option.
  • Find the plugin named "All-in-One WP Migration" and select "Activate" to activate it.

    WordPress plugin configuration

    NOTE: If you are using a version of the Bitnami WordPress Stack lower than v4.0, the "All-in-One WP Migration" plugin is not pre-installed. You must manually install the plugin first following these instructions.

The plugin will now be installed. Select the "Site Migration" option in the WordPress menu to export or import your WordPress blog.

In some cases, the "Site Migration" page might display the error message shown below:

WordPress plugin configuration

In this case, a permissions change is required. Log in to the server console and run the commands below before exporting or importing your WordPress blog.

$ sudo chgrp daemon installdir/apps/wordpress/htdocs/wp-content/plugins/all-in-one-wp-migration/storage
$ sudo chmod 775 installdir/apps/wordpress/htdocs/wp-content/plugins/all-in-one-wp-migration/storage

How to enable Accelerated Mobile Pages (AMP) in WordPress?

Install the Accelerated Mobile Pages (AMP) plugin via the WordPress dashboard and run a scan of your WordPress installation, as follows:

  • Log in to your WordPress dashboard.
  • Select the "Plugins -> Add New" option.
  • Type "amp" in the search box.
  • Install the "AMP" plugin by clicking the "Install Now" button.

    WordPress plugin installation

  • Click the "Activate plugin" link.

    WordPress plugin installation

You can verify that the plugin is working by adding /amp prefix to any WordPress post URL, as shown below:

WordPress AMP post

Read more about the Accelerated Mobile Pages project.

NOTE: As of this writing, the AMP plugin only works for WordPress posts and not pages.

How to detect malicious software on a WordPress installation?

Install the Wordfence Security plugin via the WordPress dashboard and run a scan of your WordPress installation, as follows:

  • Log in to your WordPress dashboard.
  • Select the "Plugins -> Add New" option.
  • Type "wordfence" in the search box.
  • Install the "Wordfence Security" plugin by clicking the "Install Now" button.

    WordPress plugin installation

  • Click the "Activate plugin" link. A new entry should now appear in the left navigation menu.

    WordPress plugin installation

  • Click the "Wordfence" menu item and then the "Start a Wordfence Scan" option.
  • Wait until the scan ends.

    WordPress plugin installation

How to install WP-DBManager?

If you install WP-DBManager you will need to create the installdir/apps/wordpress/htdocs/wp-content/backup-db directory. To do it, you must connect to your machine through SSH, and run this command:

   $ mkdir installdir/apps/wordpress/htdocs/wp-content/backup-db

Once you have done it, you must add the htaccess example provided by the plugin into the htaccess.conf file and you must create an empty .htaccess file in the backup-db directory to pass the plugin checks. To do it, run the commands below:

   $ echo '<Directory "installdir/apps/wordpress/htdocs/wp-content/backup-db">' >> installdir/apps/wordpress/conf/htaccess.conf
   $ cat installdir/apps/wordpress/htdocs/wp-content/plugins/wp-dbmanager/htaccess.txt >> installdir/apps/wordpress/conf/htaccess.conf
   $ echo '</Directory>' >> installdir/apps/wordpress/conf/htaccess.conf
   $ touch installdir/apps/wordpress/htdocs/wp-content/backup-db/.htaccess

Finally, once you activate the plugin in your WordPress dashboard, you must ensure that in the plugin DB Option the mysql and mysqldump paths are correct. For example, use the paths installdir/mysql/bin/mysql and installdir/mysql/bin/mysqldump.

How to install several WordPress modules on the same stack?

It's easy to install more than one WordPress module on a Bitnami stack. Download it from the Bitnami website, and install it using –wordpress_instance_name NEW_BLOG_NAME option.

First, download the module, and then run the download file with a special parameter.

Windows

 shell> ./bitnami-wordpress-VERSION-module-windows-installer.exe --wordpress_instance_name NEW_BLOG_NAME

Linux

 $ chmod a+x bitnami-wordpress-VERSION-module-linux-x64-installer.run
 $ ./bitnami-wordpress-VERSION-module-linux-x64-installer.run --wordpress_instance_name NEW_BLOG_NAME

Mac OS X

 $ hdiutil mount bitnami-wordpress-VERSION-module-osx-x86_64-installer.dmg
 $ /Volumes/WordPress\ Module\ VERSION/BitNami\ WordPress\ Module.app/Contents/MacOS/installbuilder.sh --wordpress_instance_name NEW_BLOG_NAME

Once you have the module installed, you will be able to access it through http://localhost/NEW_BLOG_NAME

How to optimize a default Bitnami WordPress install?

Web application performance problems are not easy to fix properly. The responsiveness of your application at a given 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, which for most Bitnami stacks is not that difficult, dramatically improve the server performance.

IMPORTANT: To apply each cache plugin, it is assumed that your WordPress instance is already running at the domain root URL, such as at http://mywp.bitnamiapp.com/ or http://example.com/. Please use the bnconfig tool to accomplish this.

W3 Total Cache

Follow these steps:

Troubleshooting
Debugging

If you have problems configuring W3 Total Cache, try to enable "Debug mode". Browse to the W3 Total Cache admin and select at least the "Page Cache" option in the "Debug" section. Then, browse to one of your Web pages and check the source code. There should be debugging information at the end, which you can use to check if caching works properly.

If WordPress is installed at the /wordpress path, there may be a conflict between the permalink rewrites and the ones added by the W3 Total Cache plugin. To resolve this, ensure that all the Rewrite entries are removed or commented out in the installdir/apps/wordpress/conf/httpd-app.conf file:

WP Super Cache

Follow these steps:

  • Download the plugin from https://wordpress.org/plugins/wp-super-cache/.

  • Upload this directory to your plugins directory. It will create a installdir/apps/wordpress/htdocs/wp-content/plugins/wp-super-cache/ directory.

  • If you are using WordPress MU or WordPress Multisite, activate it "network wide".

  • Browse to "Settings -> WP Super Cache" and enable caching.

Using mod_rewrite Caching

To enable this option, modify the file at installdir/apps/wordpress/conf/htaccess.conf with the content that the application displays when you click the "Update Mod_rewrite rules" link. Update your htaccess.conf file so it looks like this:

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

Also add these lines to 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
        </FilesMatch>
        AddEncoding gzip .gz
        AddType text/html .gz
    </IfModule>
    <IfModule mod_deflate.c>
        SetEnvIfNoCase Request_URI \.gz$ no-gzip
    </IfModule>
    <IfModule mod_headers.c>
        Header set Cache-Control 'max-age=3, must-revalidate'
    </IfModule>
    <IfModule mod_expires.c>
        ExpiresActive On
        ExpiresByType text/html A3
    </IfModule> `` # END supercache
</Directory>
Troubleshooting
Debugging

If you have problems configuring WP Super Cache, try to enable "Debug mode". Browse 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.

Prior installation

If you have WP-Cache installed already, please disable it. Edit wp-config.php and make sure that the WP_CACHE and WPCACHEHOME defines are deleted. 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.

Quick Cache

Follow these steps:

Troubleshooting
Permission issues

You might see the following errors:

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.

This arises because the default ownership of the application files is usually set to the bitnami user and daemon group, so users can edit the files directly as the bitnami user and Apache is also able to read them. In this case, when Apache needs to be able to modify any files or directories, it becomes necessary give write permissions to the group too.

Execute the commands below:

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

Minify

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.

Troubleshooting WordPress

I cannot access my WordPress application

First, check that the URL is correct and the servers are running. If the server has recently restarted, the domain name and IP address could have changed. Check in the server administration panel that you are trying to access the correct URL.

To check if the servers are running, connect to the remote machines and run the following commands:

 $ sudo installdir/ctlscript.sh status apache
 $ sudo installdir/ctlscript.sh status mysql
 $ sudo installdir/ctlscript.sh restart apache
 $ sudo installdir/ctlscript.sh restart mysql

If the servers are not running, check the Apache log file or the MySQL log file.

WordPress cannot load images or CSS

This usually happens when the server's IP address changes. WordPress saves the IP address or the domain name in the database so if the IP address changes, it is necessary to update the database as well.

Issue in WordPress with CSS or images

Use the MySQL command-line client to change the exact field in the database:

$ sudo mysql -u root -p -e "USE bitnami_wordpress; UPDATE wp_options SET option_value='http://localhost:PORT/wordpress/' WHERE option_name='siteurl' OR option_name='home';"

WordPress tries to contact external sites when I log in. What can I do?

WordPress tries to contact external resources such as api.wordpress.com, wordpress.org, planet.wordpress.org or blogsearch.google.com. Most of these connections are performed to feed the widgets in the dashboard and are completely harmless. To prevent them, remove the widgets by selecting the "Screen Options" menu in the top right corner:

Screen Option

Then, deselect all the widgets:

Dashboard Widgets

Note some external connections may still be seen when WordPress or its plugins check for updates.

The plugin I installed is not working

Bitnami Wordpress is configured taking security in mind. It means that permissions for the configuration files are tied up. While Wordpress will work with most of plugins out there (and most popular ones), some plugins require further configuration or have issues with permissions (e.g. WP Super Cache).

If you are having permission issues while installing, activating or updating a plugin, log into your server and execute the following command:

$ sudo chmod g+w installdir/apps/wordpress/htdocs/wp-config.php

Please retrieve the previous permissions configuration after activating the plugin.

$ sudo chmod g-w installdir/apps/wordpress/htdocs/wp-config.php

Since Bitnami WordPress Stack 4.5-1, we ship WordPress with the latest version of PHP7. WordPress Core already supports PHP7 but some plugins may not support it yet. If you experience any issue with plugins related to this, check that the plugin you are installing already supports PHP7 or needs to be updated.

We also provide the latest version of WordPress, bundled with the latest version of PHP 5.6 that will avoid possible compatibility issues with plugins not prepared for PHP7. This version should be considered as legacy, WordPress recommends to move to PHP7.

WordPress enters into Maintenance mode after upgrading or activating a plugin. What can I do?

As mentioned before, Bitnami Wordpress is configured taking security in mind. It means that permissions for directories and files are strongly tied up. In the unlikely case that WordPress enters into Maintenance mode after upgrading or activating a plugin, you can try to disable all the plugins in the MySQL database named bitnami_wordpress by connecting to MySQL and running the SQL sentence below:

UPDATE wp_options SET option_value = 'a:0:{}' WHERE option_name = 'active_plugins';

You can connect to the bitnami_wordpress database using the user bn_wordpress and the random password located in the installdir/apps/wordpress/htdocs/wp-config.php file running the command below:

$ mysql -u bn_wordpress -p bitnami_wordpress;

After that, restart all the services for changes to take effect running the command below and try to connect to your website again:

$ sudo installdir/ctlscript.sh restart apache

If you want to activate the plugin that caused you the issue, you need to upgrade it first and then connect to your server via SSH and execute:

$ sudo chown -R bitnami:daemon installdir/apps/wordpress/htdocs/wp-content
$ sudo chmod -R g+w installdir/apps/wordpress/htdocs/wp-content

After that, you should be able to activate the plugin from the WordPress Admin Panel.

How to upgrade WordPress?

It is strongly recommended to create a backup before starting the update process. If you have important data, create and try to restore a backup to ensure that everything works properly.

You can update WordPress easily from its administration panel, as follows:

  • Log in to WordPress using the administrator account.

  • Select the "Dashboard -> Updates" menu item.

    WordPress update

  • Review the resulting page to see if WordPress needs an update. If an update is available, you can install it by clicking the "Update Now" button.

    WordPress update

How to enable multi-site support?

Use the Bitnami WordPress Multisite Stack.

How to re-enable the XML-RPC pingback feature?

A pingback is a special type of comment that is created when you link to another blog post and it is a functionality of the WordPress XML-RPC module.

IMPORTANT: Since the Bitnami WordPress Stack 4.4.2-3, the pingback feature in the XML-RPC module has been disabled.

Other XML-RPC features continue working as before so you can still publish content in your WordPress blog/website from Web clients or smartphone apps.

In order to enable it again, edit the WordPress configuration file (located at installdir/apps/wordpress/htdocs/wp-config.php) and remove the last two filters related to XML-RPC and pingback. Specifically these lines:

    // remove x-pingback HTTP header
    add_filter('wp_headers', function($headers) {
      unset($headers['X-pingback']);
      return $headers;
    });
    // disable pingbacks
      add_filter( 'xmlrpc_methods', function( $methods ) {
      unset( $methods['pingback.ping'] );
      return $methods;
    });

Why is pingback functionality disabled by default?

WordPress implements an interface to use the XML-RPC protocol. This allows features like remote publishing from Web clients, smartphone apps and more. You can find more info in the WordPress Codex XML-RPC Page.

The XML-RPC feature of WordPress is known to be susceptible to two types of attacks:

If most of the entries in your logs come from the same IP address, it's likely your site is either under a brute force amplification attack or being used to launch a pingback attack towards a different site. If the entries come from different IP addresses, your site is probably the victim of a pingback attack.

Please keep in mind that none of these attacks are related to a security issue, but are the result of abusing pingbacks and the XML-RPC mechanism.

The DDoS attack became more popular after WordPress version 3.5 was released with the pingback feature enabled by default.

Current countermeasures:

  • Since Bitnami WordPress Stack 4.4, the brute force amplification attack is no longer exploitable, although a common brute force attack is still possible.
  • Since Bitnami WordPress Stack 4.4.2-3, the pingback feature has been disabled. This means a malicious agent won't be able to use your WordPress to perform DDoS attacks on other instances.
  • We also ship the Jetpack plugin, which can help protect a site against Brute Force attacks thanks to the Protect module. You can find more information at Jetpack website. The plugin is inactive by default, you should enable it using the WordPress admin panel.

Even with these actions, you will still be vulnerable to common brute force attacks using the XML-RPC module.

Apart from these, there are at least two more countermeasures you can apply, although each one has their own drawbacks:

  • Enable mod_security: The mod_security Apache module supplies an array of request filtering and other security features to the Apache HTTP server.
  • Disable XML-RPC: It will avoid both types of attacks but smartphone apps, remote publishing and some plugins won't work. You can find more information at this blog post about disabling XML-RPC in WordPress.
  • Block the offending IP addresses: This should be considered a fragile, short-term solution. Find the procedure in the FAQ.