Apache configuration - remain attached to the access control

Content Highlights:

1, Apache configuration analysis

Apache connections remain

Apache access control

A, Apache connecting and retaining

Apache holding connection parameters

KeepAlive

  • Whether the connection remains open, OFF closed, ON open

KeepAlive' Timeout

  • The maximum time interval between connecting multiple requests, the request this time is exceeded twice disconnected

MaxKeepAliveRequests

  • The maximum number of requests that can be transmitted once the connection

Two, Apache Access Control Overview

Apache access control

1, the role of

  • Control access to the site resources

  • Add access authorization for a particular Web site directories

2, commonly used access control

  • Client address restriction

  • User authorization restrictions

image.png


3, client-based access control address

  • Require the use of access control configuration items, according to the order restrictions

  • Useful in <Location>, <Directory>, <Files>, <Limit> configuration section

4 common grammar Require configuration items

<To place it <RequireALL> not prohibit the use of access </ RequireALL> container and to develop appropriate restriction policy in a container>

All qranted the Require    
the Require All denied 
the Require local 
the Require [not] <hostname or domain name list> Host 
the Require ip <IP address or network List> [not]

[Root @ localhost ~] # vim // virtual host configuration /etc/httpd/conf/httpd.conf/vhost.conf configuration files, configuring the blacklist, set access permissions

image.png

image.pngimage.png


Third, the user authorization restrictions

1, create a user authentication database

[root @ www ~] # htpasswd -c / etc / httpd / conf / pwd webadmin create a user authentication database 
New password: 
Re-of the type new new password: 
Adding password for the User WebAdmin 
[the WWW root @ ~] # CAT / etc / httpd / conf / pwd view the settings circumstances 
webadmin: $ apr1 $ UENqa9TA $ k / 6Kb.IhlKdQ6QVTxsZs1

image.png

2, add user authorization configuration

[root @ www ~] # /etc/ttpd/conf/httpd.conf adding configure user authorization vim 
<Directory "/ usr / local / the httpd / the htdocs"> 
...... 
the AuthName "the DocumentRoot" 
AuthType Basic 
the AuthUserFile / etc / the httpd / the conf / pwd 
the Require-User Valid 
</ Directory> 
[the root WWW @ ~] # systemctl the restart restarting the httpd service

image.png

image.png

Guess you like

Origin blog.51cto.com/14475876/2444647