Amazon EC2 Linux as LAMP server

The following guide demonstrates how to install

  • Apache Webserver 2.4
  • PHP 5.4
  • MySQL Server 5.5 (Community Edition)

Step 1: install Apache, PHP, MySQL

sudo yum install -y httpd24 php54 mysql55

Step 2: start the services

sudo /etc/init.d/mysqld start
sudo /etc/init.d/httpd start

Step 3: make sure services start after a reboot

sudo chkconfig --level 2345 httpd on
sudo chkconfig --level 2345 mysqld on

Amazon Linux AMI as LAMP setup

Aside

The following guide demonstrates how to install Apache Webserver 2.2, PHP 5.3, MySQL Server 5.1 (Community Edition) and Perl (without mod_perl).

sudo yum install -y httpd php php-pear mysql mysql-server perl php-common php-dba php-pdo php-mysql php-xml php-xmlrpc

Then start Apache HTTPD and MySQL Server:

sudo /etc/init.d/mysqld start
sudo /etc/init.d/httpd start

And make sure it`s always loaded on startup:
sudo chkconfig --level 2345 httpd on
sudo chkconfig --level 2345 mysqld on