欢迎来到代码驿站!

Linux

当前位置:首页 > 服务器 > Linux

Apache 配置多端口 多虚拟主机 局域网访问示例

时间:2022-04-26 09:08:10|栏目:Linux|点击:
一、在\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>

上一篇:windows apache多端口虚拟主机配置方法

栏    目:Linux

下一篇:Linux 下目录文件权限(命令)的查看和修改

本文标题:Apache 配置多端口 多虚拟主机 局域网访问示例

本文地址:http://www.codeinn.net/misctech/200261.html

推荐教程

广告投放 | 联系我们 | 版权申明

重要申明:本站所有的文章、图片、评论等,均由网友发表或上传并维护或收集自网络,属个人行为,与本站立场无关。

如果侵犯了您的权利,请与我们联系,我们将在24小时内进行处理、任何非本站因素导致的法律后果,本站均不负任何责任。

联系QQ:914707363 | 邮箱:codeinn#126.com(#换成@)

Copyright © 2020 代码驿站 版权所有