Wednesday, September 30, 2009

CentOS: install http (Apache) php service

It is very easy to install http and php under CentOS:

Login as Root input command:

# yum install httpd php php-gd mysql-server php-mysql

To start or stop httpd service:

# service httpd start
# service httpd stop

Setup httpd automatic startup during reboot:

# chkconfig httpd on

Move "DocumentRoot" from default location to your directory:

# mkdir /home/www
# chcon -R -h -t httpd_sys_content_t /home/www
# vi /etc/httpd/conf/httpd.conf

Modify:
#DocumentRoot "/var/www/html"
To:
DocumentRoot "/home/www"

Restart httpd service:

# service httpd restart

No comments:

Post a Comment