password protect – Webuzo https://www.webuzo.com Multiuser Hosting Control Panel Thu, 15 Feb 2024 06:42:01 +0000 en-US hourly 1 https://sitepad.com/?v=5.1.6 https://www.webuzo.com/sitepad-data/uploads/2021/10/cropped-webuzo_icon_64-32x32.png password protect – Webuzo https://www.webuzo.com 32 32 Password Protecting Directory with Webuzo https://www.webuzo.com/blog/password-protecting-directory-with-webuzo/ Thu, 23 Jan 2014 14:12:47 +0000 http://www.webuzo.com/blog/?p=2093 Continue reading "Password Protecting Directory with Webuzo"]]> Protecting files on your website from unauthorized users can add a layer of security to your website. This can be done in various ways, one of them is using the .htaccess and .htpasswd files to accomplish the task.

Password protecting a directory on your site is actually fairly easy. Webmasters typically want to protect a directory if they have information that they want to make available only to a selected number of people.

This guide will help you to password protect your directories over the web.
Since, this feature is not available by default in Webuzo, a few tweaks and you should be all set to implement this functionality.

Oh!! it’s easy too!

The system requires two files
1) the .htaccess file
2) the .htpasswd file

Getting Started

Step 1) Enable the required modules in Apache (disabled by default in Webuzo)

Edit the file /usr/local/apps/apache/etc/httpd.conf and uncomment the following lines

LoadModule authz_user_module modules/mod_authz_user.so

LoadModule authn_file_module modules/mod_authn_file.so

LoadModule auth_basic_module modules/mod_auth_basic.so

Restart the Apache service for the changes to take effect
Root > service httpd restart

Step 2) The .htaccess file
Add the .htaccess file to the directory you wish to protect

AuthType Basic
AuthName "restricted area"
AuthUserFile /home/soft/public_html/dir_to_protect/.htpasswd
require valid-user

Replace the line /home/soft/public_html/dir_to_protect/ with the path to the directory you wish to password protect

Save the .htaccess file

Step 3) The .htpasswd file
This file is required to hold the username:password combination for the directories to be accessible.

Execute the following command to create the name:value password pair.

Root > /usr/local/apps/apache/bin/htpasswd -c /home/soft/public_html/dir_to_protect/.htpasswd testuser

Follow instructions to set the password for the same.

Access the directory from the browser and you should be prompted for a username and password.

That’s it !!! Simple eh ?

View the logs for other issues:
/usr/local/apps/apache/logs/

Support : https://www.softaculous.com/support/open.php?

Demo :
Admin Panel : http://demo.webuzo.com/
Enduser Panel : http://demo.webuzo.com/enduser/

]]>