Apache虛擬機器主機配置

來源:互聯網
上載者:User

標籤:style   blog   http   color   os   io   檔案   2014   log   

1.開啟apache的設定檔httpd.conf,搜尋關鍵詞:vhost,尋找:Include conf/extra/httpd-vhosts.conf,去掉前面的注釋#。

2.開啟apache的apache/conf/extra下的次設定檔httpd-vhosts.conf;在最後加入類似內容:(檔案路徑是自己安裝程式的路徑) 

<VirtualHost *:80> 

 DocumentRoot "D:/wamp/www/aaa"(這是你放程式的檔案路徑)

 ServerName www.aaa.com   (這是自己定義的網域名稱)

</VirtualHost>

3.開啟在C:/WINDOWS/system32/drivers/etc中的hosts檔案中加上如下的內容 

127.0.0.1   www.aaa.com   (這是自己定義的網域名稱)

這樣我們就配置好了名為wamp的虛擬機器主機,重啟一下我們在瀏覽器中輸入 www.eduoauto.com就可以查看到D:/wamp/www目錄下的內容

4.為了讓其他電腦用IP訪問自己的網域名稱,需要在httpd.conf 中搜尋127.0.0.1 修改為all

<Directory "D:/wamp/www">
Options Indexes FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all   允許所有主機訪問

 

——————————>

# Deny from all
Allow from 127.0.0.1  //只允許從本機或192.168.3.*的ip過來的主機訪問
Allow from 192.168.3.*


</Directory>

 

改成你的電腦ip地址 別的電腦通過網路也可以訪問

 

Apache虛擬機器主機配置

聯繫我們

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