AWS Lightsail – Setting Up Bitnami WordPress Instance with MySQL

amazon-lightsailamazon-web-servicesbitnamiMySQLWordpress

I am used to shared hosting with a cpanel. I have just started learning VPC and can't seem to wrap my head around how lightsail Bitnami WordPress (the one-click installation) instance work.

MySql database:
The MySql database costs $18/month.

  • Is it a separate database from WordPress?
  • Does the Bitnami WordPress installation come with it's own database?
  • When we do a WordPress backup, without creating the MySql database instance, how does the backup of WordPress database work? Will it not backup?
  • Or with the snapshot, we do not have to do the usual WordPress backup?
  • If I have the MySql database instance, will the WordPress installation automatically work with the MySql database?
  • If I have multiple WordPress Instances (not multi-site WordPress), do I have to create an individual MySql database for each?
  • With the Bitnami WordPress Instance, can I add a cpanel to it?

Thanks

Best Answer

Bitnami Engineer here,

  • Is it a separate database from Wordpress?

No, the Bitnami WordPress solution in Lightsail is a SingleVM deployment where Apache, PHP and MySQL are included inside the same instance.

  • Does the Bitnami Wordpress installation come with it's own database?

We configure the database (create a new user and database for WordPress) and configure the application to use it. It has basic information about the WordPress' admin user when you deploy it. Of course, you can configure WordPress to use a separate MySQL database.

  • When we do a Wordpress backup, without creating the MySql database instance, how does the backup of Wordpress database work? Will it not backup?

You can create a WordPress backup easily by using the All in One Migration plugin. Once you install it, you can import/export the data in a few clicks

https://docs.bitnami.com/aws/how-to/migrate-wordpress/

  • Or with the snapshot, we do not have to do the usual Wordpress backup?

If you create a snapshot of the instance, and as all the components are included in the same instance, you don't need to take any other backup to save your data. Once you deploy the snapshot you create, the information will be the same than the one you had when creating it.

  • If I have the MySql database instance, will the Wordpress installation automatically work with the MySql database?

WordPress is configured to use MySQL by default. It uses the local database but as I mentioned before, you can use an external database if needed. You just need to change the WordPress configuration at /opt/bitnami/apps/wordpress/htdocs/wp-config.php.

  • If I have multiple Wordpress Instances (not multi-site Wordpress), do I have to create an individual MySql database for each?

If you want to deploy different WordPress apps on top of the same instance, you will need to follow these steps. These steps assume that your application will live in the /opt/bitnami/apps/myapp/ directory:

1) Run the following commands to create the directories and assign the necessary permissions:

sudo mkdir /opt/bitnami/apps/myapp
sudo mkdir /opt/bitnami/apps/myapp/htdocs/
sudo mkdir /opt/bitnami/apps/myapp/conf
# Copy the WordPress files to this htdocs folder and configure the permissions            
sudo chown -R bitnami:daemon /opt/bitnami/apps/myapp/htdocs/
sudo chmod -R g+w /opt/bitnami/apps/myapp/htdocs/

2) Create and edit the /opt/bitnami/apps/myapp/conf/httpd-prefix.conf file and add the line below to it:

Alias /myapp/ "/opt/bitnami/apps/myapp/htdocs/"
Alias /myapp "/opt/bitnami/apps/myapp/htdocs/"
Include "/opt/bitnami/apps/myapp/conf/httpd-app.conf"

3) Create and edit the /opt/bitnami/apps/myapp/conf/httpd-app.conf file and add the content below to it. This is the main configuration file for your application, so modify it further depending on your application’s requirements.

<Directory /opt/bitnami/apps/myapp/htdocs/>
    Options +FollowSymLinks
    AllowOverride None
    <IfVersion < 2.3 >
    Order allow,deny
    Allow from all
    </IfVersion>
    <IfVersion >= 2.3>
    Require all granted
    </IfVersion>
</Directory>

NOTE: If your application uses .htaccess files, you should change the AllowOverride None option to AllowOverride All. Find out how to move the .htaccess file content to the main server configuration file.

4) Once you have created the files and directories above, add the following line to the end of the main Apache configuration file at /opt/bitnami/apache2/conf/bitnami/bitnami-apps-prefix.conf, as shown below:

Include "/opt/bitnami/apps/myapp/conf/httpd-prefix.conf"

5) Restart the Apache server:

sudo /opt/bitnami/ctlscript.sh restart apache

You should now be able to access the application at http://SERVER-IP/myapp.

More information here: https://docs.bitnami.com/aws/apps/wordpress/administration/create-custom-application-php/

  • With the Bitnami Wordpress Instance, can I add a cpanel to it?

The Bitnami solution doesn't use the system's packages. All the services are inside the /opt/bitnami folder so I don't know if cpanel supports that. We do not provide support for it by the way.

Related Topic