Apache 根据不同的端口 映射不同的站点
以前,在本地新建个项目,总是在Apache的htdocs目录下新建个项目目录,今年弄了个别人写好的网站源码,因为该系统的作者假定网站是放在根目录的,放在二级目录下会出错。所以无奈,只能想办法,根据端口映射到一个新的站点。
在网上查了下资料,以下是我的修改过程:
# Virtual hosts
#Include conf/extra/httpd-vhosts.conf
首先,在Apache的配置文件httpd.conf中,找到上面的两条语句,将第二行前面的注释符‘#’去掉,改成:
# Virtual hosts
Include conf/extra/httpd-vhosts.conf
然后,打开conf\extra文件夹,打开httpd-vhosts.conf文件,这个是一个模板文件,稍做修改即可,以下是我改后的文件内容:
#
# Virtual Hosts
#
# If you want to maintain multiple domains/hostnames on your
# machine you can setup VirtualHost containers for them. Most configurations
# use only name-based virtual hosts so the server doesn't need to worry about
# IP addresses. This is indicated by the asterisks in the directives below.
#
# Please see the documentation at
# <URL:http://httpd.apache.org/docs/2.2/vhosts/>
# for further details before you try to setup virtual hosts.
#
# You may use the command line option '-S' to verify your virtual host
# configuration. #
# Use name-based virtual hosting.
#
#NameVirtualHost *:80 #
# VirtualHost example:
# Almost any Apache directive may go into a VirtualHost container.
# The first VirtualHost section is used for all requests that do not
# match a ServerName or ServerAlias in any <VirtualHost> block.
#
Listen 8090
<VirtualHost *:8090>
ServerAdmin webmaster@dummy-host.localhost
DocumentRoot "D:/Program Files/Apache Software Foundation/Apache2.2/htdocs/wanjinv3"
ServerName localhost:8090
# ServerAlias www.dummy-host.localhost
ErrorLog "logs/dummy-host.localhost-error.log"
CustomLog "logs/dummy-host.localhost-access.log" common <Directory "D:/Program Files/Apache Software Foundation/Apache2.2/htdocs/wanjinv3">
#
# 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.2/mod/core.html#options
# for more information.
#
Options Indexes FollowSymLinks #
# AllowOverride controls what directives may be placed in .htaccess files.
# It can be "All", "None", or any combination of the keywords:
# Options FileInfo AuthConfig Limit
#
AllowOverride All #
# Controls who can get stuff from this server.
#
Order allow,deny
Allow from all </Directory>
</VirtualHost>
Apache 根据不同的端口 映射不同的站点的更多相关文章
- Apache服务器中设置端口映射和反向代理的方法
在/etc/httpd/conf路径下的httpd.conf文件###new add for webui.cong###Include "E:/local/Wamp/bin/apache/A ...
- CentOS下Apache配置多域名或者多端口映射
CentOS下Apache默认网站根目录为/var/www/html,假如我默认存了一个CI项目在html文件夹里,同时服务器的外网IP为ExampleIp,因为使用的是MVC框架,Apache需开启 ...
- Apache添加多端口及实现单ip多端口映射的方法
这篇文章主要介绍了Apache添加多端口及实现单ip多端口映射的方法的相关资料,需要的朋友可以参考下(http://www.0831jl.com) 先给大家说下apache添加多端口的方法,具体步骤如 ...
- 用端口映射在Apache中对每个项目分配端口,实现一个端口访问一个网站
映口映射的功能主要就是实际互联网可以访问当前进行映射的电脑,首先我们要进行路由器的端口映射,常见的开放端口有80,21,3389等,80是网站常用端口,21是FTP服务器常用端口,3389是远程桌面连 ...
- 局域网虚拟机端口映射访问apache
如果我们在虚拟机内搭建好服务器后,希望可以在局域网内的设备上都能访问到这个虚拟服务器,就可以参照以下步骤来操作.其中包括了很多遇到的坑.先说说我的环境是 宿主机:windows 8.1 虚拟机:vmw ...
- 使用 Anydesk 5.1 TCP 通道(端口映射)功能从外网方便访问内网的 web/数据库等资源
Anydesk 5.1 带来一个新的功能:TCP 通道,在家办公时,通过互联网进行远程桌面连接到公司电脑,可以将家用电脑的某个端口,映射到公司网络的某个电脑( IP + 端口),不局限于被远程桌面连接 ...
- Windows10环境配置nat123端口映射访问mysql
背景:因工作需要,在宽带路由器内部设置一个台式机(可上网),配置成数据库服务器.分散各处的多台外网机可以通过jdbc连接该数据库服务器进行开发.要进行端口映射. 环境: 宽带通 Windows10企业 ...
- Tp-link TL-WR841N无线路由器端口映射到外网如何设置
针对TP-LINK的无线路由器进行演示如何设置端口映射和访问控制,演示使用的具体型号是TP-LINK TL-WR841N 3G无线路由器如何设置端口映射. 什么是端口映射? 端口映射又称端口转发,有的 ...
- TTradmin v1.1 - 免端口映射穿透任何内网、基于radmin核心的即时远程协助
TTradmin 是一款免端口映射可直接穿透任何内网,基于radmin核心的即时远程协助软件.在使用的时候只需要保证“协助端”和“被协助端”使用同一个验证码即可实现安全便捷的远程控制,不需要进 ...
随机推荐
- arcgis jsapi接口入门系列(0):总览
开发环境: arcgis jsapi版本4.9 由于我们这套代码是基于vue,webpack开发的,会有少数vue代码,但总体不影响 里面还有些我们公司的js库和html css,给出的代码不能百分百 ...
- 1.2 the structure of a compiler
Compiler 1.2 the structure of a compiler Compiler : analysis and synthesis syntactically 语法上的 sema ...
- NullPointerException检测
APET-NPE插件工作原理 android应用程序编译的过程如下: 从图中,我们可以看出,app编译大致经历了四大阶段:java source files -> .class files -& ...
- git的常用操作指令
git学习网址: http://www.backlogtool.com/git-guide/cn/intro/intro2_3.html 廖雪峰的git教程 git的工作区和暂存区(描述git的工作流 ...
- ssh免密登录配置方法
方法一 1.#ssh-keygen -t rsa 在客户端生成密钥对 把公钥拷贝给要登录的目标主机, 目标主机上将这个公钥加入到授权列表 #cat id_rsa.pub >> author ...
- SGU 258 Almost Lucky Numbers 接近幸运数(数位DP)
题意: 定义一个具有2n位的正整数,其前n位之和与后n位之和相等,则为lucky数.给定一个区间,问有多少个正数可以通过修改某一位数从而变成lucky数?注意不能含前导0. 思路: 我的想法是记录那些 ...
- BZOJ 4070:[APIO2015]雅加达的摩天楼 最短路
4070: [Apio2015]雅加达的摩天楼 Time Limit: 10 Sec Memory Limit: 256 MBSubmit: 464 Solved: 164[Submit][Sta ...
- External Pricing in C4C and ERP
从下图可以看出,C4C的Opportunity,Sales Quote和Sales Order这些business transaction没有自己的pricing engine,使用的是在ERP Pr ...
- UVA Planning mobile robot on Tree树上的机器人(状态压缩+bfs)
用(x,s)表示一个状态,x表示机器人的位置,s表示其他位置有没有物体.用个fa数组和act数组记录和打印路径,转移的时候判断一下是不是机器人在动. #include<bits/stdc++.h ...
- Python-OpenCV中的cv2.inpaint()函数
概念 修复是图像插值.数字修复算法在图像插值,照片恢复,缩放和超分辨率等方面具有广泛的应用. 大多数人会在家里放一些旧的退化照片,上面有一些黑点,一些笔画等.你有没有想过恢复它?我们不能简单地在绘画工 ...