Apache server introduction user authentication simple configuration plan set

Source: Internet
Author: User
Apache is a popular Web server that runs on linux, Unix, Windows, and other control systems. it can effectively solve the "user name + password" authentication title. There are two different storage methods for the user name and password required for Apache user authentication:

Apache is a popular Web server that runs on linux, Unix, Windows, and other control systems. it can effectively solve the "user name + password" authentication title. The username and password required for Apache user authentication are stored in two different ways: text files and databases such as MSQL, Oracle, and MySQL. The following uses Apache in Linux as an example to describe the two storage methods and briefly describe Apache user authentication in Windows. Next, let's take a look at the methods implemented through text authentication.

Three steps are required to establish user authentication and authorization:

1. create a user Library

2. configure the protection domain of the server

3. tell the server which users have access permissions for resources

Few blank talk examples are the most clear !~ Assume that user authentication is required for files in a directory such as/home/ftp/pub.

Create authenticated user

   
    @htpasswd –c /*/.password xuanfei
   

Create an authentication group

   
    @vi /*/.groupxuanfei-group:xuanfei xuanfei1
   

Basic Apache user authentication methods:

Enter the following line in httpd. conf.

   
    <>options indexes followsymlinksallowoverride authconfigorder allow,denyallow from all<>
   

Or add/etc/httpd/conf. d/to create a configuration file named. conf.

   
    〈Directory /home/ftp/pub>Options IndexesAllowOverride AuthConfigorder allow,denyallow from all〈/Directory>
   

Use it in the/home/ftp/pub directory to place the file. htaccess. the content is as follows:

   
    
Authname 'shared Files' authtype basicauthuserfile/*/. passwordrequire valid-user # require group xuanfei-group // receiving group so user # requirre user xuanfei // receive xuanfei single user
   

Use the program htpasswd along with Apache to generate the/etc/. passwd file. each line has one user name: password.

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.