centos6.4系统启动httpd
1、安装httpd
yum -y install httpd
2、查看httpd配置文件
vi /etc/httpd/conf/httpd.conf
拉到最后记下DocumentRoot路径
3、关闭防火墙
chkconfig iptables off
4、关闭selinux
vi /etc/sysconfig/selinux
将selinux值置为disabled
5、创建目录
/www/docs/dummy-host.example.com
6、创建文件
在/www/docs/dummy-host.example.com创建文件index.html
7、将文件、文件夹权限全部设置为755
chmod 755 /www/docs/dummy-host.example.com
cd /www/docs/dummy-host.example.com
chmod 755 index.html
8、启动httpd服务
service httpd start
9、报错
解决办法:
vi /etc/httpd/conf/httpd.conf
在后面的Servername另起一行
Servername localhost:80(不用在前面写#)
保存退出
10、重新启动httpd服务,又报错
原因:80端口被占用
解决:
netstat -lnp | grep 80 查看谁占用80端口,将进程kill掉