apache子網域名稱設定

來源:互聯網
上載者:User
本地的環境,apache的設定檔中設定的根目錄是d:/AppServ/www/,子網域名稱的配置如下,放在設定檔開始了
NameVirtualHost *:80    ServerName localhost    ServerAlias localhost    DocumentRoot D:/AppServ/www/     #AllowOverride FileInfo OptionsOptions NoneOrder allow,denyAllow from all        ServerName dede    ServerAlias dede    DocumentRoot D:/AppServ/www/Dede/     #AllowOverride FileInfo OptionsOptions NoneOrder allow,denyAllow from all        ServerName ikaihui    ServerAlias ikaihui    DocumentRoot D:/AppServ/www/ikaihui/     #AllowOverride FileInfo OptionsOptions NoneOrder allow,denyAllow from all    

現在的情況是:輸dede和ikaihui都能正常顯示,輸localhost的話chrome會報這個錯:
錯誤 103 (net::ERR_CONNECTION_ABORTED):未知錯誤。

IE也打不開。
刪掉localhost那一段的話,輸localhost會顯示dede的頁面,我現在想輸localhost正常顯示www檔案夾下面的index.php,該怎麼配


回複討論(解決方案)

看看是不是你的反病毒或者防火牆之類導致的.

看看是不是你的反病毒或者防火牆之類導致的.
電腦上沒有殺毒軟體 而且去掉localhost那一段就能訪問,應該還是哪兒的配置有問題

你的寫法是正確的
清除一下瀏覽器緩衝區看看
我就是這樣寫的

NameVirtualHost *:80ServerName localhostDocumentRoot /AMP/webServerName www.a.netDocumentRoot /AMP/web/www.a.netServerName www.b.netDocumentRoot /AMP/web/www.b.net

你的寫法是正確的
清除一下瀏覽器緩衝區看看
我就是這樣寫的
Plain Text code?12345678910111213141516NameVirtualHost *:80 ServerName localhostDocumentRoot /AMP/web Se……
我照你這個改了 又把瀏覽器的緩衝都清了 還是不行 搞不清楚哪的問題

那你把裡面的 Directory 一節去掉看看

那你把裡面的 Directory 一節去掉看看
去掉了 我就是照你上面的寫的

加這個看下
Alias /綁定目錄 "絕對實體路徑"

NameVirtualHost localhost:80


ServerName localhost
DocumentRoot /AMP/web



ServerName www.a.net
DocumentRoot /AMP/web/www.a.net



ServerName www.b.net
DocumentRoot /AMP/web/www.b.net


這樣子你試試,應該可以

  • 聯繫我們

    該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

    如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.