我很难使用虚拟主机获取多个使用MAMP的站点。以下是我在我的MBA课程中设置的内容。如果我打开我的网络浏览器并转到“http:local.login.dev”或“http://dev.login.localhost”(重新配置后),我会得到保存在/ Users/aaron/localhost中的索引页。我的虚拟主机部分中列出的第一项不是保存在我想要访问的虚拟主机中的索引页。我设置的其他网站也给了我相同的结果..“http:next.site.localhost”=在/ Users/aaron/localhost中显示索引页面。无法使用MAMP与虚拟主机协同工作
有没有人有任何想法?我的最终目标是配置MAMP虚拟主机以使用SSL进行工作和测试。
底线是,好像只有第一个虚拟主机条目被读取,这是什么用于列出的所有主机。我错过了一些设置?
环境: - MBA与OS X,优胜美地
MAMP 3.0.7.3使用端口80和3306的http和mysql的分别
httpd.conf文件: 包含/应用/MAMP/conf/apache/extra/httpd-vhosts.conf
127.0.0.1本地主机
127.0.0.1 local.login.dev<VirtualHost *> DocumentRoot "/Users/aaron/localhost" ServerName localhost </VirtualHost> <VirtualHost *:80> — I tried both with and without :80 DocumentRoot "/Users/aaron/localhost/training/login/public" ServerName local.login.dev </VirtualHost>
也试过我的配置和主机的httpd-vhosts.conf这样 - 从另一篇文章:
127.0.0.1本地主机
127.0.0.1 dev.login.localhost
<VirtualHost *>
DocumentRoot "/Users/aaron/localhost"
ServerName localhost
</VirtualHost>
<VirtualHost *:80>
DocumentRoot "/Users/aaron/localhost/training/login/public"
ServerName dev.login.localhost
ServerAlias dev.login.localhost
<Directory "/Users/aaron/localhost/training/login/public">
Allow from All
AllowOverride all
Options -Indexes +FollowSymlinks
</Directory>
</VirtualHost>