/ 中存储网

Apache服务器如何配置使用多个端口

2014-03-01 15:19:01 来源:itjs.cn

1.配置httpd.conf

监听多个端口

2.#增加监听端口

等以下内容都设置以后,可以通过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 *:8090>

ServerAdmin [email protected]

DocumentRoot "D:/malladmin"

ServerName dummy-host2.zhongyu.com

ErrorLog "logs/dummy-host2.zhongyu.com-error.log"

CustomLog "logs/dummy-host2.zhongyu.com-access.log" common

<Directory "D:/malladmin">

Options FollowSymLinks

Options Indexes FollowSymLinks

AllowOverride all

Order allow,deny

Allow from all

</Directory>

</VirtualHost>

一定要加上 <Directory></Directory>这段,否则会报403错误