1

我无法让虚拟主机按我的意愿工作。我一直在寻找最后几个小时,但感觉我比以前更迷失了。

所以基本上我想要以下设置:

  1. http://test.localhost => D:\xampp\htdocs\test\site
  2. http://test.localhost/call => D:\xampp\htdocs\test\back\call.pl
  3. 并且可能添加其他内容,例如 /whatever 指向其他 .pl 脚本

谁能给我一个提示?我一定错过了一些明显的东西......

4

2 回答 2

1

对于 localhost 子域,您必须将该子域添加到 /etc/hosts

127.0.0.1       localhost       test.localhost
于 2013-03-14T19:21:05.553 回答
0

您是否尝试编辑您的 apache conf 文件?

像这样的东西

# vi /usr/local/apache2/conf/extra/httpd-vhosts.conf
NameVirtualHost *:80

<VirtualHost *:80>
 ServerAdmin ramesh@thegeekstuff.com
 DocumentRoot "/usr/local/apache2/docs/thegeekstuff"
 ServerName thegeekstuff.com
 ServerAlias www.thegeekstuff.com
 ErrorLog "logs/thegeekstuff/error_log"
 CustomLog "logs/thegeekstuff/access_log" common
</VirtualHost>

<VirtualHost *:80>
 ServerAdmin ramesh@top5freeware.com
 DocumentRoot "/usr/local/apache2/docs/top5freeware"
 ServerName top5freeware.com
 ServerAlias www.top5freeware.com
 ErrorLog "logs/top5freeware/error_log"
 CustomLog "logs/top5freeware/access_log" common
</VirtualHost>
于 2013-03-14T19:11:09.023 回答