Quickguide- Setting up Apache, PHP and MySQL on Linux servers

Login to server from terminal using ssh-

ssh root@serverip (run this in terminal)

Password- ******

To install Apache server:

At a terminal prompt enter the following command:

sudo apt-get install apache2

To install PHP5:

sudo apt-get install php5 libapache2-mod-php5

Enable PHP5 command prompt client:

sudo apt-get install php5-cli

Install cgi for PHP5-execute PHP5 scripts without installing PHP5 Apache module:

sudo apt-get install php5-cgi

Install MySQL

sudo apt-get install php5-mysql

To check if server is running-

Add a phpinfo.php file to /www folder. To add files use sftp-

Content of phpinfo.php

<?php

phpinfo();

?>

and try to access- http://serverip/phpinfo.php, if you see php information for your server, it means your server is up and running.

Some useful links and commands-

Modify default Apache server settings-

nano /etc/apache2/sites-available/default

Restart Apache Service-

sudo service apache2 restart

Test Server Details-

Welcome to Ubuntu 12.10 (GNU/Linux 3.5.0-17-generic x86_64)

* Documentation:  https://help.ubuntu.com/

 System information as of Fri Jan  4 10:23:00 UTC 2013

 System load:  0.0               Processes:           64

 Usage of /:   6.0% of 19.68GB   Users logged in:     1

 Memory usage: 37%               IP address for eth0: ip

 Swap usage:   1%                IP address for eth1: ip

 Graph this data and manage this system at https://landscape.canonical.com/