Apache 配置多端口 多虛擬主機 局域網(wǎng)訪問示例
更新時間:2014年05月12日 16:20:05 作者:
這篇文章主要介紹了Apache如何配置多端口 多虛擬主機 局域網(wǎng)訪問,需要的朋友可以參考下
一、在\wamp\bin\apache\Apache2.4.4\conf\extra\httpd-vhosts.conf 修改如下
NameVirtualHost *:80
<VirtualHost *:80>
DocumentRoot "E:/website/pxsj"
ServerName host7.com
ServerAlias 192.168.1.116
<Directory "E:/website/pxsj">
Options Indexes FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
NameVirtualHost *:8080
<VirtualHost *:8080>
DocumentRoot "E:/website/whsj"
ServerName host10.com:8080
ServerAlias 192.168.1.116:8080
<Directory "E:/website/whsj">
Options Indexes FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
二、\wamp\bin\apache\Apache2.4.4\conf\httpd.conf 修改如下:
在該文件中查找“Listen”一詞修改
Listen 80
Listen 8080
# Virtual hosts
# Include conf/extra/httpd-vhosts.conf去掉前面的#,這樣就開啟了httpd-vhosts虛擬主機文件。這時候重啟環(huán)境
三、C:\Windows\System32\drivers\etc\hosts 修改配置
<pre code_snippet_id="331423" snippet_file_name="blog_20140507_1_9705788"></pre>
<pre></pre>
<pre></pre>
<pre></pre>
復(fù)制代碼 代碼如下:
NameVirtualHost *:80
<VirtualHost *:80>
DocumentRoot "E:/website/pxsj"
ServerName host7.com
ServerAlias 192.168.1.116
<Directory "E:/website/pxsj">
Options Indexes FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
NameVirtualHost *:8080
<VirtualHost *:8080>
DocumentRoot "E:/website/whsj"
ServerName host10.com:8080
ServerAlias 192.168.1.116:8080
<Directory "E:/website/whsj">
Options Indexes FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
二、\wamp\bin\apache\Apache2.4.4\conf\httpd.conf 修改如下:
在該文件中查找“Listen”一詞修改
復(fù)制代碼 代碼如下:
Listen 80
Listen 8080
# Virtual hosts
# Include conf/extra/httpd-vhosts.conf去掉前面的#,這樣就開啟了httpd-vhosts虛擬主機文件。這時候重啟環(huán)境
三、C:\Windows\System32\drivers\etc\hosts 修改配置
復(fù)制代碼 代碼如下:
<pre code_snippet_id="331423" snippet_file_name="blog_20140507_1_9705788"></pre>
<pre></pre>
<pre></pre>
<pre></pre>
相關(guān)文章
Ubuntu設(shè)置開機自動掛載所有格式硬盤分區(qū)
原來那么簡單,安裝下面的東東,運行,設(shè)置,搞定!2008-09-09
Ubuntu無網(wǎng)絡(luò)標(biāo)識的問題及解決
這篇文章主要介紹了Ubuntu無網(wǎng)絡(luò)標(biāo)識的問題及解決,具有很好的參考價值,希望對大家有所幫助,如有錯誤或未考慮完全的地方,望不吝賜教2024-04-04

