zoukankan      html  css  js  c++  java
  • Apache配置虚拟目录,以及各种操作

    apache配置虚拟目录:

    打开并创建虚拟目录的步骤如下:

    # Virtual hosts

    # Include conf/extra/httpd-vhosts.conf

    去掉conf/http.conf文件中:

    #Include conf/extra/httpd-vhosts.conf

    前面的"#" (实际上是去掉注释) ,

    若果想要配置多个虚拟目录的话,在httpd.conf中搜索“ NameVirtualHost ” ,如果没有的话加上一句:NameVirtualHost *:80

    NameVirtualHost *:80
    #NameVirtualHost localhost:8001
    <VirtualHost *:80>
     ServerName *
     DocumentRoot "E:/APMserv/APMServ5.2.6/www/htdocs"
    <Directory "E:/APMserv/APMServ5.2.6/www/htdocs">
     Options FollowSymLinks IncludesNOEXEC Indexes
     DirectoryIndex index.html index.htm default.htm index.php default.php index.cgi default.cgi index.pl default.pl index.shtml
     AllowOverride None
     Order Deny,Allow
     Allow from all
    </Directory>
    </VirtualHost>

    然后若conf下面没有extra/http-vhosts.conf这个文件则创建,最后在里面添加如下代码:

    <VirtualHost *:80>
       ServerAdmin  zhangpengdzs@adsit.cn
       DocumentRoot "E:APMservAPMServ5.2.6wwwhtdocsphpWeiXinAppLivingartistAppwww"
       ServerName my.phpwxapp.com
       # This should be omitted in the production environment
       SetEnv APPLICATION_ENV development
       <Directory "E:APMservAPMServ5.2.6wwwhtdocsphpWeiXinAppLivingartistAppwww">
           Options Indexes MultiViews FollowSymLinks
           AllowOverride All
           Order allow,deny
           Allow from all
       </Directory>   
    </VirtualHost>

    <VirtualHost *:80>
       ServerAdmin  zhangpengdzs@adsit.cn
       DocumentRoot "E:APMservAPMServ5.2.6wwwhtdocssolomowww estphp"
       ServerName my.phptest.com
       # This should be omitted in the production environment
       SetEnv APPLICATION_ENV development
       <Directory "E:APMservAPMServ5.2.6wwwhtdocssolomowww estphp">
           Options Indexes MultiViews FollowSymLinks
           AllowOverride All
           Order allow,deny
           Allow from all
       </Directory>   
    </VirtualHost>

    表示添加了  my.phpwxapp.com   和 my.phptest.com 两个虚拟域名,最后在 系统C盘下面找到hosts文件,

    在里面添加:

    127.0.0.1 my.phpwxapp.com

    127.0.0.1       my.phptest.com 

    最后重启Apache服务应该就可以了。

    Apache多站点多IP配置:http://blog.chinaunix.net/uid-18933439-id-2808715.html

  • 相关阅读:
    JSTL日期格式化用法
    JSTL详解1
    Mybatis插入后返回主键
    JSTL详解2
    jsp与jsp之间传参数如何获取
    [转] J2EE面试题集锦(附答案)
    [转] 修炼一名程序员的职业水准(林庆忠原创)
    [转] 应聘Java笔试时可能出现问题及其答案(第三部分)
    [转] 与大家一起分享JAVA源代码查询网站
    [转] 应聘Java笔试时可能出现问题及其答案(第四部分)
  • 原文地址:https://www.cnblogs.com/andydao/p/3560032.html
Copyright © 2011-2022 走看看