2012-09-20 63 views
1

这是我第一次尝试设置虚拟主机,但有点迷路。我想设置虚拟名称“tp3.localhost”。使用AMPPS在Mac(Mac OS X Lion 10.70.4)上设置虚拟主机

问题:

  1. 我AMMPS网址是本地主机:8585。在主机文件我必须写127.0.0.1 tp3.localhost127.0.0.1:8585本地主机

  2. 我在httpd-vhosts.conf写的代码如下:

了NameVirtualHost tp3.localhost

<VirtualHost tp3.localhost> 
    <Directory "/Applications/AMPPS/www"> 
     Options FollowSymLinks Indexes 
     AllowOverride All 
     Order deny,allow 
     Allow from All 
    </Directory> 
    ServerName tp3.localhost 
    ServerAlias localhost:8585 127.0.0.1:8585 
    ScriptAlias /cgi-bin/ "/Applications/AMPPS/www/cgi-bin/" 
    DocumentRoot "/Applications/AMPPS/www" 
    ErrorLog "/Applications/AMPPS/apache/logs/error.err" 
    CustomLog "/Applications/AMPPS/apache/logs/access.log" combined 
</VirtualHost> 

AMMPS是甲基苯丙胺的可选择性。

回答

1

我认为你的VirtualHost语句应该包含端口。

当调用ULR时,您需要将其称为tp3.localost(请参阅ServerName),以便它被触发。

所以tp3.localhost是应该存在的地方在你的DNS或/ etc/hosts文件,因此它可以被解析为127.0.0.1(或:: 1 IPv6)的

名称