zoukankan      html  css  js  c++  java
  • xampp下创建多个虚拟网站目录

    大家知道,伟大的IIS下面增加多个网站就1分钟搞定。现在换XAMPP下运行多个PHP目录,那我们需要有点探索精神。那么进入正题

    首先,下载安装官方最新版本的xampp,地址:点击。记得如果电脑安装有IIS,记得点击config来修改端口号

    安装成功后,运行软件,点击Explorer.


    会打开软件的安装目录,选择.apacheconfextrahttpd-vhosts.conf  ,打开。


    添加如下内容:



      1. <VirtualHost 127.0.0.2:80>  
      2.     ServerAdmin "127.0.0.2:80"    
      3.     DocumentRoot "E:/wwwroot/xxx"  
      4.     ServerName 127.0.0.2  
      5.     ErrorLog "logs/xxx.log"  
      6.     CustomLog "logs/xxx.log" combined  
      7. </VirtualHost>   
      8.   
      9. DocumentRoot "E:/wwwroot"  
      10. <Directory "E:/wwwroot">  
      11.     #  
      12.     # Possible values for the Options directive are "None", "All",  
      13.     # or any combination of:  
      14.     #   Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews  
      15.     #  
      16.     # Note that "MultiViews" must be named *explicitly* --- "Options All"  
      17.     # doesn't give it to you.  
      18.     #  
      19.     # The Options directive is both complicated and important.  Please see  
      20.     # http://httpd.apache.org/docs/2.4/mod/core.html#options  
      21.     # for more information.  
      22.     #  
      23.     Options Indexes FollowSymLinks Includes ExecCGI  
      24.   
      25.     #  
      26.     # AllowOverride controls what directives may be placed in .htaccess files.  
      27.     # It can be "All", "None", or any combination of the keywords:  
      28.     #   AllowOverride FileInfo AuthConfig Limit  
      29.     #  
      30.     AllowOverride All  
      31.   
      32.     #  
      33.     # Controls who can get stuff from this server.  
      34.     #  
      35.     Require all granted  
      36. </Directory>  

    ,之后依次添加127.0.0.3,127.0.0.4,就直接复制

     

    比网上那些改HOST半天还不成功的方便多了吧?

  • 相关阅读:
    FastDFS分布式文件系统
    Nginx负载均衡
    Linux系统:第六章:Linux服务
    libphp5.so可能遇到的问题(转摘)
    apache和tomcat的关系
    linux有些sh文件,为什么要用 ./ 来执行
    Linux上安装apache
    解决centos6系统上python3—flask模块的安装问题
    常见的消息队列中间件介绍
    Linux上部署Tomcat+Nginx负载均衡
  • 原文地址:https://www.cnblogs.com/wishbay/p/5241205.html
Copyright © 2011-2022 走看看