How To Install a LAMP Stack On CentOS 6

How To Install a LAMP Stack on CentOS 6

LAMP stands for Linux Apache MySQL and PHP. It is the easiest and yet most effective installations you will have to perform.

First we install Apache

1. sudo yum install httpd

2. sudo service httpd start

Now go to your domain or public IP in a web browser to check if Apache is working correctly

Our next step is to install MySQL

1. sudo yum install mysql-server

2. sudo service mysqld start

MySQL should prompt you for permission a few times during the installation.

Set your root password next:

1. sudo /usr/bin/mysql_secure_installation

Since this is a new install, you should not have a root password yet so live it blank and click enter.

Now, as the following prompts appear enter:

1. Y

2. Y

3. Y

4. Y

5. Y

And now you are done installing MySQL

For the final portion of our LAMP stack we must install PHP

To install PHP you must start by:

1. sudo yum install php php-mysql

If you feel you need other modules, enter:

1. yum search php-

Now that we have everything installed correctly, make sure it all runs on reboot:

1. sudo chkconfig httpd on

2. sudo chkconfig mysqld on

3. sudo service httpd restart

4. sudo service mysqld restart

Now you can start to upload your website to the following directory:

1. /var/www/html

 

  • 0 Users Found This Useful
Was this answer helpful?

Related Articles

How To Install OpenSSL On CentOS

How To Install OpenSSL on a CentOS Server First, we want to install OpenSSL 1. yum install...

How To Install OpenVPN on CentOS 6.x

How To Install OpenVPN On CentOS 6.x 32/64 bit OpenVPN is the most commonly used and updated VPN...

How To Prevent Bruteforce And DoS Attacks On CentOS

How To Prevent Bruteforce And DoS Attacks On CentOSThis is part one of the three part tutorial on...

How To Setup A Basic IPTables Firewall On CentOS - Section 2

How To Setup A Basic IPTables Firewall On CentOSThis is part two of the three part tutorial on...

How To Harden Your SSH On CentOS

How To Harden Your SSH On CentOSThis is part three of the three part tutorial on securing your...