Apache Server user authentication (1)

Source: Internet
Author: User
Tags implement access linux
Readers of apache| servers often experience this situation: when accessing certain resources of some Web sites, the browser pops up a dialog box asking for a username and password to gain access to the resource. This is a technology of user authentication. User authentication is the first line of defense to protect network system resources, it controls all login and check the legality of access users, the goal is to allow legitimate users to access the network system resources with legitimate privileges. The basic user authentication technology is "username + password". Apache is the current popular Web server, can run in Linux, Unix, Windows and other operating systems, it can well solve the "username + password" authentication problem. The user name and password required for Apache authentication are stored in two different ways: one is a text file and the other is a database of mSQL, Oracle, and MySQL. The following is the example of the Linux Apache, the two storage methods, respectively, describes how to implement the user authentication function, while the Apache user authentication for Windows is briefly described. After Apache initiates the authentication function, it is possible to create a file named. htaccess in the directory that requires restricted access, specifying the authenticated configuration command. When a user accesses a file for that directory for the first time, the browser displays a dialog box asking for a user name and password to confirm the user's identity. If the legitimate user, then display the content of the page visited, then access each page of the directory, the browser automatically sent the user name and password, no longer entered, until the browser is closed. The following are the steps to implement: Root into Linux, assuming that Apache 1.3.12 has been compiled and installed into the/usr/local/apache directory. By default, when you compile Apache, you automatically join the Mod_auth module, which enables you to implement the authentication function of "username + password" With text file as storage mode. 1. Modify Apache configuration file/usr/local/apache/conf/httpd.conf, set configuration commands for the directory where the authentication resources reside. Among them, the allowoverride authconfig line allows for user authentication of files under the/usr/local/apache/htdocs/members directory.

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.