美文网首页APACHE
4.HTTPD配置文件范例

4.HTTPD配置文件范例

作者: Stone_説 | 来源:发表于2020-08-04 00:49 被阅读0次

    配置文件

    [root@node03 ~]# grep -v "^ *#" /etc/httpd/conf/httpd.conf 
    ServerRoot "/etc/httpd"
    Listen 80
    Include conf.modules.d/*.conf
    User apache
    Group apache
    ServerAdmin root@localhost
    <Directory />
        AllowOverride none
        Require all denied
    </Directory>
    DocumentRoot "/var/www/html"
    <Directory "/var/www">
        AllowOverride None
        Require all granted
    </Directory>
    <Directory "/var/www/html">
        Options Indexes FollowSymLinks
        AllowOverride None
        Require all granted
    </Directory>
    <IfModule dir_module>
        DirectoryIndex index.html
    </IfModule>
    <Files ".ht*">
        Require all denied
    </Files>
    ErrorLog "logs/error_log"
    LogLevel warn
    <IfModule log_config_module>
        LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
        LogFormat "%h %l %u %t \"%r\" %>s %b" common
        <IfModule logio_module>
          LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" %I %O" combinedio
        </IfModule>
        CustomLog "logs/access_log" combined
    </IfModule>
    <IfModule alias_module>
        ScriptAlias /cgi-bin/ "/var/www/cgi-bin/"
    </IfModule>
    <Directory "/var/www/cgi-bin">
        AllowOverride None
        Options None
        Require all granted
    </Directory>
    <IfModule mime_module>
        TypesConfig /etc/mime.types
        AddType application/x-compress .Z
        AddType application/x-gzip .gz .tgz
        AddType text/html .shtml
        AddOutputFilter INCLUDES .shtml
    </IfModule>
    AddDefaultCharset UTF-8
    <IfModule mime_magic_module>
        MIMEMagicFile conf/magic
    </IfModule>
    EnableSendfile on
    IncludeOptional conf.d/*.conf
    
    servername test.stone.com
    servertokens prod
    KeepAliveTimeout 20
    StartServers 2000
    MinSpareservers 2000
    MaxSpareservers 2000
    ServerLimit 2560
    MaxRequestsPerChild 40000
    MaxClients 256
    DocumentRoot "/data/html"
    <Directory "/data/html">
        Require all granted
        #Options Indexes FollowSymLinks
        AllowOverride All
    </Directory>
    
    #<directory /data/html/admin>
    #AuthType Basic
    #AuthName "Admin Page"
    #AuthUserFile "/etc/httpd/conf.d/.httpuser"
    #Require user stone
    #Require valid-user
    #</directory>
    
    #<Files "*.conf">
        #Require all denied
    #</Files>
    #<Filesmatch "\.conf$">
        #Require all denied
    #</Filesmatch>
    
    #alias /bbs/ /app/forum/
    #<Directory "/app/forum">
        #Require all granted
    #</Directory>
    
    #<directory /data/html/beijing>
    #<requireall>
        #Require all granted
        #Require not ip 192.168.177.0/24
    #</requireall>   
    #</directory>
    

    相关文章

      网友评论

        本文标题:4.HTTPD配置文件范例

        本文链接:https://www.haomeiwen.com/subject/xhturktx.html