版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/qq_21441663/article/details/53862278
MAC下面设置vhost
在httpd.conf中
#Include /private/etc/apache2/extra/httpd-vhosts.conf(去掉注释)
Include /private/etc/apache2/extra/httpd-vhosts.conf
**在Listen 80后换行添加Listen 8081**
httpd_vhosts.conf里面添加
<VirtualHost *:8081>
DocumentRoot "/Users/hh/wwwroot/blog/public"
ServerName www.blog.com
ErrorLog "/Users/hh/wwwroot/log/blog_error.log"
CustomLog "/Users/hh/wwwroot/log/blog_access_error.log" common
</VirtualHost>
<Directory />
Options Indexes FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all
</Directory>
然后在vhost中添加
127.0.0.1 localhost www.blog.com