Additional Info for LAMP Stack and Apps on Ubuntu 20.04 LTS

Installation of LAMP Stack and other components takes many minutes after EC2 instance launch. Please proceed to access it only after 10 minutes of launch.

If your installation also includesa LAMP Stack App (such as WordPress), you should access the server 15 minutes after launch to give the installation time to complete.

SSH Access

For SSH access see this page for instructions.

Swap Memory

Swap memory has been created with a 1 GB swap file located at /var/myswap.

To know more about managing swap visit this page.

File Permissions

Debian user ubuntu that is used for SSH access has also been given www-data web server user group permissions.

This gives ubuntu user permissions for SFTP Upload/Edit/Delete actions on files and directories located under /var/www

System disk size

EBS volume (system storage disk) has the default size as provided originally by the fresh server image from Canonical.

We recommend you increase storage to atleast 10 GB. Visit this page to know how to modify EBS volume size.

Remember to extend the Linux file system after increasing EBS volume size.

Ubuntu 20.04 LTS Administration

To administer Ubuntu 20.04 LTS Server directly using SSH, refer to this guide.

SSL Certificates (only if your launch included a Certbot install)

Certbot has been installed to fetch free Let's Encrypt SSL certificates for hosted websites.

Before you proceed ensure you have updated or added VirtualHost (website) configurations under /etc/apache2/sites-available directory for the domains/sub-domains for which you wish to get SSL certificates via Certbot.

You can use it for fetching free SSL certificate for websites hosted on your EC2 instance using SSH access.

To begin fetching certificates for websites setup on your Ec2 instance run the command:

sudo certbot --apache

Once fetched, Certbot will automatically fetch fresh certificate files for each website and install them before their certificate expires.

Visit this page for more commands from the official Certbot user guide.

Please note that Certbot has been installed using Canonical's Snap package manager as recommended by the official Certbot documentation.

Suggested Next Steps

Set/Reset the MySQL root password

To set MySQL root password, connect to this instance via SSH access, and run the following command at the prompt:

sudo mysql_secure_installation

Setup DNS records for Domain or Sub-domain

If you intend to use one or more domains or sub-domains with your EC2 instance, you should setup an 'A' record in your domain DNS settings pointing to your instance's public IP.

For example, if the domain name that you want pointing to your server is paymypage.com then your DNS records should be added as follows:

dns a-record for ec2 instance

To get the public IP for your EC2 instance launched using our service, click here.

If you need to register a new domain name for the purpose, click here.

Setup Third-Party SSL Certificate for a Custom Domain

If you wish to use a premium SSL certificate with a custom domain/sub-domain then follow these instructions.

Setup VirtualHost (website) configuration(s)

Whether you wish you use multiple websites on your Debian server or you wish to have WordPress or one website running in Apache's default virtual host configuration, you need to know how to setup and configure them. read tutorial from Setting Up Virtual Hosts...

Install phpMyAdmin

phpMyAdmin lets you manage MySQL databases on your server using just your web browser.

To install, connect the EC2 instance via SSH access and run the following command:

sudo apt-get install phpmyadmin

Website Backups

After you setup your custom domain you should think of keeping a backup of your website(s) in case something goes wrong with any updates you make, or if you plan a major overhaul of the website and wish to rollback to a previous state.

There are TWO ways to perform backups:

  1. Take regular EBS snapshots - You can do this manually from the AWS management console, or automate it using AWS CLI. In both cases, there is a cost to storing the snapshots so you should plan them accordingly.
  2. Use a third-party backup service - You can use a reputed third-party website backup service. The backup service will backup all files in the website's Virtual Host directory, and associated database(s) in MySQL/MariaDB.

 

Next Steps for LAMP Stack Apps (only if they were included in your EC2 launch)

Once the background installation is complete after the launch of your EC2, you can setup your WordPress blog or website by visiting the public Hostname/DNS for your EC2 instance. You can look up the public hostname from your EC2 launch history.

If you wish to use a custom domain/sub-domain with this app, we recommend you switch to using a custom domain/sub-domain (see below) before you proceed.

Before you begin next steps, you will also need to access your EC2 instance via SSH to:

  1. Set the correct timezone for your server in date.timezone variable in the /etc/php/7.3/apache2/php.ini file using the following command.
    sudo nano /etc/php/7.3/apache2/php.ini
    This could be based on your location, or server location, or your largest audience's location.
    [Date]
    ; Defines the default timezone used by the date functions
    ; http://php.net/date.timezone
    date.timezone = Asia/Kolkata

    After changing the timezone, remember to restart the web server before you proceed with the following command.
    sudo systemctl restart apache2
  2. Get the Moodle database name, database username, and the database password stored in the file /var/log/dbsetup.log on your EC2 instance using the following command.
    sudo nano /var/log/dbsetup.log

You can now complete the setup of WordPress using the web installer script. The web installation process will take you through a number of pages.

Use Custom Domain/Sub-domain

You can use a custom domain/sub-domain by adding a CNAME record in your domain's DNS settings.

For example, for a subdomain app.iwebz.net we add a CNAME record for app in the DNS settings for iwebz.net as follows:

dns cname subdomain

Fetch and Use Free SSL Certificate For Custom Domain/Sub-domain

Run the following command and follow the wizard as shown below:

sudo certbot --apache

certbot apache add subdomain

You can then access this web app using https://app.iwebz.net

Recommended Plugins

Here are some recommended plugins you should install for improved functionality before you start using WordPress:

  • Akismet
  • All in One SEO Pack
  • All in One WP Migration
  • Jetpack
  • Simple Tags
  • WP Mail SMTP
  • Google Analytics for WordPress

Official WordPress usage guide can be found here.

If your instance is not as expected, contact our helpdesk here for clarification.