× {{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!
Jonathan Pike
Jonathan Pike
5.0
Senior backend engineer with 8+ years in Ruby on Rails development
Hi, I'm Jonathan Pike, a senior software developer with 8+ years of experience in Ruby, Rails, and API development. I’m passionate about mentoring...
Hire this Expert
Ricardo
Ricardo
5.0
Senior Software Engineer
Software engineer with 20+ years of professional experience. If you have a problem feel free to contact me, I always go above and beyond to try to...
Hire this Expert