【发布时间】:2015-06-24 08:55:27
【问题描述】:
寻求有关在 XAMPP 中设置子域的帮助。
我读过几篇文章,虽然它们似乎都与本地安装有关,但我拥有的是 XAMPP 的 PORTABLE 版本,因此没有驱动器前缀。
我尝试了下面提到的一些文章,但似乎都没有。他们都显示服务器没有响应或最终去谷歌搜索。
我在 httpd.conf 中有
# Virtual hosts
Include conf/extra/httpd-vhosts.conf
然后在extra/httpd-vhosts.conf中
NameVirtualHost *:80
<VirtualHost *>
ServerAdmin admin@localhost.com
ServerName localhost
ServerAlias localhost
DocumentRoot "/xampp/htdocs/public"
<Directory "/xampp/htdocs/public">
Options Indexes FollowSymLinks Includes ExecCGI
AllowOverride All
Require all granted
</Directory>
</VirtualHost>
<VirtualHost forums*>
ServerAdmin admin@localhost.com
ServerName forums
ServerAlias forums
DocumentRoot "/xampp/htdocs/public/forums"
<Directory "/xampp/htdocs/public/forums">
Options Indexes FollowSymLinks Includes ExecCGI
AllowOverride All
Require all granted
</Directory>
</VirtualHost>
当我这样做时,“forums.localhost”在 chrome “http://www.forums.localhost/”中变成了这个,然后我得到:
网页不可用
在我阅读的许多内容中,有些人提到编辑 windows 主机文件,但鉴于这是 XAMPP 的便携式版本,我不能总是在每台计算机上编辑主机文件。
这些都是我尝试过的,但都失败了 http://austin.passy.co/2012/setting-up-virtual-hosts-wordpress-multisite-with-xampp-on-windows-7/
https://community.apachefriends.org/f/viewtopic.php?p=198815&sid=7a72729a95ed298148f8635dd414295a
how to create subdomains in apache(xampp) server?
有人可以帮我如何让子域在 PORTABLE 版本上工作,或者我应该如何做,或者编辑 windows 主机文件是强制性的吗?
【问题讨论】: