zoukankan      html  css  js  c++  java
  • windows 下的 Apache 二级域名 目录绑定配置

    通常我们注册的域名都是顶级域名  如 www.potatog.com,我们希望这个域名可以访问服务器的不同网站或者不同功能等等 可能会这样 www.potatog.com/api 或者 www.potatog.com/admin,,,另一种二级域名的方式 api.potatog.com来指向特定目录

    在httpd.conf中添加如下内容

    顶级域名指定一个目录

    <VirtualHost *:80>
      ServerAdmin admin@potatog.com
      DocumentRoot "C:xampphtdocs"
      ServerName www.potatog.com
      ErrorLog "C:xamppapachelogswww.potatog.localhost-error.log"
      CustomLog "C:xamppapachelogswww.potatog.localhost.access.log" combined
    </VirtualHost>

    二级域名指定一个目录

    <VirtualHost *:80>
      ServerAdmin admin@potatog.com
      DocumentRoot "C:xampphtdocsapi"
      ServerName api.potatog.com
      ErrorLog "C:xamppapachelogsapi.potatog.localhost-error.log"
      CustomLog "C:xamppapachelogsapi.potatog.localhost.access.log" combined
    </VirtualHost>

    参考:

    https://www.cnblogs.com/phonecom/p/6363268.html

  • 相关阅读:
    涨知识| 在国内,如何顺利使用谷歌(转)
    css3网站收集
    淘宝客 新内容
    淘宝客工作计划
    淘宝客笔记
    java并发编程
    代理模式之远程代理
    动态代理
    模板方法模式
    Spring整合web开发
  • 原文地址:https://www.cnblogs.com/potatog/p/11027762.html
Copyright © 2011-2022 走看看