您的位置:首页 > 运维架构 > Apache

ubuntu apache添加虚拟域名

2016-09-12 08:56 399 查看
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@localhost
DocumentRoot /var/www/html/laravel/public //网站目录


3.重启apache2服务

service apache2 restart
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: