How to perform LAMP installation on CentOS?

LAMP stands for Linux, Apache, MySQL, and PHP. It is nothing but Linux operating system with Apache web service. It allows to run the websites and web apps on server. 

Pre-requisite for LAMP installation -

1. Root access -  You should have root access.

2. Check the hostname - 
hostname -f

3. Update your system -
yum update

Apache Web Install and Configure

1. Install Apache - 
yum install httpd

2. Start Apache running on your server - 
service httpd start

MySQL Install and Configure

1. Install the MySQL package -
yum install mysql-server

2. You will need to set up a root password - 

i. When asked for a current root password, leave the field blank and hit Enter.
Type "y" and hit the Enter button again if it asks you if you would like to set a Root Password.

ii. When asked for your current root password, leave the field blank and hit Enter.
Type “y” and hit Enter again when it asks if you would like to set the root password.

iii. Set the password and be sure to store the password somewhere safe.

iv. Next you will be asked a series of questions.  Read through them and  determine what you want your answers to be.

It’s easiest just to say Yes to all the options.  At the end, MySQL will reload and implement the new changes. The output will as follows -

All done!  If you've completed all of the above steps, your MySQL installation should now be secure.
Thanks for using MySQL!

Install PHP

PHP is necessary for developing the dynamic pages on webserver.
yum install php php-mysql
Once you answer yes to the PHP prompt, PHP will be installed. Smile

PHP Modules

PHP supports various modules which you can install it along with PHP. You can search PHP modules using below modules -
yum search php-

If you would like to install the modules then you can fire below commands - 
yum install name of the module

All done! Smile

Was this answer helpful?

 Print this Article

Also Read

How to perform the Linux Sever Hardening?

1. Check the hostname is setup or not - hostname 2. Check the IP address is assigned to hostname...

How to install AVG Antivirus scanner on Ubuntu?

AVG free is antivirus which protects from spyware as well malware. It is free to use for private...

[/url] missing - Memcached installation error

While Memcached installation on Centos server, I was getting the error as '[/url]

How to backup and restore large MySQL databases using mysqldump?

1. Backup database: #mysqldump -u username -p[username_password] databasename >...

How to install latest version of git on CentOS release 6.8 (Final)?

Install latest version of git on CentOS release 6.8 - Step 1. Install Dependencies - yum install...

Powered by WHMCompleteSolution