ubuntu下虚拟域名配置

`

hosts

sudo vim /etc/hosts //打开hosts文件
添加虚拟域名


`

apache2

cd /etc/apache2/sites-available //进入目录
sudo cp 000-default.conf ***.conf //复制并重命名
sudo vim .conf //打开文件编辑
ServerName 后面修改为你的虚拟域名/DocumentRoot 路径
OK

sudo ln -s /etc/apache2/sites-available/
.conf ../sites-enabled/ //链接文件
sudo /etc/init.d/apache2 restart //重启服务
`

你可能感兴趣的:(ubuntu下虚拟域名配置)