ubuntu apache添加虚拟域名

来源:互联网 发布:口袋妖怪复刻源码 编辑:程序博客网 时间:2024/06/05 23:59

1.修改hosts文件
sudo gedit /etc/hosts //修改hosts
sudo /etc/init.d/networking restart //重启网络
2.修改apache2配置文件
sudo cp 000-default.conf xx.conf //进入/etc/apache2/sites-available/中复制一份000-default.conf,命名为xx.conf。
sudo gedit xx.conf //修改xx.conf

ServerName dean.laravel.com //绑定域名,与hosts文件中一致ServerAdmin webmaster@localhostDocumentRoot /var/www/html/laravel/public //网站目录

3.重启apache2服务
service apache2 restart

0 0
原创粉丝点击