Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Cloud Computing Learning Route syllabus Class Notes: Apache access Control

2025-04-02 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/02 Report--

Cloud Computing Learning Route syllabus Class Notes: Apache access Control:

=

I. types of directory access control

Set catalog properties

Host-based

Based on user

Host-based access control

Prepare the environment

[root@aliyun ~] # rm-rf / var/www/edusoho/web/download/*

[root@aliyun ~] # echo "download." > / var/www/edusoho/web/download/1.html

For http 2.4 + only

Case 1: allow all hosts to acc

AllowOverride None

Require all granted

AllowOverride All allows settings in .htaccess in the subdirectory to override the current setting

AllowOverride None does not allow settings in .htaccess in subdirectories to override the current settings.

Case 2: only allow access to the network segments 192.168.5.0 Universe 24 and 192.168.10.0Uniplic24

AllowOverride None

Require ip 202.106.0.0/24

Require ip 114.248.160.203

Case 3: deny access to only certain hosts

AllowOverride None

Require not ip 114.248.160.203

Require all granted

III. User-based access: user name and password are required for access

= = use unformatted text files

Create a password file

[root@tianyun ~] # htpasswd-cm / etc/httpd/conf/webpasswd user1

New password: enter password

Re-type new password: enter the password again

Adding password for user user1

-c create

-m MD5

[root@tianyun ~] # cat / etc/httpd/conf/webpasswd

User1:$apr1 $tkLV4/..$BL2nd2Wbx4I5ZAf5uv8ZS.

[root@tianyun] # htpasswd-m / etc/httpd/conf/webpasswd user2

Configuration supports authentication

AllowOverride None

Require all granted

AuthType Basic

AuthName "welcome to tianyun.me..."

AuthUserFile / etc/httpd/webpasswd

Require valid-user

IV. Access control for files

Execution of .php files in the / var/www/edusoho/web/upload directory is not allowed

AllowOverride None

Require all granted

Order allow,deny

Deny from all

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report