Apache 多端口多站点配置方法

  1. httpd.conf 文件打开虚拟机配置文件;添加监听端口
    # Virtual hosts
    Include etc/extra/httpd-vhosts.conf

#Listen 12.34.56.78:80
Listen 8081
Listen 8082
Listen 8083

2)开启虚拟站点
-# Virtual hosts
Include conf/extra/httpd-vhosts.conf

3)检查监听端口
通过netstat -n -a查看端口是否开启

5)httpd-vhosts.conf 指定的文件夹下复制配置文件,在新复制的文件中添加安装的文件夹,如phpwind.conf配置

<VirtualHost :8081>
DocumentRoot /alidata/www/phpwind
ServerName localhost
ServerAlias localhost
<Directory "/alidata/www/phpwind">
Options Indexes FollowSymLinks
AllowOverride all
Order allow,deny
Allow from all


RewriteEngine On
RewriteRule ^(.
)-htm-(.)$ .php?
RewriteRule ^(.
)/simple/([a-z0-9_]+.html)$ /simple/index.php?

ErrorLog "/alidata/log/httpd/phpwind-error.log"
CustomLog "/alidata/log/httpd/phpwind.log" common

参考

posted @ 2016-01-27 11:01  Forrest.Wang  阅读(229)  评论(0编辑  收藏  举报