Installing LAMP on CentOS

Introduction:

In this tutorial i will set the commons command and software to configure a web server on CentOS. CentOS is very powerful system used very well on VPSs and servers. this is why i am writing this few lines to give the most used command to configure a LAMP (Linux, Apache, MySQL, PHP/PERL/PYTHON...) server.

MySQL:

Step 1 : install MySQL:
The command to use to install MySQL on CentOS operating system is : 

#yum install mysql mysql-server

Step 2 : enable MySQL at startup :
To enable MySQL at the starting of the machine use the command line :

#chkconfig --levels 235 mysqld on

Step 3 : starting MySQL server:
To start the MySQL server type :

#/etc/init.d/mysqld start

Step 4 : define the root password:
To define the user password : 

mysqladmin -u root password yourrootsqlpassword

Step 5 : Testing you MySQL:
connect and test your MySQL server :

mysqladmin -h server1.example.com -u root password yourrootsqlpassword

Apache:

Step 1 : Installing Apache
To install Apache we type:

#yum install httpd

Step 2 : enable Apache on the startup
The command is similar to the MySQL command, we type :

#chkconfig --levels 235 httpd on

Step 3 : Starting Apache web server

#/etc/init.d/httpd start

You will find the config file for Apache on /etc/httpd/conf.d/httpd.conf

PHP :

Step 1 : Installing PHP
To install PHP we type:

#yum install php

Step 2 : restarting the Apache server

#/etc/init.d/httpd restart

or 

#service httpd restart


0 commentaires: