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 webmaster@dummy-host2.zhongyu.com 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错误