Web site Services (ii)

Source: Internet
Author: User

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)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.