在RHEL6.5中部署web服务

  1. 安装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>
  1. 配置网站目录
mkdir /www
mkdir /www/mirrors
chcon -usystem_u -robject_r -thttpd_sys_content_t -R /www
  1. 配置防火墙
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
  1. 启动服务
chkconfig httpd on
service httpd start

Leave a Reply

Your email address will not be published.

Time limit is exhausted. Please reload the CAPTCHA.

Proudly powered by WordPress   Premium Style Theme by www.gopiplus.com
渝公网安渝公网安备 50010702500270号 渝ICP备09056628号-7