Apache 配置多端口 多虚拟主机 局域网访问示例
更新时间:2014年05月12日 16:20:05 作者:
这篇文章主要介绍了Apache如何配置多端口 多虚拟主机 局域网访问,需要的朋友可以参考下
一、在\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虚拟主机文件。这时候重启环境
三、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>
复制代码 代码如下:
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虚拟主机文件。这时候重启环境
三、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>
相关文章
CentOS 7 x64下Apache+MySQL(Mariadb)+PHP56的安装教程详解
这篇文章主要介绍了CentOS 7 x64下Apache+MySQL(Mariadb)+PHP56的安装教程,非常不错,具有参考借鉴价值,需要的朋友可以参考下2016-12-12Ubuntu E: 无法获得锁 /var/lib/dpkg/lock-frontend - open (11: 资源暂时
这篇文章主要介绍了Ubuntu E: 无法获得锁 /var/lib/dpkg/lock-frontend - open (11: 资源暂时不可用),本文通过两种方案给大家分析问题所在原因,需要的朋友可以参考下2019-10-10
最新评论