Monday, 22 October 2012

Install LAMP on CentOS


CentOS 5.7


  • Install Mysql
  • Install Apache with Php

1.Install Mysql Server

# yum install mysql mysql-server

2.Start and Enable Mysql service

# systemctl start mysqld.service
# systemctl enable mysqld.service

Create Mysql password  with  :

# mysqladmin -u root password [your_password_here]

Check the connexion  to the databae server with:

# mysql -h localhost -u root -p

2.Install HTTPD and  PHP

a.Install Apache (httpd)

# yum install httpd php php-common

b.Start  and  enable  httpd  service

# /etc/init.d/httpd start

 ---OR---

# service httpd start

# chkconfig --levels 235 httpd on

3.Check if php works

create a .php test file

# vi /var/www/html/info.php

insert:

<?php
phpinfo();
?>

save and    open browser to check   : http://ip/info.php


DONE

No comments:

Post a Comment