LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 12-27-2010, 03:15 AM   #1
MarkRaats
LQ Newbie
 
Registered: Dec 2010
Posts: 12

Rep: Reputation: 0
.htaccess / .htpasswd don't work, what do I miss


Hi guys

I've installed apache2 / php5-mysql / libapache2-mod-php5 / mysql-server. My question is, which packages must be installed?

in the /var/www/
I've .htpasswd
user:sQjrqRjCfEXJI

I've (also) in the /var/www/
.htaccess

AuthName "Restricted Area"
AuthType Basic
AuthUserFile /var/www/.htpasswd
AuthGroupFile /dev/null
require user user

When I enter (from other pc in the LAN) http://<ip-from-server>/gitweb there is nothing, yeah the website offcourse, but without post user and password. So it's not restrected. What dit I wrong or what do I need to install?

Greetz
Mark

edit: it looks like its because my htaccess, because when I edit the htaccess with:
order allow,deny
deny from <client-ip>
allow from all
I've still access to the folder.

Last edited by MarkRaats; 12-27-2010 at 03:21 AM.
 
Old 12-27-2010, 03:55 AM   #2
repo
LQ 5k Club
 
Registered: May 2001
Location: Belgium
Distribution: Arch
Posts: 8,527

Rep: Reputation: 898Reputation: 898Reputation: 898Reputation: 898Reputation: 898Reputation: 898Reputation: 898
Did you set the AllowOverride ?
http://httpd.apache.org/docs/1.3/mod...#allowoverride

Kind regards
 
Old 12-28-2010, 02:51 AM   #3
MarkRaats
LQ Newbie
 
Registered: Dec 2010
Posts: 12

Original Poster
Rep: Reputation: 0
no dont use that, but no diffrence.

.passwd
---
test:sQjrqRjCfEXJI

.htaccess
---
<Directory>
AllowOverride all
AuthName "Restricted Area"
AuthType Basic
AuthUserFile /var/www/.htpasswd
AuthGroupFile /dev/null
require user test
</Directory>
 
Old 12-28-2010, 04:36 AM   #4
repo
LQ 5k Club
 
Registered: May 2001
Location: Belgium
Distribution: Arch
Posts: 8,527

Rep: Reputation: 898Reputation: 898Reputation: 898Reputation: 898Reputation: 898Reputation: 898Reputation: 898
You need to set this in your
Quote:
/etc/httpd/httpd.conf
file, and restart the daemon.
The default is set to none.

Kind regards
 
Old 12-29-2010, 02:54 AM   #5
MarkRaats
LQ Newbie
 
Registered: Dec 2010
Posts: 12

Original Poster
Rep: Reputation: 0
Maybe a stupid question...
what must i set in my httpd.conf ?
first of all, httpd.conf is (here) in /etc/apache2/

now i changed the .htaccess file in:

Code:
AuthName "Restricted Area"
AuthType Basic
AuthUserFile /var/www/.htpasswd
AuthGroupFile /dev/null
require user test
in etc/apache2/httpd.conf
Code:
<Directory /www/gitweb/>
AllowOverride all 
</Directory>
Code:
/etc/init.d/apache2 restart
 
  


Reply


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 .htpasswd plisken Linux - General 5 05-21-2006 02:44 PM
.htaccess + .htpasswd not working nazs Linux - Security 1 05-17-2006 10:28 PM
.htaccess .htpasswd issue Robin01 Linux - Newbie 4 12-24-2003 04:36 PM
About .htaccess & .htpasswd edhan Linux - Newbie 3 10-17-2003 01:16 AM
Help with .htpasswd and .htaccess MikeeX Linux - General 3 03-25-2003 11:41 AM


All times are GMT -5. The time now is 05:56 PM.

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