zoukankan      html  css  js  c++  java
  • wamp配置本地多站点。

    '

    进入C:wamp64wamp64inapacheapache2.4.37confhttp.conf

    首先确保httpd-vhosts.conf扩展文件引入进来了,部分版本默认是不引入 (Include conf/extra/httpd-vhosts.conf前面有#代表没有引入,把#去掉)

    进入C:wamp64wamp64inapacheapache2.4.37confextrahttpd-vhosts.conf

    <VirtualHost *:80>
      ServerName localhost.xyz  #ServerName即是要添加的域名,在本例中也就是localhost.xyz  ,如果别人访问这个域名,那么将被Apache自动解析到${INSTALL_DIR}/www
    这个目录下,也就是本例中的DocumentRoot所指定的目录。
    #ServerName(必须) 一定要是域名,可以百度域名格式(如果不是域名格式记得在URL后面加个/也可以)
     ServerAlias localhost.com #Alias的中文意思就是别名,这里就相当于给localhost.xyz起个别名为localhost.com,可以是别的域名
    #ServerAlias(非必须)一定要是域名,可以百度域名格式(如果不是域名格式记得在URL后面加个/也可以)

    DocumentRoot "${INSTALL_DIR}/www" #站点根目录(必须)${INSTALL_DIR}/www替换成你的站点根目录
     <Directory "${INSTALL_DIR}/www/"> Options +Indexes +Includes +FollowSymLinks +MultiViews AllowOverride All Require local </Directory> </VirtualHost>

     创建站点目录

    创建你的站点目录

     

     进入http-vhosts.conf

    # Virtual Hosts
    #
    <VirtualHost *:80>
      ServerName localhost
      ServerAlias localhost
      DocumentRoot "${INSTALL_DIR}/www"
      <Directory "${INSTALL_DIR}/www/">
        Options +Indexes +Includes +FollowSymLinks +MultiViews
        AllowOverride All
        Require local
      </Directory>
    </VirtualHost>
    
    # </VirtualHost>
    <VirtualHost *:80>
      ServerName text1.co    //域名配置为text1.co
      ServerAlias localhost.cn  //域名别称为localhost.cn 访问localhost.cn等于访问text1.co
      DocumentRoot "C:wamp64Demo	ext1"  //站点根目录为C:wamp64Demo	ext1
      <Directory "C:wamp64Demo	ext1">
        Options +Indexes +Includes +FollowSymLinks +MultiViews
        AllowOverride All
        Require local
      </Directory>
    </VirtualHost>
    
    <VirtualHost *:80>
      ServerName text2.co
      ServerAlias localhost
      DocumentRoot "C:wamp64Demo	ext2"
      <Directory "C:wamp64Demo	ext2">
        Options +Indexes +Includes +FollowSymLinks +MultiViews
        AllowOverride All
        Require local
      </Directory>
    </VirtualHost>

    打开浏览器,访问localhost.cn

    原因:站点默认为index.php,用t1.php没有权限()

    新建一个

    写入

    浏览器重新打开

     成功了

    e:/www/team
  • 相关阅读:
    我决定潜心研究技术了...
    new proxy
    谷歌插件开发
    js计算不准确 解决方案
    netty中如何切包
    Spring Boot的ComponentScan原理
    解决org.yaml.snakeyaml.scanner.ScannerException: while scanning for the next token found character '@'
    深入理解js立即执行函数
    winform 将子窗体显示在父窗体的TabControl控件上
    js隐藏网页元素
  • 原文地址:https://www.cnblogs.com/chargeworld/p/10436580.html
Copyright © 2011-2022 走看看