What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
Apache, not PHP-FPM, performs the password check. Put an .htaccess file in the directory you want to protect, enable the AuthConfig override for that directory, and add Apache Basic Authentication directives that point to an htpasswd file. Apache challenges unauthenticated requests before forwarding an authorized PHP request to PHP-FPM.
Antihost offers Linux VPS plans with full root access, unlimited traffic on a 1 Gbps port and a 14-day free trial.
The smallest working setup is:
AuthType Basic
AuthName "Restricted area"
AuthUserFile /etc/apache2/.htpasswd-private
Require valid-user
Create the password file with Apache’s htpasswd utility, keep it outside the public document tree when possible, and use HTTPS because Basic Authentication does not encrypt credentials by itself.
As an Amazon Associate I earn from qualifying purchases.
The Tool Desk
Outbyte Driver Updater FREEScan for outdated or missing drivers - takes under a minuteDriver Scan →Outbyte PC Repair FREEClear out junk files and repair common Windows errorsFree Scan →What this setup protects—and what PHP-FPM does
An .htaccess-protected folder is guarded at Apache’s HTTP request layer. A browser requests a URL, Apache checks the directory’s authentication rules, and only a request with accepted credentials proceeds to the content handler. If the URL maps to a PHP script, Apache then passes that authorized request through its PHP-FPM integration, commonly mod_proxy_fcgi.
PHP-FPM is therefore not the component that displays the username-and-password prompt. It manages PHP worker processes after Apache has decided that the request may continue. An unauthenticated request should be rejected with an authentication challenge and should not execute the PHP script at all. The PHP-FPM socket, pool name, and filesystem path vary by operating system and hosting provider.
#1 Best Overall
- BLUE LIGHT BLOCKING GLASSES: Our blue light glasses for women boast UV400 protection, blocking harmful blue rays from computer screens. With these bluelight glasses women, you can enjoy gaming, reading, or watching TV with no worries of eye strain.
- EYE RELIEF: Our blue light glasses are engineered to reduce blurry vision or strain caused by prolonged screen time. These womens blue light glasses aid in better sleep by preventing blue light from disrupting your natural sleep cycle, helping you fall asleep faster and enjoy a more restful night's sleep, making them the perfect christmas present.
- COMFORTABLE: Crafted from durable material, our trendy blue light glasses for woman or blue light glasses men ensure long-lasting comfort. The high-transmittance lenses accessories, gamer gifts for men, help keep your eyes relaxed. Perfect stocking stuffers, gifts for gamers men, christmas gifts for men, halloween costumes.
- LIGHTWEIGHT: These clear blue light glasses feature a lightweight frame, meaning they’ll stay comfy for long-term wear. Perfect as blue blockers glasses for women or mens blue light glasses, these non-prescription fake glasses for men can be worn throughout the day. The blue light blocking glasses women feature polycarbonate HD lenses, which are anti-reflective and restore true color.
- WORRY-FREE PURCHASE: If you experience any issues, our support team is ready to assist you quickly. These are the perfect costume glasses for cosplay dressing up.
Prerequisites to check first
- Apache must serve the folder, and the request must reach the virtual host you intend to change.
- Apache must allow authentication directives in that directory’s
.htaccessfile. - The authentication and authorization modules used by your configuration must be loaded.
- The Apache process must be able to read the password file.
- Sensitive content should be served over HTTPS, not plain HTTP.
- You need shell or control-panel access sufficient to create the password file and edit the directory configuration.
Enable the correct override class
In the relevant Apache server or virtual-host configuration, the directory needs an override class that includes authentication directives. A focused example is:
<Directory "/var/www/example/private">
AllowOverride AuthConfig
</Directory>
The path must be the real filesystem directory, not the URL path. Some servers use AllowOverride All, which also permits unrelated classes of directives; it works for authentication but grants broader delegation than necessary. If overrides are disabled, an .htaccess file can be present and readable while its authentication directives are ignored or reported as “not allowed here.” Reload or restart Apache after changing the main configuration, using the method supplied by your operating system or host.
Quick wins for a faster PC:
Repair Windows errors before they cause bigger problemsFix Now →Scan for outdated or missing drivers - takes under a minuteDriver Scan →Confirm the required modules
A file-backed Basic Authentication setup normally relies on Apache’s Basic Authentication, file-authentication, and authorization modules. Module names differ slightly between distributions, but the relevant capabilities are represented by mod_auth_basic, a file provider such as mod_authn_file, and authorization support such as mod_authz_user. Group-based rules additionally need the group-file authorization module. If a module is missing, Apache’s error log generally identifies the unknown directive or unavailable provider.
Choose where to put the rules
Apache’s preferred location is the main server or virtual-host configuration, inside a <Directory> block. That location avoids per-request searches for directory-level configuration files and gives the administrator complete control. Use .htaccess when you do not have permission to edit the main configuration, as is common on shared hosting.
| Approach | Administrative access | Scope and control | Request overhead | Typical use |
|---|---|---|---|---|
.htaccess |
Can work without root access if the host permits AuthConfig |
Applies to one directory and its descendants, with inheritance rules | Apache checks directory configuration during requests | Shared hosting or delegated site administration |
Main <Directory> configuration |
Requires server or virtual-host administration | Centralized, explicit control over the filesystem directory | Avoids the repeated per-directory .htaccess lookup |
Managed servers and production deployments |
Do not mix two competing authentication policies accidentally. If a parent directory, virtual host, or included configuration also sets authorization directives, inspect the effective configuration and test the exact URL you intend to protect.
Create the password file safely
Apache’s htpasswd utility creates and updates the credential file. The first account requires the -c option, which creates a new file:
htpasswd -c /etc/apache2/.htpasswd-private alice
The command prompts for a password and writes a password hash, not the original password. Replace the example path and username with values appropriate to your server. The -c option is destructive when used on an existing file: it recreates the file and can remove all existing accounts. Add subsequent users without -c:
Rank #2
- WINDEX GAMING WIPES: effortlessly clean all your gaming gear and gaming electronics in one easy step with our new Windex Gaming Wipes
- AMMONIA FREE: our ammonia-free formula is safe to use on all of your favorite gaming equipment like consoles, headsets, controllers, screens, keyboards, and more
- PRE-MOISTENED WIPES: each wipe instantly removes dust, dirt, and stubborn smudges and fingerprints leaving a streak-free shine
- ANTI-STATIC: great for cleaning and wiping down your gaming gear and electronics leaving behind no visible residue
- COMPACT RESEALABLE PACKAGE: store your pack of Windex Gaming Wipes anywhere in your home for whenever a quick and easy wipedown is needed
htpasswd /etc/apache2/.htpasswd-private bob
htpasswd /etc/apache2/.htpasswd-private carol
On systems where the utility is not installed, install the Apache utility package supplied by your distribution or use the hosting control panel’s equivalent. Do not put the password file under the public document root if you can avoid it. A web-server mistake that serves the file as plain text could expose its contents, even though the entries are hashed.
Set ownership and permissions
Apache needs read access to the file, while ordinary web users should not be able to modify it. The exact account and group differ by operating system and service manager. A common pattern is an administrator-owned file with read permission for the group used by Apache:
chown root:web-server /etc/apache2/.htpasswd-private
chmod 640 /etc/apache2/.htpasswd-private
Use the actual Apache service account and group on your system; do not copy web-server literally. If the file is outside the document tree, also verify that Apache can traverse each parent directory. Avoid world-writable permissions. When changing a password file, preserve its ownership and mode, then test a known account immediately.
Limit which accounts can sign in
Require valid-user permits every account in the password file. For a smaller allow-list, name users explicitly:
Require user alice bob
For a maintainable team list, use a group file and authorize a group:
AuthGroupFile /etc/apache2/.htgroup-private
Require group editors
A group file uses one group per line, followed by its members separated by spaces, for example:
editors: alice bob
reviewers: carol
Use named users when the protected folder has only a few stable accounts. Use groups when membership changes independently of the folder’s configuration. In either case, remove departed users from the password or group file promptly.
Free tools Windows power users keep installed
One-click scans. No signup required.
Rank #3
- Ergonomic & Adjustable Design: Fight "text neck" and improve your posture. Designed for comfort, it offers an adjustable height (7.1in-8.5in) (1.4in adjustable range) and angle (5°-85°) Please note: cell phone stand is only 9 inches tall—the length of a standard pencil
- Without blocking subtitles Perfect for office desk Tiktok Face Time Zoom video—this is the ultimate kitchen desk essential for phones! Perfect viewing experience while reducing neck back strain, A must-have for gamers streamers desk, and anyone who values both style and support!
- Sleek & Stable Design fits Otterbox Case: Say goodbye to bent cables, tangles, and tip-overs! LISEN’s stylish adjustable desk phone holder features a built-in charging hole and smart cable management, keeping your phone secure and your workspace clutter-free cool gadgets for men
- ANTI-SLIP DESIGN free hands: The under 10.00 items easy gadgets back and the bottom of this kitchen essentials for women are fully covered by anti-skid silicone, which LISEN stand up desk decor can provide maximum protection device from any scratches and slides
- Your Perfect Viewing Companion:If your product arrives damaged or breaks within 365 days, reach out to LISEN for a quick and hassle-free solution. Struggling with assembly, like tightening the screw? We’ve got your back! Your experience matters to us. (Product including: phone Holder stand*1, screw*1, hexagon screwdriver*1, specification*1)
Write the .htaccess file
Create .htaccess in the directory that should require a login. The minimal file is:
AuthType Basic
AuthName "Restricted area"
AuthUserFile /etc/apache2/.htpasswd-private
Require valid-user
What each directive means
AuthType Basic: selects HTTP Basic Authentication, in which the browser sends an encoded username and password in the request.AuthName "Restricted area": sets the authentication realm shown by the browser. Keep it recognizable; browsers may cache credentials by realm and host.AuthUserFile ...: points to the server’s filesystem path for thehtpasswdfile. It is not a URL and should not begin with the protected site’s public URL.Require valid-user: authorizes any account that successfully authenticates against that file.
Apache applies the rule to the directory containing the file and normally to files and subdirectories below it. If only one child directory should be protected, place the file there rather than in a higher-level directory.
Protect only selected users
Replace the final line when least-privilege access is required:
Require user alice bob
For group membership, add the group-file path and group requirement:
Windows 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 reinstallOutdated Drivers Are Slowing You Down
One free scan finds every outdated or missing driver and matches the right update for your exact hardware.Free scan · exact hardware matchAuthType Basic
AuthName "Editors"
AuthUserFile /etc/apache2/.htpasswd-private
AuthGroupFile /etc/apache2/.htgroup-private
Require group editors
Keep the authentication directives in one effective configuration scope. If a parent rule uses a different Require expression, Apache’s authorization-merging behavior can produce a result different from what the local file suggests; review the complete directory hierarchy when debugging.
Make sure PHP-FPM requests fall inside the protected directory
The authentication rule applies to the URL-to-directory mapping Apache selects. It does not matter whether the eventual PHP handler uses a TCP endpoint or a Unix-domain socket, provided the request is matched to the protected directory before it is handed to PHP-FPM.
A conceptual PHP-FPM mapping might look like this:
ProxyPassMatch "^/app/.*\.php$" "fcgi://127.0.0.1:9000/var/www/app/"
This is an illustration, not a drop-in path. Use the mapping already supplied by your distribution or deployment. Changing the socket, pool, script filename, or document-root path without understanding the existing mapping can cause gateway errors or execute a different file. The important sequence is:
Rank #4
- Easy Installation: Our gaming lights have been designed to enhance your entertainment experience. Simply position the led light bar next to your TV or game console to create a game room environment with ease. They come with USB power and a 60 inch cord for direct mounting and mobility
- Audio Syncing & Extensive Mode: The built-in high-sensitivity music sensor allows you to sync the TV led lights to your favorite music. Lights react and move to the beat of music, film and game audio, creating an incredible immersive sound and light experience – and all without the need for an additional hub. You can choose from 64+ patterns, including strobe, illusion, jump, energy, gradient, running, chasing, fluttering mode etc. Each mode can be applied to different scenes
- 64+ Chasing IC+RGB & W Effect: The independent control design of IC+RGB and white all-in-one multifunctional rgbw led bar lights monitor backlight allows you to easily switch the led lights for desk between IC+RGB and white to enjoy a variety of lighting effects, you can choose white lighting mode with high brightness for better illumination when working, etc. Choose IC+RGB lighting mode when you need to create an entertaining atmosphere for the light show, 16 million colours of Color changing rgb light bar let you dance to the beat and create a dynamic party atmosphere
- Dynamic and Dimmable Lights: 1%-full brightness free brightness adjustment gives you the flexibility to adjust dimmable led light bar for room decorations or a variety of occasions
- USB Powered: USB light bars for room can be powered by powernank, usb charger, TV, Monitor, laptop PC mainframe, making behind TV led lighting bar easy to install in any location.TV led lights are powered by the TV usb interface / PC mainframe, can be turned on/off synchronously with TV / PC
- Apache receives the URL and selects the intended virtual host.
- Apache evaluates directory authentication and authorization.
- An unauthenticated request receives a challenge and stops.
- An authenticated, authorized request proceeds to the PHP-FPM handler.
- PHP-FPM executes the selected script under its configured pool account.
If static files in the same folder must also be private, test those URLs separately. A PHP-only rewrite or handler rule may protect scripts while leaving another resource path exposed if it maps outside the directory covered by .htaccess.
Recommended Free Tools
Use HTTPS before sending real credentials
Basic Authentication does not provide confidentiality. The username and password are encoded for transport, not encrypted. Without TLS, anyone able to observe the connection can recover the credentials and reuse them.
Configure HTTPS on the virtual host that serves the protected directory, then redirect HTTP requests to HTTPS. Ensure the authentication challenge is issued on the HTTPS virtual host rather than prompting on an unsecured connection. Confirm that every protected link, form action, image, stylesheet, and script uses the HTTPS origin so the private page does not load mixed content.
For an internal test on a trusted network, HTTP may demonstrate that the rule works, but it is not an acceptable configuration for sensitive material, administrator panels, source code, backups, or personal data.
Deployment procedure
- Identify the real directory. Map the public URL to its filesystem directory and verify that the request reaches the intended Apache virtual host.
- Enable overrides. In the applicable
<Directory>block, setAllowOverride AuthConfigor a broader policy already approved by the server administrator. - Verify modules. Confirm Basic Authentication, file authentication, and authorization modules are loaded.
- Create the credential file. Run
htpasswd -conce for the first account, then runhtpasswdwithout-cfor each additional account. - Secure the file. Place it outside the document root when possible, assign ownership that permits Apache to read it, and remove world-write access.
- Create
.htaccess. AddAuthType,AuthName,AuthUserFile, and the appropriateRequiredirective. - Enable TLS. Serve the protected virtual host over HTTPS and redirect its HTTP counterpart.
- Reload only when needed. Changes to
.htaccessare normally read with requests; changes to the main Apache configuration require the host’s documented reload or restart procedure. - Run the test matrix. Test anonymous, valid, invalid, static-file, and PHP URLs before announcing the change.
Test the result methodically
Use a private browser window or clear the browser’s cached credentials between tests. A browser may automatically resend a previously accepted credential, hiding a configuration error.
Do these 3 things before closing this tab:
1Repair Windows errors before they cause bigger problems2Scan for outdated or missing drivers - takes under a minute3Clear out junk files and repair common Windows errors| Test | Expected result | If it fails |
|---|---|---|
| Open a protected URL without credentials | Apache returns an authentication challenge and the browser shows a login prompt | Check that the URL maps to the intended virtual host and that the .htaccess file is being read |
| Enter a valid account and password | The requested file or PHP page loads | Check the password file path, account entry, file permissions, and authorization directive |
| Enter an invalid password | Access is denied, normally with a 401 response | If access succeeds, another rule or an upstream cache may be serving the response |
| Request a protected static file | The same authentication policy applies | Check directory scope and rewrite or alias rules |
| Request a PHP URL in the folder | Only after authentication does PHP-FPM process it | Inspect the PHP-FPM mapping, script path, and Apache error log |
| Request the HTTP version | Redirect to HTTPS before authentication or according to the site’s documented redirect policy | Check the HTTP and HTTPS virtual-host configuration separately |
Command-line tests can make the response sequence clear:
curl -i https://example.test/private/
curl -i -u alice:'correct-password' https://example.test/private/
curl -i -u alice:'wrong-password' https://example.test/private/
Use a shell history policy that does not retain real passwords. The sample host and credentials are placeholders for your own test environment; never paste production passwords into shared terminals or logs.
Best Value
- Compatible with Wide Screens - To ensure compatibility with the dual monitor mount, your each monitor must meet three conditions at the same time: First, computer screens size range: 13 to 32 inches. Second, screen weight range: 4.4 to 19.8 lbs. Third, the back of the monitor screen must have VESA mounting holes with a pitch of 75x75mm or 100x100mm.
- Regarding the compatibility with desks - Your desk must meet three conditions at the same time: First, desk material: Only wooden desks are recommended, plastic or glass desks cannot be used. Second, desk thickness range: 0.59" - 3.54". Third, the bottom of the desk should not have any cross beams or panels, as this will interfere with installation. We recommend carefully checking that your desk and monitors meets all above conditions before purchasing.
- Dual C-Clamp Hold - Worried your dual monitors might wobble or slip? Our upgraded base uses a larger platform plus a dual C-clamp structure to lock the dual monitor arm firmly to your desk. Each arm safely keeps your screens steady while you type, click and game—no shaking, no sliding, just a clean and secure setup you can trust every day. It also provides Grommet Mounting installation choice, both options ensure stable and secure fixation for your 0.59" - 3.54" desk.
- Full-Motion Adjustment For Comfortable View - Pull the screen closer when you’re deep in a spreadsheet, push it back to watch videos, or rotate to portrait for coding — moving everything smoothly with just one hand. The monitor stand offers +85°/-50° tilt, ±90° swivel and 360° rotation. Raise your monitor up to 15.75″ to support a healthy sitting posture. Whether you’re working from home, gaming through the night, or switching between video calls and documents, getting the screens to your natural line of sight helps relieve neck, shoulder and back strain so you can stay focused longer with less fatigue.
- Keep Your Desk Organized: By lifting both screens off the desktop, this dual monitor stand opens up valuable space for your keyboard, notebook, docking station or a simple, clutter-free work area. Built-in cable management guides wires along the arms, keeping cords out of sight and out of the way. Enjoy a tidy, modern workstation that looks as good as it feels to use.
Troubleshoot common failures
The prompt never appears
- Confirm the request is served by Apache, not a different reverse proxy, web server, or cached response.
- Check that
.htaccessis in the directory actually selected for the URL. - Verify that the matching
<Directory>block permitsAuthConfig. A disabled override leaves the file ineffective. - Look for an alias, symlink, rewrite, or separate virtual host that maps the URL to another filesystem location.
- Temporarily test a simple file in the same directory to distinguish directory scope from PHP handler behavior.
Apache reports “not allowed here” or an unknown directive
The override class is too restrictive, or a required module is not loaded. Add the authentication class in the correct <Directory> block, reload Apache if the main configuration changed, and verify module availability. Do not solve the problem by enabling every override class unless the broader delegation is acceptable.
Apache cannot read the password file
- Check that
AuthUserFileis an absolute filesystem path. - Confirm the file exists at that exact path and was not accidentally recreated elsewhere.
- Check read permission for the Apache service account and execute permission on parent directories.
- Inspect the Apache error log for a missing-file or permission-denied message.
- Make sure a security policy such as filesystem confinement is not blocking access.
Valid credentials are rejected
Verify the username spelling and that the account was added without accidentally using -c on an existing file. Check that the configured AuthUserFile is the same file edited by htpasswd, and ensure the password was entered exactly as created. If named-user or group authorization is used, confirm the account is included in the corresponding Require expression or group line.
The page authenticates but PHP returns an error
Authentication has probably succeeded and the failure is now in the PHP-FPM path. Check the existing mod_proxy_fcgi mapping, PHP-FPM pool status, socket ownership, script filename, and document-root path. Do not change the authentication rules to fix a FastCGI connection or application error; inspect Apache and PHP-FPM logs separately.
Users stay logged in after their access should end
HTTP Basic Authentication has no built-in logout button. Browsers cache credentials for a host and realm, so removing an account prevents new authentication but does not provide a universal remote sign-out for a browser that already holds credentials. Change the realm, password, or browser session as appropriate for the incident, and use a session-based application login when revocation and logout controls are required.
Maintenance and security practices
- Use a unique, strong password for each account; never reuse a server or email password.
- Prefer individual accounts over a shared credential so access can be removed for one person without disrupting everyone else.
- Keep the password file outside the document root and back it up with the protected site’s configuration.
- Restrict file ownership and permissions, and audit them after migrations or control-panel changes.
- Review Apache access and error logs for repeated failed attempts, unexpected hosts, and authorization errors.
- Apply HTTPS before exposing the folder outside a trusted local test network.
- Remember that Basic Authentication protects HTTP access, not direct filesystem access, backup copies, alternate hostnames, APIs, or a second web server that bypasses Apache.
- Use application-level authorization when access depends on roles, records, two-factor authentication, audit trails, or immediate session revocation.
.htaccess versus application login
Apache Basic Authentication is useful for a small private area, staging content, an administrative tool, or a temporary barrier placed in front of an entire directory. It is simple, independent of the PHP application, and rejects unauthorized requests before PHP-FPM spends resources processing them.
It is not a replacement for an application’s user system when you need per-record permissions, password-reset workflows, multifactor authentication, logout, device management, or detailed audit events. In those cases, keep the Apache rule as an outer network gate if useful, and implement the actual authorization inside the application.
Quick Recap
Final verification checklist
- The intended Apache virtual host serves the URL.
- The matching directory permits
AuthConfigor an approved broader override. - The four essential directives are present:
AuthType,AuthName,AuthUserFile, andRequire. - The password file is an absolute filesystem path, readable by Apache, and outside the public tree when possible.
htpasswd -cwas used only when creating a new file; additional accounts were added without-c.- The PHP-FPM mapping remains unchanged and authorized requests reach the intended script.
- HTTP redirects to HTTPS and credentials are never sent over an unencrypted connection.
- Anonymous, valid, invalid, static-file, and PHP requests have all been tested, with Apache’s logs checked for errors.
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.




