1. Installing LAMP Stack on Ubuntu Instance
Deploying Play Framework in EC2 - part # 2
kamarul kawnayeen
2. Preface
This is the second part of deploying playframewok in EC2 tutorial series. In the
previous part, I’ve showed how to setup a virtual server on AWS. I setup ubuntu
14.04 LTS there. In this part I’m going to complete setting up LAMP stack.
Considering LAMP, I will use :-
➢ Apache as web server
➢ MySQL as database
➢ PHP as programming language
3. First, we are going to configure corresponding security
group. The security group acts as a firewall allowing you to
choose which protocols and ports are open to computers
over the internet.
Configuring Security Group
11. Now, we have to enable .htaccess file. To do so we have to edit the “000-
default.conf” file at “/etc/apache2/sites-available/” directory
So, move to the sites-available directory and execute the following command
sudo nano 000-default.conf
12. look for /var/www/html directory and make sure it contains AllowOverride
All
save & exit the nano editor via CTRL-X, “y” and Enter
14. Type the ip address of your instance & check
whether apache is running
15. Allow ubuntu user to work with the /var/www/html directory:
sudo adduser ubuntu www-data
sudo chown -R www-data:www-data /var/www/html
sudo chmod -R g+rw /var/www/html
16. Now we are going to test php installation. Go to the /var/www/html directory
and create a file name phptest.php
cd /var/www/html
sudo vi phptest.php
17. hit i key to enter insert mode and just call the phpinfo() function
hit esc to exit insert mode and type :wq to save and quit vi editor
18. type
ip address of your
instance/html/phptest.
php
at your browser to test
php