- 安装apache配置服务
yum install httpd vi /etc/httpd/conf/httpd.conf ServerName 127.0.0.1:80 NameVirtualHost *:80 <VirtualHost *:80> ... DocumentRoot /www/mirrors/ ServerName mirrors.platform <Directory "/www/mirrors/"> #显示目录索引 Options Indexes FollowSymLinks </Directory "/www/mirrors/"> ... </VirtualHost> |
- 配置网站目录
mkdir /www mkdir /www/mirrors chcon -usystem_u -robject_r -thttpd_sys_content_t -R /www |
- 配置防火墙
iptables -A INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT //这里注意规则顺序,如顺序错误,改用-I参数在指定行插入规则 iptables -I INPUT 行号 -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT service iptables save |
- 启动服务
chkconfig httpd on service httpd start |
Leave a Reply