Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back > Forums > Linux Forums > Linux - Server
User Name
Linux - Server This forum is for the discussion of Linux Software used in a server related context.


  Search this Thread
Old 11-26-2006, 01:07 AM   #1
LQ Newbie
Registered: Nov 2006
Posts: 8

Rep: Reputation: 0
Apache2 htaccess problem

I'm trying to setup a website that you need a password to access and want to use .htaccess to restrict access. But It's pretty much ignoring the script. I'm using a default lamp configuration, with default scripts.

My (/var/www/).htaccess script is:

AuthType Basic
AuthName "My Server"
AuthUserFile /var/.htpasswd
require user john

Last edited by ghostz00; 11-26-2006 at 01:14 AM.
Old 11-26-2006, 01:26 PM   #2
Senior Member
Registered: Dec 2005
Location: Brisbane, Australia
Distribution: Slackware64 14.0
Posts: 4,125

Rep: Reputation: 164Reputation: 164
Are you getting anything in the Apache access/error logs when you access those pages?
Old 11-26-2006, 04:01 PM   #3
Registered: Nov 2006
Location: Maine
Distribution: Debian, Ubuntu, Gentoo
Posts: 109

Rep: Reputation: 15
Try the following:

chmod 777 .htaccess (If you haven't already)

In httpd.conf, made sure AllowOverride is All for /var/www (I think that's what I did)
Old 11-26-2006, 11:18 PM   #4
LQ Newbie
Registered: Nov 2006
Posts: 8

Original Poster
Rep: Reputation: 0
I added two virtual host entry's into the apache2.conf and that immediately took care of my problem.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
htaccess problem furqan_sindhu General 0 11-23-2006 06:28 AM
Apache2 .htaccess problem suse 10.0 PB0711 Linux - Networking 2 07-12-2006 11:23 AM
apache2 + htaccess + ssl rubella Linux - Security 1 02-07-2006 05:17 AM
.htaccess problem lothario Linux - Software 0 01-22-2005 05:20 AM
Apache2 .htaccess - Unable To Get Password Prompt. magestic Linux - Software 2 10-27-2004 08:49 AM

All times are GMT -5. The time now is 07:40 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration