2
我在Mac上設置本地開發環境時遇到問題。在Mac上設置具有不同子目錄的虛擬主機
我已經(添加)什麼:
/私營/ etc/hosts文件:
127.0.0.1 dev.local
127.0.0.1 page1.dev.local
/Applications/MAMP/conf/apache/httpd.conf:
NameVirtualHost *
<VirtualHost dev.local:8888>
ServerName dev.local
DocumentRoot /Users/user1/Sites/
<Directory /Users/user1/Sites/>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all
</Directory>
</VirtualHost>
<VirtualHost page1.dev.local:8888>
ServerName page1.dev.local
DocumentRoot /Users/user1/Sites/page1/
<Directory /Users/user1/Sites/page1/>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all
</Directory>
</VirtualHost>
基本上我希望通過http://dev.local和/ Users/user1/Sites
第一個項目(page1)可通過http://page1.dev.local訪問並位於/ Users/user1/Sites/page1
下一個項目遵循相同的邏輯。
當我打開http://dev.local我看到正確的頁面,但與http://page1.dev.local我得到相同的頁面。
我總是重新啓動Apache!