Crashes, No Sound, or Screen Glitches?
Random freezes, missing sound and display glitches usually trace back to one bad driver. Find and replace yours safely.Free scan · under a minuteWindows Errors? Fix Them Before They Spread
Repair common Windows errors and clear accumulated junk for a smoother, more stable PC - no reinstall needed.Free scan · no reinstallTo password-protect an Apache directory on Ubuntu, install apache2-utils, create an .htpasswd file outside the web root, and add Apache Basic Authentication directives in the matching virtual-host or <Directory> block. If you use .htaccess, the enclosing directory must allow authentication overrides with AllowOverride AuthConfig. Always serve the protected URL over HTTPS: Apache Basic Authentication sends the password from the client to the server without encryption, so HTTP alone does not protect credentials in transit.
Need a server to try this on? Antihost offers Linux VPS plans with NVMe storage, full root access and a 14-day free trial.
What Apache Basic Authentication does
Apache Basic Authentication places a username-and-password challenge in front of a URL path. When a client requests a protected resource without credentials, Apache returns HTTP 401 Unauthorized together with a challenge. A browser then displays a login dialog, while a command-line client can send credentials explicitly. Apache checks the submitted username and password against a flat credential file created and maintained with htpasswd. If the credentials are accepted and the authorization rule allows the account, Apache serves the resource.
As an Amazon Associate I earn from qualifying purchases.
The mechanism has two separate parts:
- Authentication: Apache verifies the username and password using the file named by
AuthUserFile. - Authorization: A
Requiredirective decides which authenticated accounts may enter the directory.
The examples below protect /var/www/html/private and store credentials in /etc/apache2/.htpasswd. Substitute your actual document-root and directory paths. The credential file must not be inside the document root or any other URI space that Apache could serve to a browser.
Prerequisites and the right configuration scope
You need an Ubuntu server with Apache installed, administrative sudo access, and a directory that Apache serves through the virtual host handling the requested URL. Decide first whether to configure access centrally or delegate it to the directory owner.
#1 Best Overall
- [Ultra-Lightweight Ear Buds Designed for Small Ears] Each earbud weighs only 3.7g and features a compact, ergonomic in-ear design made especially for small ears. Secure, low-profile, and comfortable for workouts, all-day wear or overnight sleeping.The ultra-slim profile sits flush in your ear with no hard edges poking or rubbing, so you can even sleep on your side without discomfort.
- [Immersive Stereo Sound with TOZO OrigX Technology] TOZO OrigX tuning delivers clear vocals, balanced mids, and natural stereo sound for music, podcasts, and videos.
- [Long Battery Life for Daily Use] Get up to 7 hours of playtime on a single charge, with up to 32 hours total using the charging case—ideal for workdays, commuting, and extended listening sessions.
- [Bluetooth 5.3 & Stable Connection] Bluetooth 5.3 provides fast pairing, stable wireless performance, and reduced dropouts as you move around home or office.
- [Deep Bass with Clear Vocals] High-performance drivers produce punchy bass while keeping vocals clean and detailed for everyday listening.
- Virtual-host or
<Directory>configuration: the preferred administrative method. Authentication is defined in the active Apache configuration, where administrators can review and validate it centrally. .htaccessconfiguration: useful when per-directory delegation is intentional. It works only when the matching<Directory>block permits authentication overrides, and it adds another file that Apache must read and that operators must maintain.
Both methods use the same credential file and the same Basic Authentication directives. The difference is where Apache reads those directives and who controls them.
Install the htpasswd utility
Ubuntu ships htpasswd in the apache2-utils package. Update the package index and install it:
sudo apt update
sudo apt install apache2-utils
The package provides the utility used to create and modify flat files for HTTP Basic Authentication. The command should be available as htpasswd after installation.
Create a credential file outside the web root
Create the file once with -c, then omit -c when adding further accounts. For the example directory, run:
sudo htpasswd -c /etc/apache2/.htpasswd alice
Enter Alice’s password when prompted. The -c option means “create.” It is for the first account in a new file; using it again can replace the existing file and remove previously stored accounts.
Add another account without the creation option:
sudo htpasswd /etc/apache2/.htpasswd bob
This updates the existing file and prompts for Bob’s password. Repeat the same form for each additional user. Do not put the file under /var/www/html, under a subdirectory that Apache serves, or anywhere else in the server’s URI space. If a browser can request the file, its password records may be exposed.
Recommended Free Tools
Protect the file as a server credential asset. Keep ownership and permissions restrictive enough that only the administrators who manage access and the Apache process need to read it. The exact ownership arrangement depends on the Ubuntu and Apache service setup; after changing it, confirm that Apache can read the file while ordinary web users cannot.
Rank #2
- 【IP68 Waterproof Multifunctinal Smart Watch】Torjalph fitness activity tracker smart watch is IP68 waterproof technology ,you can wear it when swimming,handwashing,it's rain-proof which means that you perform multiple exercise modes outside without worrying about sweat or rain corroding your fitness smart watch,and this watch equipped with a 230 mAh large capacity battery magnetic charging ,and this sports activity tracker watch can be used 5-7 days If fully charged.
- 【Larger 1.83'' Full Screen Watch & Multi-dial Selection】1.83 inch full HD color touch screen smart watch for men / women provides excellent 240*284 resolution image quality ,This Bluetooth smart watch offers a better touch experience and remarkable immersion and ,more than 200 watch faces for you to choose from App"Da Fit ", you can change the dial style according to your mood to wear keeping the world on your wrist
- 【Accurate Activity Tracker Smart Watch 】sports watch activity tracker uses sweat and dust resistant breathable silicone strap, our Fitness Tracker Smart Watch for Android iOS Phones supports 12 sports modes,walking,running,bicycle,swimming,badminton,basketball,football,rope skipping. This bluetooth calls smart watch for men women is lightweight and stylish, bringing more convenient and relaxing sports experience while also providing more protection.
- 【Your 24 Hour Personal Daily Health Monitor】Fitness watch for women men full touch screen IP67 waterproof bluetooth smartwatch for Android iOS Phones with heart rate blood pressure monitor multifunction Andriod smart watch with steps counter sleep monitor sports fitness watch, monitoring blood oxygen saturation allows you to understand your physical condition in real time to track fitness progress ,to know your health status in time.
- 【More Functions Bluetooth Call Smart Watch】This fitness activity smart watch full screen for iPhone and Android phones includes a bunch of new features including:The bluetooth smart watch can hang up the phone, receive and display WhatsAPP /Text /Facebook /Twitter /Messenger reminder.Support sedentary reminder, alarm clock, stopwatch, timer,weather information,music control, remote camera control compatible with Android 5.0 and above or iOS 9.0 and above smartphones.
Configure authentication in a virtual host or <Directory> block
Central configuration is normally the safest choice. Edit the active Apache virtual-host configuration, or another configuration file included by that virtual host, and add a block matching the filesystem directory:
<Directory "/var/www/html/private">
AuthType Basic
AuthName "Restricted area"
AuthBasicProvider file
AuthUserFile "/etc/apache2/.htpasswd"
Require valid-user
</Directory>
Each directive has a specific job:
AuthType Basicselects HTTP Basic Authentication.AuthName "Restricted area"defines the authentication realm shown by clients. Browsers commonly display it in the login prompt and use it to identify the credential scope.AuthBasicProvider filetells Apache to use a flat file provider. Apache documentsfileas the default provider, so this line is optional when the file provider is intended; leaving it explicit makes the configuration easier to audit.AuthUserFile "/etc/apache2/.htpasswd"gives Apache the absolute filesystem path to the credential file. Use an absolute path and keep it outside the URI space.Require valid-userallows any username that successfully authenticates against that file.
To restrict the directory to one named account, replace the final line with:
Require user alice
That rule still requires Alice to provide the correct password, but it rejects other valid accounts in the same file. If you later need several selected accounts, list the permitted usernames in the authorization rule according to the Apache version and configuration syntax installed on your Ubuntu release; do not broaden access accidentally by leaving Require valid-user in place.
The <Directory> path is a filesystem path, not the URL path. If the URL is https://example.com/private/ and the files are stored in /var/www/html/private, the example block matches. If an alias or a different document root maps the URL elsewhere, place the block around the actual filesystem directory used by that mapping.
Use .htaccess when per-directory configuration is required
If directory owners must manage their own access rules, create /var/www/html/private/.htaccess with the same authentication directives:
AuthType Basic
AuthName "Restricted area"
AuthBasicProvider file
AuthUserFile "/etc/apache2/.htpasswd"
Require valid-user
Then, in the active Apache configuration, allow authentication directives for the corresponding directory:
<Directory "/var/www/html/private">
AllowOverride AuthConfig
</Directory>
AllowOverride AuthConfig is the critical connection between the .htaccess file and Apache. Without an appropriate override setting, Apache will ignore or reject directives such as AuthType, AuthName, and Require when they appear in .htaccess. A broader override setting may also permit them, but it delegates more configuration power than authentication alone and should be chosen deliberately.
Do these 3 things before closing this tab:
1Clear out junk files and repair common Windows errors2Scan for outdated or missing drivers - takes under a minute3Repair Windows errors before they cause bigger problemsRank #3
- [Low Noise High Fidelity] New bee guitar cord with 22AWG oxygen-free-copper center conductors provides enhanced signal transfer, the PVC insulation material and the high-density stranded copper double shield provide noise rejection for quiet operation
- [Ideal for Choice] New bee 1/4 straight and right angle metal connectors, ensures a secure connection in any instrument, pedal, or amp jack. L shape great fro on stage guitar stands
- [Wide Compatible] Suitable for mixer, power amplifier, microphone, effector, decoder, equalizer, electoronic organ, electric guitar, electric bass and other electronic equipments. Widely used in the installation of smart home, karaoke speaker, professional stage audio, etc
- [Easy Disassemble] Making incidental repairs quick and easy! Very nice, flexible cable
- [Dont Hesite to Order] 24 hours customer services and professional technology team are standing by
Keep the AuthUserFile outside the document root even when the directives are in .htaccess. The location of the directives does not make a web-visible credential file safe.
Validate the configuration and reload Apache
Never reload an untested configuration. From the server, run:
sudo apache2ctl configtest
sudo systemctl reload apache2
A successful syntax check should report that the configuration is valid. The reload applies the change without requiring a full service stop. If the check or reload fails, do not remove authentication directives at random. Read the reported file and line, verify the spelling and nesting of each directive, and confirm that the active virtual host includes the file you edited.
Ubuntu maintains release-specific Apache and service-management guidance. If service behavior differs on your installed release, use the commands and service layout documented for that release rather than assuming another Ubuntu version’s defaults.
Free tools Windows power users keep installed
One-click scans. No signup required.
Test the challenge and an authenticated request
Test the exact HTTPS URL that users will access. An unauthenticated request should receive a 401 challenge:
curl -I https://example.com/private/
The protected resource should be returned when valid credentials are supplied:
curl -u alice https://example.com/private/
The second command prompts for Alice’s password. Supplying a password directly on a shell command line can expose it through shell history or process inspection, so use the prompt form for routine testing.
Rank #4
- Digital Family Calendar: BSIMB digital calendar wall touch screen puts an end to your chaotic life. Designed for busy families, the digital calendar keeps you organised and in step with your family. Assign different colours and tasks to each family member to make family scheduling easier and more intuitive.
- Easy Setup and Auto-Sync: Plug in, connect to WLAN and auto-syn your electric calendar in minutes. Digital wall calendar compatible with Google calendar, iCloud calendar, Outlook calendar, Cozi calendar and Yahoo calendar. Add events directly on the device or through the ecalendar app. Electronic calendar stays current whether you're at work or traveling—no manual updates needed.
- All-In-One Home Assistant: Smart calendar builds habits and encourage independence with personalised chores. Display daily meal plan to reduce the daily ‘What's for dinner?’ stress. To-do lists keep track of everything you want. Turning chores into valuable achievements with stars and rewards, making life easier and more enjoyable.
- Manage Anytime Anywhere: BSIMB electronic calendar for family stay connected with the powerful ecalendar app. Access and manage your digital wall calendar anytime, anywhere with free features like stars & rewards, photo screensaver, chore charts, meals plans, to-do lists etc. Electronic planner paid features like Magic Import tailor advanced tools for users with special needs.
- Stay in Touch with Loved Ones: Share photos or videos from your phone to electronic wall calendar with app, instantly update your life moment, and keep in touch with your family, especially those who are far away; you can also surprise your smart calendar digital wall by sending him a wish card; it's also great for keeping tech-illiterate elders in touch with the youngsters.
In a browser, open the protected URL and confirm that the browser asks for credentials. Enter an account present in the file and verify that the expected resource loads. Test a wrong password as well: it should not grant access. Test an account that exists in the file when the rule is Require user alice; that account should still be denied unless it is explicitly permitted.
Quick wins for a faster PC:
Repair Windows errors before they cause bigger problemsFix Now →Fix the driver behind crashes, sound loss and screen glitchesFind Drivers →A 401 normally indicates that Apache needs valid authentication. A 403 Forbidden after authentication usually points to authorization rules or filesystem access rather than a missing password. Record the status code and the requested URL before changing configuration, because they identify whether the failure is in authentication, authorization, or path mapping.
Virtual-host configuration versus .htaccess
| Aspect | Virtual-host or <Directory> block |
.htaccess |
|---|---|---|
| Administration | Central control by the Apache administrator. | Per-directory delegation to the directory owner or deployment process. |
| Where directives live | In the active server or virtual-host configuration. | In a file inside the protected directory. |
| Required setting | No AllowOverride permission is needed for the directives in the server configuration. |
The matching <Directory> block must allow AuthConfig (or a broader override that includes it). |
| Change control | Requires configuration validation and a reload after edits. | Apache reads the file for requests, but the server configuration still needs the override permission; deployment must protect the file and its syntax. |
| Typical risk | An incorrect block can affect a wider path or the wrong virtual host. | Apache may ignore the file when overrides are disabled, or a syntax error and accidental delegation may be harder to notice. |
| Credential storage | The same AuthUserFile can be used. Keep it outside the document root and URI space in either design. |
|
Choose the central block when you control the server and want one auditable policy. Choose .htaccess only when its per-directory delegation is a real requirement; it is not necessary merely because the protected content sits in a subdirectory.
Troubleshoot common failures
“Invalid command ‘AuthType’” or a similar directive error
Apache is reading the directive in a context where authentication overrides are not allowed, or the authentication modules required by the installed Apache build are unavailable. If the directives are in .htaccess, verify that the matching <Directory> block has AllowOverride AuthConfig or an appropriate broader setting. If they are in server configuration, move them into a valid virtual-host or <Directory> context. Confirm that the authentication modules supplied by the Ubuntu Apache installation are present before retrying the reload.
The .htaccess file appears to be ignored
The usual cause is that the enclosing directory does not permit authentication overrides. Add AllowOverride AuthConfig to the matching <Directory> block, run sudo apache2ctl configtest, and reload Apache. Also verify that the file is named exactly .htaccess, is in the directory Apache actually serves, and contains the directives shown above.
Login prompts repeat even with the correct password
- Check that the username was entered exactly as it appears in the credential file.
- Reset the account password by running
htpasswdwithout-cagainst the existing file and naming that user. - Confirm that
AuthUserFileis an absolute path to the file you edited, not a similarly named file elsewhere. - Verify that the
AuthNamerealm and the URL are the ones you intend; browsers can cache credentials per realm and host. - Ensure Apache can read the credential file under its service account while the file remains inaccessible through HTTP.
Every user receives 403 Forbidden
Inspect the authorization rule first. Require user alice permits only Alice; it does not permit every valid account. If the rule is correct, inspect filesystem permissions on the target directory and its parent directories. Apache must be able to traverse the path and read the requested resource. A valid password cannot overcome a filesystem denial.
The credential file can be downloaded
Treat this as an exposure incident. Move the file immediately to a location outside the document root and URI space, update AuthUserFile to the new absolute path, validate the configuration, and reload Apache. Because password records may already have been exposed, change the affected account passwords and review access logs before restoring service.
Best Value
Reload fails after an edit
Run sudo apache2ctl configtest again and use the reported filename and line number to locate the error. Check quotation marks, directive spelling, closing </Directory> tags, and the exact AuthUserFile path. If the syntax is valid but the service still refuses to reload, inspect the Apache error log and verify that the directory block matches the URL’s actual filesystem path and virtual host.
Security requirements for Basic Authentication
Use HTTPS before protecting sensitive content
Apache’s official guidance states that Basic Authentication sends the password from the client to the server unencrypted. The password is encoded for the HTTP exchange, not encrypted by Basic Authentication itself. Use HTTPS with a valid TLS configuration before relying on this method for private files, administration pages, or personal information. Test the HTTPS URL rather than treating an HTTP redirect as a substitute for TLS protection; credentials must not be submitted over the unencrypted endpoint.
Keep the password file private
The file contains password records managed by htpasswd. Store it outside the document root and URI space, restrict filesystem ownership and permissions, and include it in your server’s protected configuration backups. Do not paste its contents into tickets, repositories, deployment logs, or shell commands. Verify after every move that Apache can read it and a browser cannot fetch it.
Use least privilege in the authorization rule
Require valid-user is appropriate when every account in the file should have access to the directory. If only one account should enter, use Require user alice instead. Review the rule whenever a new account is added: adding a username to the file does not by itself document whether that person should access every protected directory that references the file.
Manage changes safely
Create the file only once with -c. For password changes or additional users, omit -c so existing records remain in place. Before deploying a policy change, save a protected backup of the current configuration and credential file, run the syntax check, reload, and test both an unauthenticated and an authenticated request. If a deployment is automated, keep the credential file as a secret rather than embedding it in a public web build.
Deployment checklist
- Utility:
apache2-utilsis installed andhtpasswdruns. - Credential file: created with
htpasswd -conly for a new file, then updated without-c. - Location: the file is outside the document root and Apache’s URI space.
- Authentication directives:
AuthType Basic,AuthName,AuthUserFile, and the intended provider are in a valid context. - Authorization:
Require valid-useror the intended named-user rule matches the access policy. .htaccessonly: the matching directory permitsAllowOverride AuthConfigor an intentionally broader override.- Validation:
sudo apache2ctl configtestsucceeds before reload. - Service: Apache reloads successfully and its error log is clean of related errors.
- Testing: an unauthenticated HTTPS request returns
401, valid credentials return the resource, and an invalid account or password is rejected. - Transport: users access the protected resource over HTTPS with a valid TLS configuration.
With those conditions met, Apache has a complete Basic Authentication setup: a private credential file, directives in a context Apache is allowed to read, an explicit authorization policy, and encrypted transport for the credentials while they cross the network.
The Tool Desk
Outbyte Driver Updater FREEScan for outdated or missing drivers - takes under a minuteDriver Scan →Outbyte PC Repair FREERepair Windows errors before they cause bigger problemsFix Now →Quick Recap
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.




