zoukankan      html  css  js  c++  java
  • Apache设置二级域名和虚拟主机

    apache  httpd.conf 最后:

    ------------------------------
    NameVirtualHost *:80
    <VirtualHost *:80>
        ServerName  localhost
        DocumentRoot "D:/www"
    </VirtualHost>

    <Directory "D:/www" >
        Options FollowSymLinks
        AllowOverride All
        Order allow,deny
        Allow from all
    </Directory>

    NameVirtualHost *:80
    <VirtualHost *:80>
        ServerName  www.a.com
        DocumentRoot "D:/www/plat"
    </VirtualHost>

    <Directory "D:/www/plat" >
        Options FollowSymLinks
        AllowOverride All
        Order allow,deny
        Allow from all
    </Directory>

    -----------------------------
    【备注】
    Options FollowSymLinks 表示不列出目录下的文件,如果要列出文件列表,则使用  Options Indexes FollowSymLinks
    -----------------------------

    C:WindowsSystem32driversetc 目录下  hosts文件中:
    最后添加一行:
    127.0.0.1   www.a.com
    --------------------------------
    Ubuntu 系统下,是在 /etc/hosts 文件中
    --------------------------------

    此时访问 www.a.com 即可 访问 D:/www/plat 项目了。
    备注:这里也可以设置 www.a.com 为 www.baidu.com,本地访问www.baidu.com 就可以访问本地的这个项目了。
    【本地路由优先!】

  • 相关阅读:
    二十四 多重继承
    二十三 使用@property
    Tornado 协程
    基于协程的Python网络库gevent
    用greenlet实现Python中的并发
    在Nginx上配置多个站点
    python 使用Nginx和uWSGI来运行Python应用
    在Apache中运行Python WSGI应用
    Python打包分发工具setuptools
    Python 远程部署 Fabric
  • 原文地址:https://www.cnblogs.com/rxbook/p/5993357.html
Copyright © 2011-2022 走看看