Apache 配置多端口 多虛擬主機(jī) 局域網(wǎng)訪問示例
更新時(shí)間:2014年05月12日 16:20:05 作者:
這篇文章主要介紹了Apache如何配置多端口 多虛擬主機(jī) 局域網(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虛擬主機(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去掉前面的#,這樣就開啟了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)文章
CentOS 7 x64下Apache+MySQL(Mariadb)+PHP56的安裝教程詳解
這篇文章主要介紹了CentOS 7 x64下Apache+MySQL(Mariadb)+PHP56的安裝教程,非常不錯(cuò),具有參考借鑒價(jià)值,需要的朋友可以參考下2016-12-12Ubuntu E: 無法獲得鎖 /var/lib/dpkg/lock-frontend - open (11: 資源暫時(shí)
這篇文章主要介紹了Ubuntu E: 無法獲得鎖 /var/lib/dpkg/lock-frontend - open (11: 資源暫時(shí)不可用),本文通過兩種方案給大家分析問題所在原因,需要的朋友可以參考下2019-10-10CentOS服務(wù)器環(huán)境下MySQL主從同步配置方法
這篇文章主要介紹了CentOS服務(wù)器環(huán)境下MySQL主從同步配置方法,較為詳細(xì)的分析了CentOS服務(wù)器環(huán)境下MySQL主從同步的配置操作步驟、相關(guān)命令、使用方法與注意事項(xiàng),需要的朋友可以參考下2018-03-03CentOS 7 安裝vsftpd 服務(wù)器的具體操作步驟
下面小編就為大家?guī)硪黄狢entOS 7 安裝vsftpd 服務(wù)器的具體操作步驟。小編覺得挺不錯(cuò)的,現(xiàn)在就分享給大家,也給大家做個(gè)參考。一起跟隨小編過來看看吧2017-08-08CentOS7安裝PHP7 Redis擴(kuò)展的方法步驟
這篇文章主要介紹了CentOS7安裝PHP7 Redis擴(kuò)展的方法步驟,小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,也給大家做個(gè)參考。一起跟隨小編過來看看吧2019-04-04Linux系統(tǒng)下Nginx支持ipv6配置的方法
這篇文章主要介紹了Linux系統(tǒng)下Nginx支持ipv6的方法,小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,也給大家做個(gè)參考。一起跟隨小編過來看看吧2018-12-12