apache/install/ target=_blank class=infotextkey>apache配置多个端口访问,请参考如下配置步骤进行。
1、配置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 192.168.11.28:80
Listen 80
Listen 81
Listen 82
2、开启虚拟站点
复制代码 代码示例:
# Virtual hosts
#
include conf/extra/httpd-vhosts.conf
#修改为
# Virtual hosts
Include conf/extra/httpd-vhosts.conf
3、配置conf/extra/httpd-vhosts.conf
复制代码 代码示例:
<VirtualHost *:81>
ServerAdmin webmaster@jbxue.localhost
DocumentRoot "C:/PhpDocRoot/Site1"
ServerName jb200.com
Server
alias jb200.com
ErrorLog "logs/jbxue.localhost-error.log"
CustomLog "logs/jbxue.localhost-access.log" common
<Directory "C:/PhpDocRoot/Site1">
Options Indexes FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
重启apache使生效。
此时访问站点出现:you don't have permission to access / on this server(Apache Server权限访问问题)错误,作如下的修改即可:
httpd.conf:
复制代码 代码示例:
<Directory/>
Options FollowSymLinks
AllowOverride None
Order deny,allow
Deny from all
</Directory>
修改Deny from all 为 Allow from all。
重启apache使其生效。