zoukankan      html  css  js  c++  java
  • Centos7.6 Apache 虚拟机禁止访问IP,允许访问多域名多个虚拟目录设置

    存放配置文件路径 /etc/httpd/conf.d
    自定义命名,配置文件后缀格式确保 *.conf
    注:这是两个配置文件,也是两种方法。

    # 一个WEB目录
    # 禁止以IP地址形式访问
    <VirtualHost 192.168.8.129> ServerName 192.168.8.129 <Location /> Order Allow,Deny Deny from all </Location> </VirtualHost>
    # 允许通过域名形式访问,指定路径 <VirtualHost 192.168.8.129> DocumentRoot /var/www/html/nav.jackcui.com/ ServerName nav.jackcui.com </VirtualHost>
    # 多个虚拟目录
    # 禁止以IP地址形式访问
    <VirtualHost 192.168.8.129> ServerName 192.168.8.129 <Location /> Order Allow,Deny Deny from all </Location> </VirtualHost> # 允许通过域名形式访问,多个虚拟指定路径
    <VirtualHost 192.168.8.129> Alias /lam /usr/share/ldap-account-manager Alias /phpldapadmin /usr/share/phpldapadmin/htdocs Alias /ldapadmin /usr/share/phpldapadmin/htdocs Alias /pwd /var/www/html
    <Directory /usr/share/ldap-account-manager> Options +FollowSymLinks AllowOverride All Require all granted DirectoryIndex index.html </Directory>

    <Directory /var/lib/ldap-account-manager/tmp> Options -Indexes </Directory>
    <Directory /var/lib/ldap-account-manager/tmp/internal> Options -Indexes Require all denied </Directory>
    <Directory /var/lib/ldap-account-manager/sess> Options -Indexes Require all denied </Directory>
    <Directory /var/lib/ldap-account-manager/config> Options -Indexes Require all denied </Directory>
    <Directory /usr/share/ldap-account-manager/lib> Options -Indexes Require all denied </Directory>
    <Directory /usr/share/ldap-account-manager/help> Options -Indexes Require all denied </Directory>
    <Directory /usr/share/ldap-account-manager/locale> Options -Indexes Require all denied </Directory> <Directory /usr/share/phpldapadmin/htdocs> <IfModule mod_authz_core.c> # Apache 2.4 Require all granted </IfModule>
    #
    <IfModule !mod_authz_core.c> # Apache 2.2 # Order Deny,Allow # Deny from all # Allow from 127.0.0.1 # Allow from ::1 # </IfModule> </Directory>
    ServerName ldap.jackcui.com
    </VirtualHost>
  • 相关阅读:
    #include <functional>
    3.3内联函数
    如何查看内存占用和运行速度
    属性和方法的动态绑定和限制
    __slots__节约空间
    函数进阶之一等对象
    python继承之super
    python的方法VSjava方法
    python面向对象基础(三)内置方法 __xx__
    python面向对象基础(二)反射
  • 原文地址:https://www.cnblogs.com/jackcui/p/11489100.html
Copyright © 2011-2022 走看看