Apache 配置多端口 多虛擬主機(jī) 局域網(wǎng)訪問(wèn)示例
更新時(shí)間:2014年05月12日 16:20:05 作者:
這篇文章主要介紹了Apache如何配置多端口 多虛擬主機(jī) 局域網(wǎng)訪問(wèn),需要的朋友可以參考下
一、在\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去掉前面的#,這樣就開(kāi)啟了httpd-vhosts虛擬主機(jī)文件。這時(shí)候重啟環(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去掉前面的#,這樣就開(kāi)啟了httpd-vhosts虛擬主機(jī)文件。這時(shí)候重啟環(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)文章
詳解在LINUX上部署帶有JAR包的JAVA項(xiàng)目
這篇文章主要介紹了詳解在LINUX上部署帶有JAR包的JAVA項(xiàng)目,小編覺(jué)得挺不錯(cuò)的,現(xiàn)在分享給大家,也給大家做個(gè)參考。一起跟隨小編過(guò)來(lái)看看吧2018-03-03
基于Linux環(huán)境的進(jìn)度條實(shí)現(xiàn)方法
在Linux環(huán)境下,C語(yǔ)言的輸入輸出控制有其獨(dú)特的魅力和實(shí)際應(yīng)用場(chǎng)景,本文將從回車(chē)換行和緩沖區(qū)的基礎(chǔ)知識(shí)講起,帶領(lǐng)大家探索如何在Linux環(huán)境中實(shí)現(xiàn)一個(gè)動(dòng)態(tài)倒計(jì)時(shí)功能,并進(jìn)一步完成一個(gè)具有交互感的進(jìn)度條,需要的朋友可以參考下2025-01-01
Ubuntu設(shè)置開(kāi)機(jī)自動(dòng)掛載所有格式硬盤(pán)分區(qū)
原來(lái)那么簡(jiǎn)單,安裝下面的東東,運(yùn)行,設(shè)置,搞定!2008-09-09
CentOS系統(tǒng)臨時(shí)禁止一個(gè)用戶的方法
這篇文章主要介紹了給大家介紹了在CentOS系統(tǒng)中,如何臨時(shí)禁止一個(gè)用戶的方法,在CentOS系統(tǒng)中臨時(shí)禁止一個(gè)用戶,是臨時(shí)的不讓這個(gè)用戶使用Linux系統(tǒng),而不是刪除它。下面通過(guò)這篇文章來(lái)一起學(xué)習(xí)學(xué)習(xí)下吧。2016-11-11
Linux中如何開(kāi)啟或關(guān)閉SELinux
這篇文章主要介紹了Linux中如何開(kāi)啟或關(guān)閉SELinux問(wèn)題,具有很好的參考價(jià)值,希望對(duì)大家有所幫助,如有錯(cuò)誤或未考慮完全的地方,望不吝賜教2024-02-02
Ubuntu無(wú)網(wǎng)絡(luò)標(biāo)識(shí)的問(wèn)題及解決
這篇文章主要介紹了Ubuntu無(wú)網(wǎng)絡(luò)標(biāo)識(shí)的問(wèn)題及解決,具有很好的參考價(jià)值,希望對(duì)大家有所幫助,如有錯(cuò)誤或未考慮完全的地方,望不吝賜教2024-04-04

