Tuesday, December 13, 2011

Amazon EC2: Install LAMP stack to it

I have talked about creating an Amazon EC2 account, defining access credentials, launching an instance and connecting to it with putty. Now what? The most logical step next is to load some software to it and start experimenting with it. A very practical way is to configure it as a standalone LAMP stack.
  • Connecting to you instance with putty. Run command sudo su
Install Apache with command: yum install httpd
          


Install mySQL server with command: yum install mysql-server mysql


Install PHP with command: yum install php php-mysql


Install other optional php packages if you want.

Start Apache server with command: service httpd start.

To test your Apache and PHP install, go to /var/www/html/ directory and create a file index.php with one line of code:
<?php phpinfo(); ?>
In your favorate browser, enter your instance's public DNS name, something like ec2-##-##-##-###.compute-#.amazonaws.com.

1 comment:

  1. what are the available PHP optional packages?

    ReplyDelete