现在的位置: 首页 > 综合 > 正文

apache安装之后的配置

2014年09月28日 ⁄ 综合 ⁄ 共 703字 ⁄ 字号 评论关闭

apache安装之后的配置:

apache安装之后的配置,这里解决所有疑惑。

yum install httpd
vi /etc/httpd/conf.d/welcome.conf

修改为如下:

<LocationMatch "^/+$">
#    Options -Indexes
#    ErrorDocument 403 /error/noindex.html
</LocationMatch>

vi /etc/httpd/conf/httpd.conf

内容末尾增加:
<VirtualHost *:80>
        ServerAdmin webmaster@localhost
        ServerName javasvn.aabbb.cn
        DocumentRoot /wwwroot/
        <Directory /wwwroot/>
                Options Indexes FollowSymLinks MultiViews
                AllowOverride None
        </Directory>
</VirtualHost>

service httpd restart

Forbidden
You don't have permission to access / on this server.

出现以上提示是防火墙的事,解决方法:

setenforce 0

如果配置两个VirtualHost,结果所有配置都以第一个配置生效怎么办?

把/etc/httpd/conf/httpd.conf中
#NameVirtualHost *:80前的注释去掉

多个VirtualHost共存的情况下,第一个配置是默认配置。

抱歉!评论已关闭.