• 配置apache apache服务器如何配置多站点


    http://jingyan.baidu.com/article/5225f26b07605be6fa090890.html

    • 让Apache在启动时能加载虚拟主机模块。

      打开Apache安装目录下conf/httpd.conf文件,找到下面两行文字,把最前面的 # 号去掉,然后保存。

      #LoadModule vhost_alias_module modules/mod_vhost_alias.so

      #Include conf/extra/httpd-vhosts.conf   

       
    •  

      接着找到同一文件中的DocumentRoot和Directory,改为站点目录的上一级目录

      例如站点放在 D:/Appserv/www/1 和 D:/Appserv/www/2,则改为以下形式

      DocumentRoot"D:/Appserv/www"

      <Directory"D:/Appserv/www">

    •  

      配置完成后即可打开Apache安装目录下/conf/extra/httpd-vhosts.conf文件,在最后添加如下:

      DocumentRoot是文件放置路径,ServerName是网站域名:

      <VirtualHost*:80>

      DocumentRoot"D:/Appserv/www/1"

      ServerName  www.xxx.com

      </VirtualHost>

      <VirtualHost*:80>

      DocumentRoot"D:/Appserv/www/2"

      ServerName   www.xxx2.com

      </VirtualHost>

       
    •  

      最后重启Apache服务就配置完成。

       
    •  

      我个人配置阿帕奇的时候遇到过一个问题,就是比如我的网站www.stzjz.com

      直接输入域名打开的结果却是appserv界面

      如图所示:

       
    • 6

      我的解决办法是

      Apache安装目录下/conf/extra/httpd-vhosts.conf文件,在最后添加如下:

      <VirtualHost*:80>

      DocumentRoot"D:/Appserv/www"

      ServerName   127.0.0.1

      </VirtualHost>

  • 相关阅读:
    elementui:eltreenode
    Cesium+Vue
    TXT文件读写
    The Naked Kitchen
    0627realman
    信息: XML validation disabled
    跟踪加载图像
    加载和显示图像
    文件创建
    彩色图像转灰度图像
  • 原文地址:https://www.cnblogs.com/mazida6/p/5266708.html
Copyright © 2020-2023  润新知