Apache user authentication

Source: Internet
Author: User

For example: We have some sensitive data on our website that can't be seen, and we can see that we have to encrypt the data.

[[email protected] www]# mkdir ABC Create a Directory

[[Email protected] www]# CD ABC

[[email protected] abc]# cp/etc/passwd./12.txt copy files to do a test

650) this.width=650; "src=" Http://s5.51cto.com/wyfs02/M00/7D/59/wKioL1bmk4LR58dFAABXwvqu_zQ260.png "style=" float: Left; "title=" 1 "alt=" Wkiol1bmk4lr58dfaabxwvqu_zq260.png "/>
















Encryption authentication for users

[[email protected] abc]# vim/usr/local/apache2/conf/extra/httpd-vhosts.conf Add custom to the main configuration file

<virtualhost *:80>

DocumentRoot "/data/www"

ServerName www.test.com

Serveralias www.aaa.com

# errorlog "Logs/dummy-host.example.com-error_log"

# customlog "Logs/dummy-host.example.com-access_log" common

<Directory/data/www/abc/>

AllowOverride authconfig

AuthName "Custom"

AuthType Basic

authuserfile/data/.htpasswd

Require Valid-user

</Directory>

Set encryption

[Email protected] abc]#/usr/local/apache2//bin/htpasswd-c/data/.htpasswd user1

New Password:

Re-type New Password:

Adding Password for user user1

If you still need to continue creating, remove-C

Check that the configuration file is correct

[Email protected] abc]#/usr/local/apache2/bin/apachectl-t

Syntax OK

Reload

[Email protected] abc]#/usr/local/apache2/bin/apachectl Graceful

Effects after the entry into force

650) this.width=650; "Src=" Https://app.yinxiang.com/shard/s53/res/d10e1c6c-41ae-4d1b-8724-fb330423dc48.png? search=apache%e7%94%a8%e6%88%b7%e8%ae%a4%e8%af%81 "alt=" Apache user Authentication "name=" d10e1c6c-41ae-4d1b-8724-fb330423dc48 " class= "En-media" style= "Margin:.857412em 0px 1.286em;padding:0px;border:0px;height:auto;"/>


This article is from "Mr Guo" blog, declined reprint!

Apache user authentication

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.