这是我设置虚拟主机的方式:
/etc/apache2/vhosts/test.local.conf
<VirtualHost *:80>
ServerAdmin webmaster@test.local
DocumentRoot "/Users/mithun/test/public"
ServerName test.local
<Directory "/Users/mithun/test/public">
Options Indexes FollowSymLinks MultiViews
AllowOverride All
#Require all granted
</Directory>
ErrorLog "/private/var/log/apache2/test.local.com-error_log"
CustomLog "/private/var/log/apache2/test.local.com-access_log" common
</VirtualHost>
映射.local扩展名
/ etc / hosts 127.0.0.1 test.local
访问http://test.local仅获得500内部服务器错误