我有 2 个带有 vhost 的 laravel 项目
<VirtualHost *:80>
ServerName project1.local
ServerAlias project1.*.xip.io
DocumentRoot "/var/www/project1"
</VirtualHost>
<VirtualHost *:80>
ServerName project2.local
ServerAlias project2.*.xip.io
DocumentRoot "/var/www/project2"
</VirtualHost>
如果我打开 project2 然后打开 project1,我总是会返回 project2 的内容。
我的 apache 的根
drwxr-xr-x 2 www-data www-data 4096 Mar 19 20:58 apps
-rw-r--r-- 1 www-data www-data 177 Feb 13 20:04 index.html
lrwxrwxrwx 1 www-data www-data 21 Apr 9 08:20 phpmyadmin -> /usr/share/phpmyadmin
lrwxrwxrwx 1 root root 53 Apr 23 15:48 project1 -> /home/mav/Development project1/public
lrwxrwxrwx 1 www-data www-data 21 Apr 9 08:21 phpsysinfo -> /usr/share/phpsysinfo
lrwxrwxrwx 1 root root 55 Apr 23 15:45 project2 -> /home/mav/Development/project2/public