“Step-by-Step Guide to AQL htpasswd & htaccess Password Manager for Admins”

Step-by-Step Guide to AQL htpasswd & htaccess Password Manager for Admins

Overview

AQL htpasswd & htaccess Password Manager provides a streamlined way to create, manage, and deploy Apache basic-auth credentials for protected directories. This guide walks an admin through installation, creating users, integrating with virtual hosts, common maintenance tasks, and troubleshooting.

Prerequisites

  • Shell access to the server (SSH).
  • Apache (httpd) installed and running.
  • Basic familiarity with command line and file permissions.
  • AQL htpasswd & htaccess Password Manager package (assume package name aql-htpasswd or similar).

1. Install the tool

  1. Update package lists:

    Code

    sudo apt update
  2. Install required dependencies (example for Debian/Ubuntu):

    Code

    sudo apt install apache2-utils git
  3. Clone or install AQL manager (example using Git):

    Code

    git clone https://example.com/aql-htpasswd.git /opt/aql-htpasswd cd /opt/aql-htpasswd sudo ./install.sh
  4. Verify the tool is installed:

    Code

    /opt/aql-htpasswd/aql-htpasswd –help

2. Create an htpasswd file and add users

  1. Choose a secure location for your htpasswd file, outside webroot, e.g., /etc/apache2/.htpasswd.
  2. Create the file and add the first user:

    Code

    sudo htpasswd -c /etc/apache2/.htpasswd alice

    Enter a strong password when prompted.

  3. Add additional users (omit -c to avoid overwriting):

    Code

    sudo htpasswd /etc/apache2/.htpasswd bob
  4. Verify file contents (hashed passwords only):

    Code

    sudo cat /etc/apache2/.htpasswd

3. Configure .htaccess to require authentication

  1. Enable per-directory overrides in your Apache site config (if disabled). In the relevantblock:

    Code

    AllowOverride All
  2. Reload Apache:

    Code

    sudo systemctl reload apache2
  3. Create a .htaccess file inside the protected directory (/var/www/html/secure/.htaccess):

    Code

    AuthType Basic AuthName “Restricted Area” AuthUserFile /etc/apache2/.htpasswd Require valid-user
  4. Test by visiting the protected URL in a browser; you should be prompted for credentials.

4. Integrate with Apache virtual hosts (alternative)

Instead of .htaccess, add authentication directly to the virtual host for better performance:

Code

ServerName example.com

DocumentRoot /var/www/html/secure <Directory /var/www/html/secure>     AuthType Basic     AuthName "Restricted Area"     AuthUserFile /etc/apache2/.htpasswd     Require valid-user </Directory> 


Reload Apache after changes:

Code

sudo systemctl reload apache2

5. Manage users with the AQL manager (typical commands)

  • Add a user (tool wrapper around htpasswd): “` sudo /opt/aql

Comments

Leave a Reply