-
PAGES
-
SERVICES
-
CONNECT WITH US
-
CONTACT INFORMATION
Installing a basic LAMP server is incredibly easy thanks for each OS's relevant package manager. Remember if you want the very latest versions of these applications, you'll need to compile them from source.
Use the following command to install Apache (httpd):
yum install httpd
Again, using yum to install PHP:
yum install php php-cli php-mysql
Note, there may be other PHP libraries you wish to install (search by yum search php*)
yum again:
yum install mysql-server mysql-common
Both will be installed as a service, so to start/restart/etc either, all you need do is:
service <httpd or mysql> <start, restart, stop>
A quick method:
service httpd start; service mysql start
Use this command to install Apache:
apt-get install apache2
Make sure the Apache log directory is owned by www-data:
chown www-data:www-data /var/log/apache2
Create an empty config file:
touch /etc/apache2/httpd.conf
Run this command to install the PHP packages needed to work with Apache:
apt-get install libapache2-mod-php5 php5-cli php5-common php5-cgi
Apache should automatically bind itself to run PHP when it encounters .php files.
This is the command to install the MySQL server, client and PHP’s MySQL libraries:
apt-get install mysql-client mysql-common mysql-server php5-mysql
Go to your document root(/var/www) and create a PHP file called ‘info.php’ and put this code inside it:
<?php phpinfo();
First, start the MySQL database server:
/etc/init.d/mysql start
Then, start the Apache Web Server:
/etc/init.d/apache2 start
Then go to
http://yourhostname_or_ip/info.php
If you see a page looking like this, Apache and PHP are working.