Apache 多端口多站点配置方法

时间:2023-01-09 15:21:42 

配置httpd.conf
监听多个端口


# Listen: Allows you to bind Apache to specific IP addresses and/or
# ports, instead of the default. See also the <VirtualHost>
# directive.
#
# Change this to Listen on specific IP addresses as shown below to
# prevent Apache from glomming onto all bound IP addresses.
#
#Listen 12.34.56.78:80
Listen 8081
Listen 8082
Listen 8083


#增加监听端口
等以下内容都设置以后,可以通过netstat -n -a查看端口是否开启
开启虚拟站点


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


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

配置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>
<Directory...>...</Directory>


一定不能少
重新启动apache试一下,如果出错,查看一下logs下面的log文件还有windows的事件查看器记录的错误日志。

标签:多端口,多站点
0
投稿

猜你喜欢

  • 帝国、PHPCMS及织梦对比(二):支持SQL调用的标签

    2011-08-26 13:00:58
  • meta中的关键字标签 Keywords 优化技巧

    2009-01-04 13:23:00
  • CentOS Linux系统搭建Android开发环境详细介绍

    2023-08-07 04:45:53
  • 微软首次披露:Bing的命名取自百岁老人

    2009-10-14 09:26:00
  • DNS服务器架设:winmydns

    2009-01-06 17:08:00
  • google的403错误解密

    2008-01-02 19:25:00
  • ubuntu 13.10编译安装mono环境(二)

    2021-01-03 01:18:14
  • Windows 2003 架设用户隔离FTP站点

    2009-12-22 19:20:00
  • 学习成果分享:与搜索友好的网站架设规范

    2009-01-23 13:56:00
  • IDC:黑莓机打败iPhone 抢下Q3全球手机榜眼

    2009-11-08 18:45:00
  • 共享控制台--让远程桌面更人性化(3)

    2007-03-27 11:28:00
  • Serv-u本地权限提升漏洞的终极防御

    2008-12-25 12:46:00
  • 谷歌操作系统打破微软垄断 相互渗透核心业务

    2009-11-22 09:41:00
  • 解决win10家庭版VMware不能安装64位操作系统问题

    2023-06-01 08:16:19
  • 做一个中国式站长必须知道的五十个问题

    2007-09-24 12:15:00
  • Linux tr命令的使用

    2022-10-31 10:08:49
  • 重新考虑你的Exchange存储群组问题

    2010-02-21 19:00:00
  • 如何部署Exchange建立ASP应用

    2010-02-26 18:33:00
  • Visual Firebug 1.11 使用帮助 chrome插件

    2011-01-25 12:45:00
  • 复制“徐静蕾模式” 新浪微博邀名人入伙

    2009-11-13 13:52:00
  • asp之家 网站运营 m.aspxhome.com