apache2.4 建虚拟目录

参考:主要修改地方

2、第二个修改地方

打开httpd.conf文件
去掉LoadModule vhost_alias_module modules/mod_vhost_alias.so
这句前面的#号
和
Include conf/extra/httpd-vhosts.conf这句前面的#号

Include conf/extra/httpd-vhosts.conf这句在httpd.conf文件底部

然后打开Apache2.2\conf\extra下的httpd-vhosts.conf文件,加入如下代码

#配置自己的虚拟主机
<VirtualHost *:80>
    #网站目录,如果在www目录下的php目录,下面    #就填写F:/www/php
    DocumentRoot "D:/WALP/www" 
    #域名
    ServerName www.plqjnet.com
    #这里配置欢迎首页面
    DirectoryIndex index.html index.htm index.php
    <Directory />
    Options FollowSymLinks
    #不允许别人修改我们的页面
    AllowOverride None
    #设置访问权限
    order allow,deny
    Allow from all
    </Directory>   
</VirtualHost>

把ServerName改成你自己的,最后重启Apache。
这样改了还是不能访问,需修改 httpd.conf

<span style="font-size: x-small;">#
# Each directory to which Apache has access can be configured with respect
# to which services and features are allowed and/or disabled in that
# directory (and its subdirectories). 
#
# First, we configure the "default" to be a very restrictive set of 
# features.  
#
<Directory />
    Options FollowSymLinks
    AllowOverride None
    Order deny,allow
    Deny from all
</Directory></span> 成

<span style="font-size: x-small;"># 允许指向外部的目录进行访问
<Directory />
    Options Indexes FollowSymLinks
    AllowOverride None
</Directory></span>

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值