zoukankan      html  css  js  c++  java
  • LHEL6 配置apache基于域名的虚拟主机

        apache有两种虚拟主机,一种是基于ip的,一直是基于域名的。

        基于域名的虚拟主机允许多个域名共用一个ip地址。

        今天在配置虚拟主机的时候遇见如下问题,http.conf配置的都正确,内容如下:

      

       将NameVirtualHost *:80 的注释去掉。
     <VirtualHost *:80>
        ServerAdmin root@localhost
        DocumentRoot /www/virtual
        ServerName station.domain40.example.com
    </VirtualHost>
    <VirtualHost *:80>
        ServerAdmin root@localhost
        DocumentRoot /www/virtual1
        ServerName www.domain40.example.com
    </VirtualHost>
     
    感觉配置的没有问题,后来好长时间发现是selinux的关系,查看apache的selinux配置文件
    man httpd_selinux
     
    设置 /www/virtual的selinux上下文
    执行命令:
    chcon -R -t http_sys_content_t /www/virtual/index.html
    查看/www/virtual/index.html的上下文
    ls -Z /www/virtual/index.html
    即可。。
     
     
     
  • 相关阅读:
    epoll oneshot
    回望五月
    都知道的copy_from_user
    ixgbe 驱动 为xxx驱动做准备1
    面试问题集锦
    数据治理
    阅读
    hive 数据仓库面试题目集锦
    面试小问题集锦
    Scala学习笔记~尚硅谷学习视频
  • 原文地址:https://www.cnblogs.com/fantiantian/p/3025354.html
Copyright © 2011-2022 走看看