1. 程式人生 > >CentOS6.5 搭建Apache服務

CentOS6.5 搭建Apache服務

Apache安裝

yum -y install httpd
service httpd start        //啟動服務
service iptables stop      //關閉防火牆
setenforce 0               //關閉SELINUX 臨時關閉
/etc/sysconfig/selinux     //永久關閉SELINUX
把SELINUX=enforcing 
改成 SELINUX=disabled
Apache的基本配置
/etc/httpd/conf/httpd.conf    //主配置檔案

修改預設配置

進入檔案配置,移到最後一行把 DocumentRoot /www/docs/dummy-host.example.com 改成 DocumentRoot /www

建立html檔案

mkdir /www
touch /www/index.html
vim /www/index.html    //編輯檔案

重啟Apache服務

service httpd restart