Launching an application using XAMPP on EC2 AWS Ubuntu

121 Likes Comment
Letsencrypt XAMPP

If you’re having an only 1Gb RAM , 30 Gb storage VPS on ECS AWS, how will you deploy a website? Here is my suggestion.

  1. Launch an instance using Ubuntu ( not Windows OS , because it needs more than 20 Gbs to complete an Windows Server instance ).
  2. Assign an Elastic Ip for your instance, connect via SSH.
  3. Setup XAMPP for linux on your ubuntu .

+ Stop ubuntu apache process:

/etc/init.d/httpd stop

+ Get xampp installation script:
sudo chmod +x
sudo ./

+ XAMPP / LAMPP commands:
sudo /opt/lampp/lampp start
sudo /opt/lampp/lampp stop
sudo /opt/lampp/lampp restart

Set rules to access phpmyadmin at : /opt/lampp/etc/extra/httpd-xampp.conf
4. Configure virtual hosts
Change the permission for lampp daemon user (default in /opt/lampp/etc/httpd.conf)
chown -R daemon.daemon /opt/lampp/htdocs

ServerAdmin [email protected]
DocumentRoot "/opt/lampp/htdocs/"
DirectoryIndex index.php
ErrorLog "logs/dulichclub1-error_log"
CustomLog "logs/dulichclub1-access_log" common

+ Install let’s encrypt: using certbot
sudo add-apt-repository ppa:certbot/certbot
sudo apt-get update
sudo apt-get install python-certbot-apache

Install ssl cert for a domain
sudo certbot --apache -d
for multiple domains , sub-domains
sudo certbot --apache -d -d -d
full command
certbot certonly --lampp -a webroot --webroot-path=/opt/lampp/htdocs/ -m [email protected] --agree-tos -d

+Virtual host sample configuration

DocumentRoot "/opt/lampp/htdocs/"
ServerAdmin [email protected]
ErrorLog "/opt/lampp/logs/godl-error_log"
TransferLog "/opt/lampp/logs/godl-access_log"
SSLEngine on
SSLCertificateFile "/etc/letsencrypt/live/"
SSLCertificateKeyFile "/etc/letsencrypt/live/"
SSLCertificateChainFile "/etc/letsencrypt/live/"

5. Test your SSL website url:

You might like


About the Author: Toc Xoan

Leave a Reply

Your email address will not be published. Required fields are marked *