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服务后,可以看到不同端口进入不同的网页入口

相关内容

热门资讯

专业讨论!hhpoker破解,... 专业讨论!hhpoker破解,(WepoKer)透视器下载,安装教程(有挂动态)-哔哩哔哩;Wepo...
发现一款!wpk插件辅助,wp... 发现一款!wpk插件辅助,wpk透视是真的假的,hhpoker辅助挂是真的吗(2020已更新)(哔哩...
三分钟透视辅助!wepoke支... 三分钟透视辅助!wepoke支持安卓,aapoker透明挂,线上德州aapoker透明挂(有挂成果)...
科普攻略!(永州同城扯胡子)外... 您好,永州同城扯胡子这款游戏可以开挂的,确实是有挂的,需要了解加微【485275054】很多玩家在这...
透明插件!财神13张 辅助器,... 透明插件!财神13张 辅助器,娱友乐互娱原来是有挂的,攻略方法(有挂技巧)-哔哩哔哩是一款可以让一直...
重大发现!(心悦麻将)外挂透明... 重大发现!(心悦麻将)外挂透明挂辅助攻略(透视)攻略方法(2020已更新)(哔哩哔哩);心悦麻将简单...
最新通报!hhpoker辅助挂... 最新通报!hhpoker辅助挂,(wepOkEr)辅助挂APP,2024新版教程(有挂测试)-哔哩哔...
最新研发!we-poker辅助... 最新研发!we-poker辅助软件教程,wepoker模拟器哪个,hhpoker软件靠谱吗(2025...
8分钟透视辅助!gg扑克发牌好... 您好,这款游戏可以开挂的,确实是有挂的,需要了解加微【757446909】很多玩家在这款游戏中打牌都...
安装程序教程!(aa扑克辅助)... 您好,aa扑克辅助这款游戏可以开挂的,确实是有挂的,需要了解加微【485275054】很多玩家在这款...