开发者社区> 问答> 正文

wamp2.4配置虚拟目录:配置报错

我是个初学者,刚刚安装了WampServer Version 2.4,想配置下虚拟主机和虚拟目录,按照网上的一步一步的来试了好几次就是不行,在httpd-vhosts.conf下面配置如下
NameVirtualHost *:80 <VirtualHost *:80>     <Directory "E:/网页前台/学习练习/JS练习/019玛丽">         Options -Indexes FollowSymLinks         Allow from all         AllowOverride All     DirectoryIndex  新建文本文档.html     </Directory>     ServerAdmin webmaster@dummy-host.localhost     DocumentRoot "E:/网页前台/学习练习/JS练习/019玛丽"     ServerName scchary.com     ServerAlias www.scchary.com     ErrorLog "logs/dummy-host.localhost-error.log"     CustomLog "logs/dummy-host.localhost-access.log" common </VirtualHost>

输入www.scchary.com后显示“无法显示此页”
环境
希望能指点下是那里的问题

展开
收起
kun坤 2020-06-04 10:24:21 715 0
1 条回答
写回答
取消 提交回答
  • 要在主配置文件载入你的虚拟机配置,然后要改你的hosts文件,把你里面的域名指向本机。######回复 @Scchary : 别用中文,用拼音都比用中文好!######我在httpd.conf和hosts里面都配置了,但是还是不行,你说的主配置文件是哪里啊###### 能不能别这么恶趣味,中文命名。。。
    另外,directory不是virtual的子节点,而是平行节点。
    另外,确保httpd.conf里开启了vhost配置文件的引入,确认本地HOST做了绑定。
    参考配置:

    <VirtualHost 127.0.0.2:80>
        ServerAdmin hereher@qq.com
        DocumentRoot "e:/data/netbeanphp/rmi"
        ServerName rmi.com
        ErrorLog "logs/rmi.log"
    </VirtualHost>
    <Directory "e:/data/netbeanphp/rmi">
        Options Indexes FollowSymLinks Multiviews
        AllowOverride All
        Require all granted
    </Directory>
    ######回复 @Scchary : 英文不好不是借口。程序代码(非注释)中拒绝使用任何中文,拼音,除非你自己不在意。######....英文不好啊,谢谢指点啊###### 你像下面这样子就行,不用directory选项。
    <VirtualHost *:80>
        ServerAdmin webmaster@dummy-host.example.com
        DocumentRoot "c:/Apache24/docs/dummy-host.example.com"
        ServerName dummy-host.example.com
        ServerAlias www.dummy-host.example.com
        ErrorLog "logs/dummy-host.example.com-error.log"
        CustomLog "logs/dummy-host.example.com-access.log" common
    </VirtualHost>

    ######哦哦,谢了,文件夹不能用中文的问题,我改成英文就好了

    2020-06-04 11:21:22
    赞同 展开评论 打赏
问答地址:
问答排行榜
最热
最新

相关电子书

更多
低代码开发师(初级)实战教程 立即下载
冬季实战营第三期:MySQL数据库进阶实战 立即下载
阿里巴巴DevOps 最佳实践手册 立即下载