Create a Multisite on AWS Lightsail

By edgar, 3 January, 2023
Multiple site designs

Back again with more Lightsail tutorials. This time we will take a look at how to setup a multisite instance using AWS Lightsail solution. As we discussed on previous posts, Lightsail is an out of the box solution that creates and configures almost everything so users can get started creating content.

As with most out of the box solutions, there are always issues when it comes to trying to apply custom configurations. In this case, the set configuration for a Drupal Lightsail instance is design for a single site. So in order to convert it to a multisite we will need to do a bit of tinkering.

  1. Connect to your current Drupal instance through your AWS console.
  2. Get your bitnami credentials     
    sudo cat /home/bitnami/bitnami_credentials
  3. Save password
  4. Load MySQL console by entering    
    mysql -u root -p
  5. Enter root password that you saved earlier
  6. Create new database  
    create database DN_NAME
  7. Provide default user access to new database  
    mysql GRANT ALL PRIVILEGES ON database_name.* TO USER_NAME;
  8. Create a new directory under the sites section
  9. Copy the settings.php from the default directory into your new directory.
  10. Edit the database under the  $databases['default']['default'] setting with the name of the database you created on step 6.
  11. Edit the sites.php file by adding the following 
    $sites['example.com'] = 'NEW_DIRECTORY';
  12. Visit the URL that you enter in the previous step.
  13. If everthing goes well you should see your new shiny Drupal site.

Well hope this helps you. Until next time.

Alias
multisite-aws-lightsail

Comments