zoukankan      html  css  js  c++  java
  • apache 多域名配置

    一直不明白apache多域名配置的问题,所以只能用不同的端口来配置,现在终于搞懂了一点

    首先,开启apache的vhost模块

    找到配置文件httpd.conf中的下面两行

    #LoadModule vhost_alias_module modules/mod_vhost_alias.so 

    ...

    #Include conf/extra/httpd-vhosts.conf

    去掉前面的注释#

    打开httpd-vhosts.conf文件,添加内容 (直接复制前面的VirtualHost标签,然后修改对应的内容就可以)

    <VirtualHost *:80>
    ServerAdmin webmaster@dummy-host.sun.cm //这个是自己填的无所谓
    DocumentRoot E:wampwww //所要配置的域名访问的根目录
    ServerName crm.a.cc //域名的名称,我自己配的是“a”
    ServerAlias crm.a.cc
    #AccessFileName web.config
    <Directory "E:wampwww">
    AllowOverride FileInfo
    Options Indexes Includes FollowSymLinks
    Order allow,deny
    Allow from all
    DirectoryIndex index.html index.php
    </Directory>
    </VirtualHost>

    最后,做一下重定向

    打开C:WindowsSystem32driversetchosts文件

    添加一行 

    192.168.1.102       a

    ok,配置结束

    现在可以打开浏览器测试一下,http://a/

  • 相关阅读:
    RabbitMQ-RPC版主机管理程序
    FTP
    主机管理程序
    高级FTP
    选课系统
    电子银行购物商城
    计算器
    员工信息查询系统
    工资管理系统
    三级菜单
  • 原文地址:https://www.cnblogs.com/sandea/p/3605149.html
Copyright © 2011-2022 走看看