您好,登錄后才能下訂單哦!
順手記錄一下,
NameVirtualHost *:80
<VirtualHost _default_:80>
DocumentRoot "/var/www/html"
</VirtualHost>
<VirtualHost *:80>
ServerName www.abc.com
DocumentRoot "/var/www/html/abc"
<Directory /var/www/html/abc>
Options Indexes FollowSymLinks
AllowOverride None
Order deny,allow
Allow from all
</Directory>
</VirtualHost>
在httpd.conf里增加虛擬主機(jī)時(shí)寫(xiě)的DocumentRoot會(huì)把上面的根目錄覆蓋掉,這樣根目錄其他的文件夾就沒(méi)法訪(fǎng)問(wèn)了,添加VirtualHost _default_可以把DocumentRoot寫(xiě)回原先的根目錄。需要打開(kāi)NameVirtualHost,否則Apache開(kāi)啟時(shí)會(huì)報(bào)warning。
免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀(guān)點(diǎn)不代表本網(wǎng)站立場(chǎng),如果涉及侵權(quán)請(qǐng)聯(lián)系站長(zhǎng)郵箱:is@yisu.com進(jìn)行舉報(bào),并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。