这是我第一次尝试设置虚拟主机,我有点迷茫。我想设置虚拟名称“tp3.localhost”。
问题:
我的 AMMPS 网址是localhost:8585。在 hosts 文件中我必须写127.0.0.1 tp3.localhost还是127.0.0.1:8585 localhost?
我在 httpd-vhosts.conf 中编写的代码如下:
名称VirtualHost 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 是 MAMP 的替代方案。