To setup LAMP server install a CentOS or Linux server and follow this step by step guide.
Install Apache
Apache is a the most popular Web HTTP server for a Linux servers. Use this command on Terminal (Applications->Terminal), it will download and install Apache server
=> yum install httpd httpd-devel
To start Apache server use the following command:
=> /etc/init.d/httpd start
Install MySQL Database Server
MySQL is widely used open source database server on most linux servers and can very well integrated to PHP and Apache server in Centos/RHEL. To download/install mysql type the following command and press enter
=> yum install mysql mysql-server mysql-devel
Changing MySQL Root Password
By default the root password is empty for mysql database. It is a good idea to change mysql root password to a new one from security point of view. Use the following commands on Terminal.
=> /etc/init.d/mysqld start => mysql mysql> USE mysql; mysql> UPDATE user SET Password=PASSWORD('newpassword') WHERE user='root'; mysql> FLUSH PRIVILEGES;
Install PHP5 Scripting Language
Installing PHP5 with necessary modules is so easy and can be configured for both Apache and mysql environment. Use the following command to install PHP
Configure the Apache and MySQL to run during startup in CentOS
=> chkconfig httpd on => chkconfig mysqld on
Now pint your browser to localhost/phpmyadmin you will see the permission's error, to resolve this problem edit the file /usr/share/phpmyadmin/config.inc.php.
=> vi /usr/share/phpmyadmin/config.inc.php
and put a blowfish secret $cfg['blowfish_secret'] = 'secret';
Now refresh the browser and phpmyadmin will ask for user name and password, type root in user name and your newpassword in password field.