apache一台服务器如何通过不同端口映射不同网页服务入口
创始人
2024-09-25 14:52:02
0

一、背景

由于服务器资源受限(IP资源或硬件资源),有时候希望一台服务器IP能有部署多个网页服务入口。

传统都是80端口映射为默认服务入口,当需要部署多个网页服务入口时,可以启用其他端口,不同端口映射到不同的网页服务。

通过这种方案,需要配置服务器的apache端口映射方案

二、方案

2.1 大体原理

通过设置apache vhost选项,支持对于特定端口支持映射到不同的本地入口网页文件。

2.2 操作步骤

1、设置http.conf,监听其他需要启用的端口

编辑http.conf文件,找到Listen xxx,加上自己想要listen的端口

2、设置vhost端口

打开vhost对应目录,一般在~\apache\conf\extra对应目录,

3、设置vhost端口映射文件

设置方式如图:

主要代码:

NameVirtualHost *:8868      ServerAdmin 1181761347@qq.com     DocumentRoot "D:\SDWS_NEW\frontEnd\DianSuiWeiShi3\unpackage\dist\build\web"     ServerName newxianglin.cn     ErrorLog "logs/newxianglin_sdws.log"     CustomLog "logs/newxianglin_sdws.log" common 	     #     # Possible values for the Options directive are "None", "All",     # or any combination of:     #   Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews     #     # Note that "MultiViews" must be named *explicitly* --- "Options All"     # doesn't give it to you.     #     # The Options directive is both complicated and important.  Please see     # http://httpd.apache.org/docs/2.4/mod/core.html#options     # for more information.     #     Options Indexes FollowSymLinks Includes ExecCGI      #     # AllowOverride controls what directives may be placed in .htaccess files.     # It can be "All", "None", or any combination of the keywords:     #   AllowOverride FileInfo AuthConfig Limit     #     AllowOverride All      #     # Controls who can get stuff from this server.     #     Require all granted 	 

三、效果

重启apache服务后,可以看到不同端口进入不同的网页入口

相关内容

热门资讯

五分钟了解!wepoke ai... 自定义新版wpk德州系统规律,只需要输入自己想要的开挂功能,一键便可以生成出wpk德州专用辅助器,不...
发现一款!(浙江茶苑温州双扣)... 发现一款!(浙江茶苑温州双扣)外挂透明挂辅助神器(透视挂)解密教程(2022已更新)(哔哩哔哩);浙...
如何分辨真伪!山西扣点点辅助器... 如何分辨真伪!山西扣点点辅助器免费,闽游麻将十三水原来是有挂猫腻,可靠教程(有挂解密)-哔哩哔哩是一...
一分钟揭秘!wpk辅助购买,w... 一分钟揭秘!wpk辅助购买,wejoker透视方法,weopker底牌透视(2022已更新)(哔哩哔...
必看攻略!(aapoker牌局... 您好,aapoker牌局这款游戏可以开挂的,确实是有挂的,需要了解加微【136704302】很多玩家...
玩家必备教程!(同城字牌辅助)... 玩家必备教程!(同城字牌辅助)外挂透明挂辅助安装版(透视挂)必赢方法(2020已更新)(哔哩哔哩)是...
指导大家!hhpoker真的有... 指导大家!hhpoker真的有透视,(wEpoKer)透视脚本脚本,AI教程(有挂普及)-哔哩哔哩;...
带你了解!天天十三张有外挂没,... 带你了解!天天十三张有外挂没,同城字牌原来是有挂的,细节方法(有挂秘笈)-哔哩哔哩;1、完成天天十三...
1分钟透明挂!wepoke系统... 1分钟透明挂!wepoke系统是免费的,pokerworld下载,德州软件工具(有挂实测)-哔哩哔哩...
总算了解!(中至麻将脚本)外挂... 总算了解!(中至麻将脚本)外挂透明挂辅助助手(辅助器)2024新版教程(2022已更新)(哔哩哔哩)...