1.配置httpd.conf 
监听多个端口

#Listen 12.34.56.78:80 
Listen 8081 
Listen 8082 
Listen 8083

可以通过netstat -n -a查看端口是否开启

2.开启虚拟站点

# Virtual hosts 
#Include conf/extra/httpd-vhosts.conf 
#修改为 
# Virtual hosts 
Include conf/extra/httpd-vhosts.conf

3.php配置

加载php模块,php5apache2_2代表使用的是apache2.2或以上版本 
LoadModule php5_module "c:/php/php5apache2_2.dll" 
PHPIniDir "C:/php" 
配置php文件类型映射 
AddType application/x-httpd-php .php

4。配置conf/extra/httpd-vhosts.conf

<VirtualHost *:8082> 
ServerAdmin webmaster@dummy-host.localhost 
DocumentRoot "C:/PhpDocRoot/Site1" 
ServerName localhost 
ServerAlias localhost 
ErrorLog "logs/dummy-host.localhost-error.log" 
CustomLog "logs/dummy-host.localhost-access.log" common 
<Directory "C:/PhpDocRoot/Site1"> 
Options Indexes FollowSymLinks 
AllowOverride None 
Order allow,deny 
Allow from all 
</Directory> 
</VirtualHost> 
<VirtualHost *:8083> 
ServerAdmin webmaster@dummy-host2.localhost 
DocumentRoot "C:/PhpDocRoot/Site2" 
ServerName localhost 
ErrorLog "logs/dummy-host2.localhost-error.log" 
CustomLog "logs/dummy-host2.localhost-access.log" common 
<Directory "C:/PhpDocRoot/Site2"> 
Options Indexes FollowSymLinks 
AllowOverride None 
Order allow,deny 
Allow from all 
</Directory> 
</VirtualHost>

实际中使用多域名只用80 然后hosts指定localhost2即可:

<VirtualHost *:80>
DocumentRoot E:/SVNRoot/BFGLogic/src
ServerName localhost
ServerAlias localhost
</VirtualHost>

<VirtualHost *:80>
DocumentRoot D:/php/webroot
ServerName localhost2
ServerAlias localhost2
</VirtualHost>

最后重启,如果错误仔细查询log

wamp多站点多端口配置的更多相关文章

  1. apache多站点配置+多端口配置

    Apache多站点配置 这种方法是配置不同的地址访问不同的文件夹的配置 1:修改本机的hosts文件,如下: 示例: 127.0.0.1 localhost 127.0.0.1 www.dede.co ...

  2. (转)WAMP多站点配置

    转自:http://wislab.net/archives/43.html Wamp正在被广泛使用,其傻瓜式的安装配置,使得我们可以得心应手地完成以往较为烦琐的服务器环境搭建过程,直接进入到网页程序的 ...

  3. nginx+php+mysql+wordpress搭建简单站点 安装及配置过程

    环境 阿里云ECS云服务器 CPU:1核 内存:2G 操作系统:Centos 7.3 x64 地域:华北 2(华北 2 可用区 A) 系统盘:40G 安装及配置 主要使用 nginx . php 和 ...

  4. debian apache2 多端口对应多文件 虚拟端口配置

    apache2单IP多端口创建虚拟站点如下: 1.转到配制目录虚拟站点配制目录 cd /etc/apache2/ ​ 2.配置新增多的端口 编辑上级目录中的端口配制文件sudo gedit ports ...

  5. 如何解决WAMP Server 与IIS端口冲突问题

    PHP也是一门开发网页的语言,WAMP Server 是它的一个较好的集成开发环境,今日,小编发现好多Wamp Server 安装后启动local host 出现的却是IIS页面!为什么会这样呢? 出 ...

  6. LNMP 搭建 wordpress 站点 安装及配置过程

    0x00 环境 阿里云ECS云服务器 CPU:1核 内存:4G 操作系统:Centos 系统盘:100G 0x01 安装及配置 主要使用 nginx . php 和 mysql 注意:如果下面的设置不 ...

  7. 阿里云服务器Linux CentOS安装配置(六)resin多端口配置、安装、部署

    阿里云服务器Linux CentOS安装配置(六)resin多端口配置.安装.部署 1.下载resin包 http://125.39.66.162/files/2183000003E08525/cau ...

  8. apache 多端口配置和虚拟主机配置

    1 打开httpd.conf文件 2 添加端口监听 (找到Lisen 80 在后面添加 Listen 端口号 如Listen 1112) port =>你的端口 project_name=> ...

  9. CentOS 7 防火墙和端口配置

    centos 7 防火墙和端口配置--解决 RHEL 7/ CentOS 7/Fedora 出现Unit iptables.service failed to load # 第一步,关闭firewal ...

随机推荐

  1. 001.网络TCP/IP工程知识点

    一 互联网概述 计算机网络定义:由自主计算机互连起来的集合体. 计算机网络两大部分:硬件:计算机.通信设备.接口设备和传输介质. 软件:通信协议和应用软件. 广域网拓扑结构通常有:网状拓扑结构和环形拓 ...

  2. js数据结构之栈和队列的详细实现方法

    队列 队列中我们主要实现两种: 1. 常规队列 2. 优先队列(实际应用中的排队加急情况等) 常规队列的实现方法如下: // 常规队列 function Queue () { this.queue = ...

  3. Codeforces-541div2

    https://www.cnblogs.com/31415926535x/p/10427505.html codeforces-1131A~G 这场很多题都很简单,,应该是要能至少做出4道的,,但是我 ...

  4. 【Java并发核心七】计划任务ScheduleExecutorService

    Java中定时任务Timer工具类提供了计划任务的实现,但是Timer工具类是以队列的方式来管理线程的,并不是以线程池的方式,这样在高并发的情况下,运行效率会有点低. ScheduleExecutor ...

  5. 解决binwalk运行提示缺少LZMA模块

    解决binwalk运行提示缺少LZMA模块   部分用户在使用binwalk提取固件内容,可能会遇到缺少LZMA模块的提示.提示内容为WARNING:The Python LZMA module co ...

  6. 模拟页面获取的php数据(一)

    <?php return array( "aData" => array(//通勤方式 "trafficType" => array( 0 = ...

  7. golang中发送http请求的几种常见情况

    整理一下golang中各种http的发送方式 方式一 使用http.Newrequest 先生成http.client -> 再生成 http.request -> 之后提交请求:clie ...

  8. 安卓工作室 android studio 谷歌账号 登录

    作者:韩梦飞沙 Author:han_meng_fei_sha 邮箱:313134555@qq.com E-mail: 313134555 @qq.com 登录你的谷歌账号,开始 添加 云功能 到你的 ...

  9. Python图形编程探索系列-09-tkinter与matplotlib结合案例

    案例1 案例来自于:https://bbs.csdn.net/topics/390326088 代码示例: import matplotlib matplotlib.use('TkAgg') from ...

  10. pycharm引入numpy报错:ImportError: Importing the multiarray numpy extension module failed. Most likely you are trying to import a failed build of numpy.

    软件为pycharm,安装了anaconda. 我一开始的报错为,PyCharm中无法调用numpy,报错ModuleNotFoundError: No module named 'numpy',这个 ...