zoukankan      html  css  js  c++  java
  • linux服务器上Apache配置多域名

    一, 打开httpd.conf

    二 找到如下三个位置配置如下

      DocumentRoot "/data"

      #以下这个配置是紧挨着的,有两个

      <Directory "/data">

      <Directory "/data">

    二, 底部添加配置如下

      <VirtualHost *:80>
      DocumentRoot "/data/index"
      ServerName hehexiaolang.top
      </VirtualHost>

    <VirtualHost *:80>
    DocumentRoot "/data/index"
    ServerName www.hehexiaolang.top
    </VirtualHost>

    <VirtualHost *:80>
    DocumentRoot "/data/admin"
    ServerName admin.hehexiaolang.top
    </VirtualHost>

    三, 重启apache

      1,首先找到apachectl

        find / -name apachectl

      2,在该目录下执行如下

        2.1 重启 apachectl restart

        2.2 关闭 apachectl stop

    四, 备注

     以上所示例的 "/data" 目录为我放代码的地方, 请根据自己的代码所在位置相应更改以上配置

  • 相关阅读:
    2018CodeM复赛
    poj3683
    bzoj3991
    bzoj2809
    bzoj1001
    bzoj1412
    计蒜之道2018复赛
    HDU2255
    bzoj1010
    bzoj2006
  • 原文地址:https://www.cnblogs.com/gz-fenglang/p/7873791.html
Copyright © 2011-2022 走看看