Mac apache 配置虛擬域名


 配置HOSTS

 

 #vim /private/etc/hosts

 

  添加↓:

 

   127.0.0.1       tp.zhy.cn

 

 配置虛擬主機

 #vim /private/etc/apache2/extra/httpd-vhosts.conf

 

 添加↓:

 <VirtualHost *:80>

    ServerAdmin [email protected]

    DocumentRoot "/Users/zhy/Sites/xxxx_5/public/"

    ServerName tp.zhy.cn

    ErrorLog "/private/var/log/apache2/xx.cn-error_log"

    CustomLog "/private/var/log/apache2/xx.cn-access_log" common

 </VirtualHost>

 

 

最後重啓 apache ↓

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章