× {{alert.msg}} Never ask again
Receive New Tutorials
GET IT FREE

Tutorial: How to setup LAMP on Ubuntu hosted on AWS

– {{showDate(postTime)}}

Codementor Dominic Myers has been developing with Javascript for over seven years and is passionate about Javascript and PHP. This simple step-by-step guide was originally posted on his blog.


I’ve done this more times than I care to remember lately so I’m going to remember it here.

Boot up an AWS Ubuntu Server 14.04 instance, use MobaXterm to log in with ubuntu as the username then:

sudo apt-get update

Don’t worry about grub – it’s not used as far as I’m aware

sudo apt-get upgrade

Install LAMP (don’t forget a password for root on MySQL)

sudo apt-get install lamp-server^

The web-root directory is /var/www/html so we’ll give ourselves permission to play there using (adapted from Ulyssesonline):

sudo chgrp www-data /var/www/html
sudo chmod 775 /var/www/html
sudo chmod g+s /var/www/html
sudo usermod -a -G www-data ubuntu
sudo chown ubuntu /var/www/html/

We’ll also need curl:

sudo apt-get install php5-curl

and Mcrypt:

sudo apt-get install php5-mcrypt
sudo php5enmod mcrypt
sudo service apache2 reload

Sort out Mod-rewrite

sudo a2enmod rewrite
sudo service apache2 restart

Move to web-root

cd /var/www/html/

And you’re done!


Dominic MyersNeed Dominic’s help? Book a 1-on-1 session!

View Dominic’s Profile

or join us as an expert mentor!



Author
Dominic Myers
Dominic Myers
5.0
LAMPer with significant JavaScript experience
I love JavaScript... I really, really LOVE JavaScript! I quite like PHP and HTML/CSS. I've also been forced to develop for IE6 so I love jQuery as well. 5 years of experience after being mostly...
Hire the Author

Questions about this tutorial?  Get Live 1:1 help from PHP experts!
Alok Agarwal
Alok Agarwal
5.0
An IT professional well versed with various technologies
I have a great passion for solving problems and can help people with various programming languages, databases, information systems, software...
Hire this Expert
Samir Habib Zahmani
Samir Habib Zahmani
5.0
Senior Fullstack NodeJS Developer with 8 years of work experience.
So, you want to create a fancy website or web application. You *"embellished"* your resumé by saying you are a competent web developer, and now...
Hire this Expert