Apache user authentication, domain jump, Apache access log

Source: Internet
Author: User
Tags apache access log

User authentication for Apache

vim/usr/local/apache2.4/conf/extra/httpd-vhosts.conf//The 111.com virtual host is edited into the following content

<virtualhost *:80>
DocumentRoot "/data/wwwroot/111.com"
ServerName 111.com
Serveralias www.example.com
<Directory/data/wwwroot/111.com>
AllowOverride authconfig
AuthName "111.com User auth"
AuthType Basic
authuserfile/data/.htpasswd
Require Valid-user
</Directory>
Errorlog "Logs/111.com-error_log"
Customlog "Logs/111.com-access_log" common
</VirtualHost>







Apache Authentication for individual files

vim/usr/local/apache2.4/conf/extra/httpd-vhosts.conf//The 111.com virtual host is edited into the following content

<virtualhost *:80>
DocumentRoot "/data/wwwroot/111.com"
ServerName 111.com
Serveralias www.example.com
<filesmatch 123.php>
AllowOverride authconfig
AuthName "111.com User auth"
AuthType Basic
authuserfile/data/.htpasswd
Require Valid-user
</FilesMatch>
Errorlog "Logs/111.com-error_log"
Customlog "Logs/111.com-access_log" common
</VirtualHost>



Domain Jump






Access logs for Apache






Apache user authentication, domain jump, Apache access log

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.