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
OR
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 - 
/usr/bin/mysql_secure_installation

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
  • 0 Users Found This Useful
Was this answer helpful?

Related Articles

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...

How to setup a WordPress website on plain Centos server?

The following steps have been successfully tested on a plain centos server. Now lets start...

How to change the port number of Apache Web Server?

Default port to access the Apache is 80. Secure port for communicating with world for Apache is...

How to install Postfix on CentOS?

Postfix is an open-source Mail Transport Agent (MTA), which supports protocols like LDAP, SMTP...

How to install SOAP on CentOS?

Install SOAP on CentOS 1) Fire below command - yum install php-soap Output will be as follow...

Powered by WHMCompleteSolution