× {{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!
Lucas Meine
Lucas Meine
5.0
Senior fullstack developer with 10+ years of experience
I am a seasoned software engineer based in Gothenburg, Sweden, with about a decade of industry experience. I am passionate about software...
Hire this Expert
Humayun Shabbir
Humayun Shabbir
5.0
Expert Visual Basic, C# and JavaScript Developer | 3500+ sessions
Welcome to my profile on Codementor! I'm a dedicated full-time mentor with a track record of over 3500 sessions since 2015. My journey in...
Hire this Expert
comments powered by Disqus