一、配置虚拟主机
1.在Linux系统中找到
/etc/hosts
在文件中添加当前主机IP地址和你自定义的虚拟域名,例如:
127.0.0.1 www.test.com
2.在“/etc/apache2/sites-available”目录下有“000-default.conf”
将000-default.conf 复制一份叫做 test.conf
3 .进入test.conf
修改 ServerName 和 DocumentRoot
ServerName www.test.net
DocumentRoot/var/www/html/laravel/public
4.ln -s /etc/apache2/sites-available/test.conf ../sites-enabled/
5.重启Apache:sudo service apache2 restart