Home WebServer PanelDirectAdmin Protect directory on DirectAdmin

Protect directory on DirectAdmin

by Thạch Phạm
Published: Last Updated on
A+A-
Reset

In this tutorial, AZDIGI will show you how to protect directories on DirectAdmin by requiring access authentication.

I. Introduction

When developing a website, there may be a need to create for visitors a directory containing resources that they can access and download. However, when accessing, visitors must have login information to be able to enter.

Or simply, if you want someone to access the http://domain.com/wp-admin path, they must go through the verification step before logging in.

This will make your folders more secure and can only be accessed by authorized people.

II. How to enable directory protection on DirectAdmin

To enable directory protection on DirectAdmin, we need to do the following 2 steps. Particularly step 3 will be for directories without the file index.html/index.php

Step 1: Login to DirectAdmin

To login to DirectAdmin, you access the following path:

AZDIGI Tutorial
http://IP:2222
    

Remember to replace the IP with your DirectAdmin server IP address.

Below is my DirectAdmin interface:

how-to-use-file-manager-on-directadmin
DirectAdmin interface at the user level

We continue to step 2 to enable the directory protection function on DirectAdmin.

Step 2: Enable directory protection on DirectAdmin

First, we access the System Info & Files feature => select File Manager to access this feature.

how-to-use-file-manager-on-directadmin
File Manager feature location on DirectAdmin.

Next, visit the website’s source code directory. For example, I have created a directory calledtailieuhoctap.

and in this directory, I have prepared some files.

image 72

Go back to the website directory, right-click on this directory and select Protect.

how-to-protect-directory-on-directadmin
Protect directory on DirectAdmin.

You can set any information in the Name, User, Password section and save the User/Password information to avoid loss => click PROTECT to protect this directory.

how-to-protect-directory-on-directadmin
Giao diện tính năng bảo vệ thư mục trên DirectAdmin.

After that, you can access the link http://domain.com/tailieuhoctap/ to check if the directory protection feature on DirectAdmin is working. If you are asked for access information as shown below, you are successful.

how-to-protect-directory-on-directadmin
Accessing the protected directory will require authentication of credentials

However, when you log in and you get a message that you are not allowed to access, please continue to step 3.

AZDIGI Tutorial
Forbidden
You don't have permission to access this resource.
    

Step 3: Enable displaying files in the website directory

AZDIGI has a detailed tutorial on enabling displaying files in the website directory, you can refer to the details at the following link:

I will briefly guide you as follows:

  • 1. Use the File Manager to enter the directory with the protection feature.
  • 2. Initialize a file named .htaccess with the content inside is Options +Indexes.
  • 3. Save and reaccess the link.

Here is my result. all files in this directory are fully displayed after the user successfully authenticates access.

how-to-protect-directory-on-directadmin

III. Disable directory protection on DirectAdmin

To disable this feature, you just need to access the .htaccess file in this folder and delete the content circled in green below:

how-to-protect-directory-on-directadmin

IV. Summary

With just 2 steps, you can successfully protect the directory on DirectAdmin. You completely protect the wp-admin directory for your WordPress website to create an extra step in securing the website’s login.

Hope this article will be of help to you. Wishing you success!

See more useful articles about DirectAdmin at the following link:

If you need assistance, you can contact support in the ways below:

Đánh giá

Tham gia nhóm hỗ trợ Server - Hosting

Tham gia nhóm Hỗ trợ Server - Hosting & WordPress để cùng nhau hỏi đáp và hỗ trợ các vấn đề về WordPress, tối ưu máy chủ/server.

Tham gia ngay

Bài viết cùng chuyên mục

AZDIGI – Không chỉ là đơn vị hàng đầu trong lĩnh vực Web Hosting và Máy chủ, chúng tôi mong muốn mang lại những kiến thức bổ ích nhất và luôn cập nhật thường xuyên cho cộng đồng người đam mê thiết kế website, công nghệ,…

Vui lòng không sao chép nội dung nếu chưa xin phép. Designed and Developed by PenciDesign