#C06 Installing Lightsail and Drupal.

Go to Lightsail to install the instance of Drupal that Bitnami provides.

Amazon Lightsail.

Log in to the AWS console with the execution account, created with IAM, and install Drupal on Lightsail.

You will create an instance of Drupal in Lightsail. This instance will be a Drupal package that Bitnami has optimised for Lightsail. At first, I didn't really understand what Lightsail was, but simply put, it is a VPS provided by a domestic hosting service.

There are two plans for using Lightsail: [Install only the OS] and build the desired environment yourself, and [OS and application package], which can be used at the same time as installation.

  1. [Plans that install only the OS] are similar to general VPS plans, where you select and install an OS, and build the environment by installing the applications you want to use yourself.
  2. The [Plan with OS and applications as a package] is a plan that installs the OS and WordPress or Drupal at the same time, and is suitable for using WordPress or Drupal exclusively.

Whichever you choose, you can install Drupal, but as this is the first time we are using AWS, we have chosen an OS and Drupal package that simplifies the configuration as much as possible and allows us to run Drupal as soon as possible. This Drupal package will be the one provided by Bitnami.

Bitnami.

Bitnami offers a number of CMSs and FrameWork optimised for cloud services for distribution. Some of the best known are optimised for cloud services such as AWS, Google and Azure.

The benefits of Bitnami's packages include the basic Apache and DB settings required for installation, and the CMS and framework packages that have been optimised and verified for the OS, PHP and DB environments provided by the cloud services. This makes it easy to install by selecting the CMS or framework of your choice from the AWS console.

1.Lightsail.

One of the best aspects of Lightsail is that it is very easy to build the prepared environment. This means that if a general user such as a student or myself wants to use a CMS or development environment, which is what AWS expects, they can do so without the hassle of installation and configuration by specifying the server specs, OS and application.

The plan selected this time, with Drupal as the operating system and application, is

  1. It takes the form of a Drupal installation on a virtual server called Lightsail.
  2. The Bitnami Drupal instance is a pre-configured package with Apache and MariaDB.
  3. You configure and install a virtual server called Lightsail, which is an instance of Drupal on Lightsail with a pre-configured Drupal package installed at the same time.

The installation is very easy, as the OS and necessary applications are installed at the same time as the installation of the virtual server with specified CPU and memory configurations. The service is like a WordPress plan prepared by a domestic VPS.

1-1.Select Lightsail.

Log in to the AWS console with the execution account you created with IAM.

After logging in, enter ‘Lightsail’ in the ‘Search’ field at the top left of the screen, the search results will be displayed and Services > Lightsail will be displayed, so click Lightsail Then, the Lightsail administration screen will open.

When the Lightsail administration screen opens, the left menu bar displays

  1. [Instances] Instances installed on the virtual server are displayed. // Instances of Drupal are displayed.
  2. [Containers] Container services are displayed. // Not used
  3. [Database] The database is displayed. // Not used
  4. [Networking] Static IPs, load balancers and CDNs are displayed. // Only static IPs are in use.
  5. [Storage] Displays the disks you have added. // Not in use
  6. [Domain and DNS] Shows DNS zones and acquired domains. // Both DNS and domains are in use
  7. [Snapshots] Displays snapshots/backups // Not used
  8. [Export] You can export data from an instance or snapshot to a new EC2.
  9. [Documentation] Lightsail documentation.

menu and the menu item you have chosen will be displayed on the main screen. Initially, the menu items will not be displayed as nothing is installed.

1-2.Drupal installation.
Creating a Drupal instance.

Install Drupal from the Lightsail administration screen. Here you can also specify the VPS virtual server at the same time.

Select Instances from the menu > Click Create Instance.

The Create Instance screen will appear.

  1. [Select Instance Allocation -> // Virginia - Zone A and View / Depending on your login status, click Change AWS Region and Availability Zone and select // Tokyo from the regions displayed.
  2. [Select platform]
  3. [Select Instance Image -> Select Linux/Unix or Microsoft. // Select Linux/Unix.
  4. [Select blueprint] -> Select app + OS/operating system (OS) only // Select app + OS
    Select 
  5. [among several CMSs listed] -> // Select Drupal
  6. [Options] -> Startup script // Not configured. *Additional installation scripts, etc. can be put in.
  7. [Change SSH key pair] -> // You can set the SSH key. It is not set here as it can be set later.
  8. [Enable automatic snapshot] -> // Not selected here as it can be set later.

Creating an instance plan

  1. [Select Network Type -> // Select Dual Stack
  2. [Select Size] -> // Choose from courses from $5 to $384 // Select $12 - 2GB memory - 2vCPU - 60GB SSD - 3TB transfer
  3. [Confirm instance -> // 1 set of Drupal
  4. [Tagging options] -> // Optional e.g. Drupal
  5. [Add key value tag] -> // optional e.g. Bootstrap / Blog

Create instance

With the above information, click on ‘Create instance’ to create an instance of Drupal.

Checking after creating an instance.

Once the instance has been successfully created, the instance of Drupal will appear in the instance in the Lightsail administration screen.
Instance name is [ Drupal ], Region info - [ Tokyo ], Public IP address - [ XXX.XX.XXX.XX ], Instance status - [ Running ], Networking type - [ Dual stack ], Private IP address - [ XXX.XXX.XX.XX ], Public-[ IPv6-2224:rs53:772g:... ] and scroll down to see information such as Hello! Welcome to your Drupal instance! and information such as connecting to the instance.

In this state, the static IP, initial Drupal configuration, domain assignment and SSL configuration have not been completed, so we will proceed with the configuration from here onwards.

1-3.Things to do after creating an instance.

Follow the official Lightsail documentation to configure the following settings.

  1. Read the Bitnami documentation.
  2. Get login information for the Drupal admin panel
  3. The instance's IP address is dynamic by default, so assign a static IP address
  4. The Drupal administration screen is up, log in and perform the initial configuration
  5. Assign a domain
  6. Configure SSL settings
  7. Build the website from the Drupal administration screen
  8. Create a snapshot of the instance

Official Lightsail documentation. Configuring and customising Drupal with Lightsail

The configuration details described in the official documentation are explained in detail, so we will refrain from explaining them here. By following the instructions, the Drupal installed on Lightsail will be activated and the website will be launched.

Supplementary information,

  1. SSH connection can be made from the web console, but since I want to use it from Mac terminals and Mac applications such as Vscord, I issue an SSH secret key and configure the Mac settings.
  2. The domain is acquired from AWS and the domain is allocated to the Drupal instance installed this time.
    The following is an explanation of how to do this.
2.Generate SSH private key.

Issue the SSH private key to access the Drupal instance you have created.

  1. Select the account name in the top right-hand corner of the Lightsail administration screen.
  2. Select ‘Account’ from the pull-down menu.
  3. The account screen will appear and select ‘SSH Key’.
  4. Select ‘Create Key Pair’ for the custom key.
  5. The region selection screen will appear, select the Tokyo region where the Drupal instance was installed.
  6. Enter a name and issue the key. For example, drupal.
  7. Download the issued key: a key called drupal.pem will be downloaded.
  8. Set up your Mac, but move the SSH key to the MacintoshHD > Users > Username > .ssh folder.
  9. It is a hidden file, so you can move it with the mv command in the terminal or with the following finder operation.
  10. The easy way is to view the hidden file in the Finder and move it with the mouse. Command + Shift + . (dot)
  11. After moving the key to the .ssh folder, SSH to Lightsail by entering the following command in the terminal.
  12. ssh -i ~/.ssh/drupal.pem bitnami@<instance static IP>.
  13. You can now log in to your Bitnami instance.

When you log in, you will see bitnami@ip-XXX-XXX-XXX-XXX-XXX:~$.

Looking at the Drupal root directory in $ drush core:status, Drupal root : /opt/bitnami/drupal

The root directory of Drupal is now /opt/bitnami/drupal. If you have trouble making an SSH connection to Bitnami from the Mac terminal, you can also make an SSH connection from the instance's console.

$ drush core:status If you look at the Drupal root directory in the Drupal root  : /opt/bitnami/drupal

3.Domain registration.

Obtain a domain for the Drupal installation you have just installed.

The domain is acquired using AWS Route53.

  1. Select ‘Domains and DNS’ from the left menu of the Lightsail administration screen.
  2. Click on Register Domain to open the Route53 domain acquisition screen.
  3. Fill in the required fields for [Specify domain name], [Automatic domain renewal], [Domain contact information],
  4. [Privacy protection] and [DNS zone].
  5. [Click on Register domain.
  6. A confirmation email will be sent to the email address you entered in the domain contact information.
  7. A verified message will be displayed and the Route53 contact verification will be completed.
  8. You can now use the domain you have acquired.
  9. Lock the domain transfer with Route53.

Reference: Route53 Registering a new domain.

3-1.DNS settings.

Now that you have a domain, assign it to your Drupal instance. As we are using Lightsail this time, we will use Lightsail's DNS. If you have not set up a static IP at this point, do so first.

  1. To configure a static IP, select ‘Networking’ from the left menu of the Lightsail administration screen.
  2. The public IPv4 address is set to a dynamic address, so [Attach] the [Static Address].
  3. When the static IP is enabled, it will appear on the screen of the Drupal instance as [StaticIP-1].

Once the static IP is enabled, go ahead and assign the acquired domain to the Drupal instance.

The Lightsail DNS will be used, so configure the following settings.

  1. To configure DNS settings, select ‘Domains and DNS’ from the left menu of the Lightsail administration screen.
  2. Select Create DNS zone.
  3. The DNS zone configuration screen for the domain name opens.
  4. On the Domain tab, you will see the name server information: as you have acquired the domain via Route53, the name servers are automatically assigned to it.
  5. Select Assign and assign the domain and static IP. Go on to add the root domain, the domain with WWW and, if necessary, subdomains. For domain allocation, choose from the root domain, subdomains and all subdomains, and select either static IP or IPv6.
  6. Once the assignment is complete, configure the DNS records. Click Add Record, select A Record for the record type, and go on to add the root domain, with WWW, and subdomains if necessary. [Record type is A record], [Record
  7. name is Domain] and [Resolve to: static IP].
  8. Record name is the part of the field corresponding to the subdomain. For the root domain, enter a so that it
  9. becomes a.example.com as no spaces are allowed.

This completes the DNS configuration, so you can access the site with your domain.

Reference Understanding Lightsail

4.SSL settings.

Once the domain has been allocated, the SSL settings are configured.
The SSL configuration can be found in the

Official Lightsail documentation  Configuring and customising Drupal with Lightsail

for a detailed and easy-to-understand explanation.

The SSH login is required, so log in from the local terminal client set up by issuing the SSH private key, or log in from the cloud shell and configure the settings. The configuration is completed by simply copying and pasting the specified commands in order, as instructed in the official documentation.

5.Ready for release.

With Lightsail and Drupal installed, the domain assigned and SSL set up, the website to be built with Drupal is ready for publication. From now on, you will need to set up your email account and, from a security point of view, configure your reCAPTHA settings.

Below is a summary of the official AWS and Bitnami guides that we used as reference when performing this installation and configuration.

AWS Official Guide.

Lightsail > Official user guide / Japanese 
This is a comprehensive guide to Lightsail.

Configuring and customising a Drupal website with Lightsail
Installation and configuration information for the Drupal instance installed this time.


Bitnami AWS Cloud packages> Official user guide / English 
This is the official guide of Bitnami, which distributes the Drupal package installed in this case.


Lightsail Domain and DNS Guide > Official User Guide / Japanese
This is how to get a domain from the Lightsail screen and how to use the DNS managed by Lightsail.


Route53 Registering a new domain
Domain acquisition is handled by Route53 and domain management is also handled by Route53.

What we did this time.
  1. Installing Lightsail and a Drupal instance
  2. Setting up a static IP for the Drupal instance
  3. Configuration of SSH for the Drupal instance
  4. Acquiring a domain with Route53
  5. Configuring DNS on the Drupal instance
  6. Configuring SSL on the Drupal instance

and your Drupal-built website is ready to be published.

Conclude.

This time, we installed Lightsail and Drupal; the installation is easily completed from the Lightsail administration screen by simply specifying the simple specs and initial configuration required in the GUI. After the installation is complete, a static IP is attached to the instance, a new domain is acquired, the domain is allocated, SSL settings are made, and the website built with Drupal is ready to be published via https://.

Preconceived notions of AWS are that it is complex and difficult to understand, but having actually used it myself, I find that although it takes some getting used to, the processes make sense and the system is very efficient and simple to use, allowing me to get the functionality I need to work.

The article makes it seem like a long and complicated process, but in reality it is not as difficult as it sounds and the installation and configuration went more easily than I had initially thought.

Next article
Amazon Work Mail.

In the next section, email accounts for the acquired domain are made available.

Post
2024-11-03
Contributor
S.Takeda
Article
Related articles.

This is a related article on Drupal and web development. Please take a look if you like.

#C06 Installing Lightsail and Drupal.

The installation is easy to complete, as the virtual server called Lightsail and the optimised Drupal are installed at the same time.

#C26 Civic Theme

This is an article about Civic Theme, which sparked my interest in Drupal and led me to build and publish a website.

#C16 Basics of creating page.

I've been writing a series of articles on the basic concepts of Drupal that are necessary for creating pages, but since it's become a lot of articles and it's hard to understand, I'm going to organise them.

Side Bar 01

I migrated my lifestyle blog, which I created using Word Press, to Drupal, and I am currently updating it by adding articles in Drupal.

This is a blog written by a beginner who is learning Drupal.

This article will explain how to build a website using Drupal.

  All Article.

  Drupal Article.

  Web site Article.

  Mac Article.

  AWS Article.

This article is about second-hand clothes and fashion.

  All Article.

  Old-Clothes Article.

  Fashion Article.

  Watch Article.

  Photo Article.

  Recommended Shops.

Core Drupal 10.4.0

Theme Bootstrap5 4.0.3

  Drupal

  bootstrap5

  Bootstrap

  Font Awesome

  Amazon Web Service

  Amazon Lightsail

  Bitnami

  Google reCAPTCHA