Access Control for 1.HTTPD services
Role:? Controlling access to site resources
Add access authorizations for a specific site directory
Common Access control methods:
Client Address Restrictions
User Authorization Restrictions
2. Access control based on client address:
Can control:? IP address, network address, domain name, host name
Order configuration item, defining the control order:
Allow after deny (reject first)? Default Deny all:? Order?allow deny
Allow all to be allowed by default (allow first):? Order?deny allow
Allow,deny configuration items, set the allowed or denied addresses:
Allow from Addressl Address2
Deny from Address1 Address2
Cases:? Deny?from?192.168.0.0/24?192.168.1.0/24
3. User authorization Limit
Create a user authentication database:? Command:? htpasswd
Cd?/usr/local/httpd
Bin/htpsswd?-c/usr/local/httpd/conf/.123?hanming
First add users need-C? (lowercase), from creating a second user cannot add-c, otherwise it will overwrite
Add User authorization Configuration
Vim/usr/local/httpd/conf/httpd.conf
<directory "/usr/local/awstats/wwwroot" >
AuthName? " Awstats?directory
Authtype?basic
Authuserfile?/usr/local/httpd/conf/.123
Require?valid-user or user username
4. Build a virtual host:? Run multiple Web sites on the same server
HTTPD supported virtual host types:
Domain-based virtual host
IP address-based virtual host
Virtual host based on port number
5. Building a domain-based virtual host
Provide domain name resolution for false host: multiple domain names correspond to the same IP
Prepare different Web documents for each virtual host
Mkdir?/usr/local/httpd/htdocs/benet
Echo? " Index.html
Add a virtual host configuration
Vim?/usr?/local/httpd/conf/extra/httpd-vhosts.conf
namevirtualhost?192.168.1.100
<Virtualhost?192.168.1.100>
Documentroot?/usr/local/httpd/htdocs/benet
ServerName www.benet.com
</VirtualHost>
Open httpd-vhosts.conf comments in master profile httpd.conf and restart service
Web site Services (ii)