How to Set Up XAMPP Server on an Ubuntu AWS EC2 Instance: A Complete Guide

S3CloudHub - Sep 14 - - Dev Community

If you’re looking to host web applications on AWS EC2 and need a powerful, flexible local server environment, XAMPP is an excellent choice. In this guide, I’ll walk you through the process of setting up a XAMPP server on an Ubuntu instance hosted on AWS EC2. Whether you’re a beginner or have some experience with cloud services, this step-by-step tutorial will help you get your XAMPP server up and running in no time!

For a visual walkthrough of the concepts covered in this article, check out my YouTube Video:-
image alt text here

Step 1: Launch Your EC2 Instance on AWS

  1. Choose the AMI (Amazon Machine Image): Select Ubuntu as your operating system. I recommend using the latest version of Ubuntu for the best compatibility.
  2. Instance Type: For most users, a t2.micro instance works well, especially if you’re on the free tier.
  3. Configure Instance: Set up the network settings, such as VPC and subnet. You can use the default configurations if you’re unsure.
  4. Add Storage: The default 8GB of storage should be sufficient, but you can increase this if your application needs more space.
  5. Configure Security Group: Make sure to open the HTTP, HTTPS, and SSH ports so you can access your server from a web browser and securely connect to it via SSH.
  6. Launch and Connect: Once your instance is running, connect to it using SSH from your local machine.

Step 2: Install XAMPP on Your Ubuntu EC2 Instance
Now that your EC2 instance is up and running, the next step is to install XAMPP.

1.Download XAMPP:

wget https://www.apachefriends.org/xampp-files/x.x.x/xampp-linux-x64-x.x.x-installer.run
Enter fullscreen mode Exit fullscreen mode
  1. Make the Installer Executable:
sudo chmod +x xampp-linux-x64-x.x.x-installer.run
Enter fullscreen mode Exit fullscreen mode
  1. Run the Installer:
sudo ./xampp-linux-x64-x.x.x-installer.run
Enter fullscreen mode Exit fullscreen mode

Follow the on-screen instructions to complete the installation process.

Step 3: Start XAMPP
Once XAMPP is installed, start the services (Apache, MySQL, and ProFTPD) by running the following command:

sudo /opt/lampp/lampp start
Enter fullscreen mode Exit fullscreen mode

To verify that XAMPP is running, open your browser and enter your EC2 instance’s public IP address followed by /xampp. If the installation was successful, you should see the XAMPP dashboard.

Step 4: Configuring Your Server for Web Access
1.By default, XAMPP is accessible only from localhost. To make it accessible from the web, you’ll need to modify the configuration file.

Edit the httpd.conf File:

sudo nano /opt/lampp/etc/httpd.conf
Enter fullscreen mode Exit fullscreen mode
  1. Update the Security Configuration: Look for the line that restricts access and update it to allow access from any IP address:

Require all granted
3.Restart XAMPP:

sudo /opt/lampp/lampp restart
Enter fullscreen mode Exit fullscreen mode

Step 5: Manage Security Settings
Ensure your EC2 instance’s security group allows inbound traffic on ports 80 (HTTP) and 443 (HTTPS) so external users can access your website. Additionally, consider configuring SSL for a more secure setup, especially if you plan to handle sensitive data.

Final Thoughts
Congratulations! You’ve successfully set up a XAMPP server on an Ubuntu AWS EC2 instance. With this setup, you’re now ready to deploy and test web applications on a flexible cloud platform. AWS provides a scalable environment, and XAMPP offers the familiar functionality of Apache, MySQL, PHP, and Perl.

Connect with Us!
Stay connected with us for the latest updates, tutorials, and exclusive content:

WhatsApp:-https://www.whatsapp.com/channel/0029VaeX6b73GJOuCyYRik0i
facebook:-https://www.facebook.com/S3CloudHub
youtube:-https://www.youtube.com/@s3cloudhub

Connect with us today and enhance your learning journey!

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Terabox Video Player