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 includes a 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 admin that is used for SSH access has also been given www-data web server user group permissions.
This gives admin 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 the Debian Project.
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.
Debian 10 Server Administration
To administer Debian 10 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 MariaDB root password
To set MariaDB (identical to MySQL database server) 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 custom 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 custom domain name that you want pointing to your server is paymypage.com then your DNS records should be added as follows:
To get the public IP for your EC2 instance launched using our service, click here.
If you need to register a custom 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:
- 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.
- 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:
- 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
- Get the WordPress 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:
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
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.
Complete the Setup
Before you begin next steps, you will also need to access your EC2 instance via SSH to:
- 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
- Get the Prestashop 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 Prestashop using the web installer script.
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.
To run the web installer script, just visit the public Hostname/DNS or your custom domain/sub-domain using a web browser.
The web installation process will take you through a number of pages. The web installer can take some time - please be patient.
Once the web installer has completed you should delete the install folder by accessing the /var/www/html/prestashop directory via SFTP or by running the following command via SSH access:
rm -R /var/www/html/prestashop/install
Use Custom Domain/Sub-domain
You can use a custom domain/sub-domain by adding a CNAME record in your domain's DNS settings. You can look up the public Hostname/DNS for your EC2 instance from your EC2 launch history.
For example, for a subdomain app.iwebz.net to point to the public Hostname/DNS of your EC2 instance, we add a CNAME record for app in the DNS settings for iwebz.net as follows:
When this record has propagated to DNS servers globally within the next 1-4 hours, you can access this web app using http://app.iwebz.net
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
You can then access this web app using https://app.iwebz.net
Once the background installation is complete after the launch of your EC2, you can setup NextCloud 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.
The NextCloud database name, database username, and the database password will be stored in the file /var/log/dbsetup.log on your EC2 instance. To view them you will need to access the instance via SSH.
You can follow the Official NextCloud usage guide for completing the manual part of the setup from this step.
Thereafter, you can refer to next steps from this point.
Activate Apps in NextCloud
During the Nextcloud server installation, some apps are enabled by default.
To activate additional apps run the following commands via SSH.
For External storage support
sudo -u www-data php /var/www/nextcloud/occ app:install files_external
sudo -u www-data php /var/www/nextcloud/occ app:enable files_external
For LDAP user and group backend
sudo -u www-data php /var/www/nextcloud/occ app:install user_ldap
sudo -u www-data php /var/www/nextcloud/occ app:enable user_ldap
For updating ALL apps together
sudo -u www-data php /var/www/nextcloud/occ app:update --all
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:
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
You can then access this web app using https://app.iwebz.net
Complete the Setup
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:
- 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
- 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 Moodle using the web installer script.
To run the web installer script, just visit the public Hostname/DNS or your custom domain/sub-domain using a web browser.
The web installation process will take you through a number of pages. When asked for the database connectivity option, select the MariaDB option.
You will then be asked to confirm the copyright, see the database tables being created, supply administrator account details and supply the website details.
The database creation can take some time - please be patient.
You should eventually end up at the Moodle front page with an invitation to create a new course.
You can follow the Official Moodle usage guide for completing the manual part of the setup from this step.
Use Custom Domain/Sub-domain
You can use a custom domain/sub-domain by adding a CNAME record in your domain's DNS settings. You can look up the public Hostname/DNS for your EC2 instance from your EC2 launch history.
For example, for a subdomain app.iwebz.net to point to the public Hostname/DNS of your EC2 instance, we add a CNAME record for app in the DNS settings for iwebz.net as follows:
When this record has propagated to DNS servers globally within the next 1-4 hours, you can access this web app using http://app.iwebz.net
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
You can then access this web app using https://app.iwebz.net
Once the background installation is complete after the launch of your EC2, you can setup Mautic 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.
The Mautic database name, database username, and the database password will be stored in the file /var/log/dbsetup.log on your EC2 instance. To view them you will need to access the instance via SSH.
You can follow the Official Mautic usage guide for completing the manual part of the setup from this step.
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:
When this record has propagated to DNS servers globally within the next 1-4 hours, you can access this web app using http://app.iwebz.net
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
You can then access this web app using https://app.iwebz.net
If your instance is not as expected, contact our helpdesk here for clarification.