配置httpd(Apache)使其指向网页首页所在目录
1. apachectl 命令查看apache服务器信息
apachectl -t #语法检查
2. 查看httpd系统服务:
ll /etc/init.d/httpd
如果没有,参考:http://www.cnblogs.com/zzzhfo/p/5925786.html
chkconfig --list httpd #查看httpd服务的自启动状态
2. 将网页文件放到以下地址:
/var/www/html"
3. 设置开机启动:chkconfig
chkconfig --list
chkconfig --add httpdchkconfig httpd on
4. 启动服务:
/etc/init.d/httpd start
/etc/init.d/httpd stop #关闭服务
5. 查看服务状态:
netstat -anpt | grep httpd
6. 更多配置,见配置文件: /etc/httpd/conf/httpd.conf
CentOS firewall 对80等端口的block解除:
on centos run this commands:
iptables -I INPUT 4 -p tcp -m state --state NEW -m tcp --dport 80 -j ACCEPT
/etc/init.d/iptables save
Link for details: https://www.upcloud.com/support/configuring-iptables-on-centos-6-5/