How to install Xampp in EC2 Amazon AWS Ubuntu Linux
If you have an EC2 instance and you have Ubuntu installed in it and now you want to install Xampp in that machine, this guideline is for you. Remember: This installation will install PHP, Mysql into your EC2 machine. So, if you have previously installed PHP or MySql, please remove them completely and then follow below mentioned guideline.
I am assuming you have key file and you have logged in to your EC2 instance with following command:
sudo ssh -i ubuntu@ec2-your-instance.com
Or you can access your EC2 m/c directly through browser.
Now your steps are described below:
Step 1: Download Xampp in your EC2 machine
wget https://www.apachefriends.org/xampp-files/7.0.23/xampp-linux-x64-7.0.23-0-installer.run
Step 2: Make the xampp file executable for installation with following command
sudo chmod +x xampp-linux-x64–7.0.23–0-installer.run
Step 3: Run the installation
sudo ./xampp-linux-x64–7.0.23–0-installer.run
Note: Give YES permission to all XAMPP instructions and Set your PHPMYADMIN password during installation.
courtesy: https://askubuntu.com/questions/908397/xampplib-line-22-netstat-command-not-found
sudo apt install net-tools
Step 4: After step 3 your xampp is installed inside /opt/lampp. Now you have to start Xampp with following command:
sudo /opt/lampp/lampp start
Now, if you go to your browser and type your IP address, you will see Xampp landing page.
Step 5: courtesy: http://yeslinux.blogspot.com/2012/07/new-xampp-security-concept-solved.html
In New Xampp
All you have to do is to edit the file:
sudo vi /opt/lampp/etc/extra/httpd-xampp.conf
# since XAMPP 1.4.3
<Directory “/opt/lampp/phpmyadmin”>
AllowOverride AuthConfig Limit
Require all granted
ErrorDocument 403 /error/XAMPP_FORBIDDEN.html.var
</Directory>
Require local
To
Require all granted
in the Directory tag.
So the code will look like this
<Directory “/opt/lampp/phpmyadmin”>
AllowOverride AuthConfig Limit
Order allow,deny
Allow from all
Require all granted
</Directory>
Step 6: Now restart Xampp
sudo /opt/lampp/lampp restart
Note: You can check the security settings with following command:
sudo /opt/lampp/xampp security
Step 7:
Open inbound from 80 and 8080 then try Access phpmyadmin with http://your-ip/phpmyadmin
http://3.142.220.76/phpmyadmin
Step 8: Now you have to create .htaccess file at your /opt/lampp/htdocs directory and put follwoing lines
creating file: sudo vi /opt/lampp/htdocs/.htaccess
Put following lines into that file:
RewriteEngine On
RewriteCond %{HTTP_HOST} ^yourdomain.com
RewriteRule (.*) http://www.yourdomain.com/$1 [R=301,L]
RewriteCond %{HTTP_HOST} ^www\.yourdomain\.com$
RewriteCond %{REQUEST_URI} !^/WebProjectFolder/
RewriteRule (.*) /WebProjectFolder/$1
step9: Get your Github code deployed at
/opt/lampp/htdocs
step 10: create DB by importing .sql file of the project: http://34.208.5.210/phpmyadmin/import.php