zoukankan      html  css  js  c++  java
  • apache配置多站点(windows环境)

    配置虚拟站点方法

    1.修改httpd.conf文件:在配置文件最下方加上如下配置。

    VIrtualHost内配置127开头的其他ip(127开头均为本机)

    DocumentRoot指向项目目录

    Servname网站访问域名,公网是自己注册的域名,本机环境时可以任意编写,记得配置hosts文件将此域名指向配置ip

    ErrorLog,CustomLog,错误日志,可不配置

    Directory配置项目访问权限

    <VirtualHost 127.0.0.2:80>
        DocumentRoot d:/AppServ/www2
        ServerName demo.www2.com
        ErrorLog logs/www2-error.log
        CustomLog logs/www2-access.log common
    </VirtualHost>
    
    <Directory "d:/AppServ/www2">
        Options Indexes FollowSymLinks Multiviews
        AllowOverride All
        Order Allow,Deny
        Allow from all
    </Directory>

    2.修改httpd-vhosts.conf ,在httpd.conf文件同级目录extra下面

      在httpd.conf下面找到  Virtual hosts 配置,取消注释

      在httpd-vhosts.conf 中添加

    <VirtualHost *:80>
        DocumentRoot "d:/AppServ/www2"
        ServerName demo.www2.com
        ErrorLog "logs/www2-error.log"
        CustomLog "logs/www2-access.log" common
    </VirtualHost>
    配置同方法1。推荐此种方法,配置文件统一便于管理。


    配置虚拟站点有3中方式

    1.同ip不同域名:例2

    2.不同ip配置:例1

    3.多端口配置:拷贝http.conf,新建配置文件,见http://www.jb51.net/article/22979.htm,未亲自测试



  • 相关阅读:
    PING机制
    二叉树基本概念
    哈希表
    各种排序算法的利弊
    Linux的目录文件权限问题
    Redhat 7 安装Samba服务
    Redhat7 搭建vsftpd(三种方式登录)
    Redhat7 Firewalld防火墙
    将Nginx加入service服务中
    Nginx优化
  • 原文地址:https://www.cnblogs.com/y0umer/p/3838876.html
Copyright © 2011-2022 走看看