`
hosts
sudo vim /etc/hosts //打開hosts文件
添加虛擬域名
`
apache2
cd /etc/apache2/sites-available //進(jìn)入目錄
sudo cp 000-default.conf ***.conf //復(fù)制并重命名
sudo vim .conf //打開文件編輯
ServerName 后面修改為你的虛擬域名/DocumentRoot 路徑
OK
sudo ln -s /etc/apache2/sites-available/.conf ../sites-enabled/ //鏈接文件
sudo /etc/init.d/apache2 restart //重啟服務(wù)
`