apache下虛擬網域名稱的配置(windows)

來源:互聯網
上載者:User

標籤:www   伺服器   意思   mon   錯誤   方式   roo   httpd   就是   

在我們開發中通過虛擬網域名稱來訪問一個指定的項目確實很方便,接下來教大家如何通過手動的方式去配置虛擬網域名稱(已apache伺服器為例)

一、首頁我們得找到host檔案、windows下這個檔案在c盤中WINDOWS\system32\drivers\etc\hosts中 加入如下內容:

127.0.0.1 singwa.com
本地ip 虛擬網域名稱

二、然後咱們得去找httpd.conf檔案、這個檔案相應位置在您web伺服器安裝的目錄下/\apache\conf\httpd.conf , 找到 “Include conf/extra/httpd-vhosts.conf 如果前面有# 則需要把它刪掉

三、找到httpd-vhosts.conf檔案
<VirtualHost *:80>
ServerAdmin [email protected]
DocumentRoot "E:/bd/ems" //這個為您的項目目錄 意思就是把虛擬網域名稱綁定到這個目錄下
ServerName singwa.com //這個為您在host中配置 也就是虛擬網域名稱
ErrorLog "logs/dummy-host2.example.com-error.log" // 錯誤記錄檔檔案
CustomLog "logs/dummy-host2.example.com-access.log" common
</VirtualHost>

然後重啟伺服器訪問singwa.com就可以訪問你的項目了

備忘:如果返回重啟不了,你查看錯誤記錄檔,根據提示來解決。


singwa 
連結:http://www.imooc.com/article/16798
來源:慕課網
本文原創發佈於慕課網 ,轉載請註明出處,謝謝合作!

apache下虛擬網域名稱的配置(windows)

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.