zoukankan      html  css  js  c++  java
  • wamp2.5版本配置多端口虚拟主机

    1.保证httpd.conf下

    LoadModule php5_module "D:/E/php/wamp/bin/php/php5.5.12/php5apache2_4.dll"
    PHPIniDir E:/wamp/bin/php/php5.5.12

    这两个没被注释掉

    2.打开多站点配置:
    httpd.conf下面:Include conf/extra/httpd-vhosts.conf 去掉前面注释

    3.httpd.conf下监听端口(这个好像原来老版本不是这样配置的,所以模仿第一个80的端口,可以写出8080的端口)

    Listen 0.0.0.0:80
    Listen [::0]:80
    
    #listen to 8080
    Listen 0.0.0.0:8080
    Listen [::0]:8080

    4.http-vhosts.conf配置(注意 Require all granted,不要写成什么allow from all什么的,可以参考httpd.conf中的写法。)

    <VirtualHost *:80>
        ServerAdmin webmaster@dummy-host2.example.com
        DocumentRoot "E:/wwwroot/think"
        ServerName localhost
        ServerAlias localhost
        ErrorLog "logs/dummy-host2.example.com-error.log"
        CustomLog "logs/dummy-host2.example.com-access.log" common
        <Directory "E:/wwwroot/think">
        Options Indexes FollowSymLinks
        AllowOverride all
        Require all granted
        </Directory>
    </VirtualHost>
    <VirtualHost *:8080>
        ServerAdmin webmaster@dummy-host2.example.com
        DocumentRoot "E:/wwwroot/test"
        ServerName localhost
        ServerAlias localhost
        ErrorLog "logs/dummy-host2.example.com-error.log"
        CustomLog "logs/dummy-host2.example.com-access.log" common
        <Directory "E:/wwwroot/test">
        Options Indexes FollowSymLinks
        AllowOverride all
        Require all granted
        </Directory>
    </VirtualHost> 

    注意
    修改正确的项目根目录 E:/wwwroot/test 和 E:/wwwroot/think
    Require all granted不要写成 allow from all 之类的,apache版本高了 语法也变了。
    现在可以访问 localhost:80和localhost:8080了

  • 相关阅读:
    未能加载文件或程序集"xxx"或它的一个依赖项。试图加载格式不正确的程序。
    js实现拖动div,兼容IE、FireFox,暂不兼容Chrome
    WPF 像CSS一样使用 Font Awesome 图标字体
    面向接口、面向对象、面向方面的区别
    ionic 编译 gradle下载。
    ionic 不是外部命令 不是内部命令
    Ionic 编译找不到index.html
    分区表
    安装.net framwork3.5
    MSDTC不可用解决办法
  • 原文地址:https://www.cnblogs.com/xvpindex/p/7199927.html
Copyright © 2011-2022 走看看