LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
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, 02: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 02:21 AM.
 
Old 12-27-2010, 02:55 AM   #2
repo
LQ 5k Club
 
Registered: May 2001
Location: Belgium
Distribution: Arch
Posts: 8,529

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

Kind regards
 
Old 12-28-2010, 01: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, 03:36 AM   #4
repo
LQ 5k Club
 
Registered: May 2001
Location: Belgium
Distribution: Arch
Posts: 8,529

Rep: Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899
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, 01: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



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

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 07:08 AM.

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
Open Source Consulting | Domain Registration