LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 06-04-2008, 04:19 AM   #1
zerocool22
Member
 
Registered: Feb 2008
Posts: 95

Rep: Reputation: 15
Apache .htaccess error


Hey, i just copied a .htaccess file to a folder from my apache, and when i try to acces it i get an internal server error.

Wed Jun 04 11:11:35 2008] [alert] [client ip] /home/test/.htaccess: AllowOverride not allowed here

.htaccess
Quote:
AuthType Basic
AuthName "Give in Kerb 5 Username and Password Required active directory"
Require valid-user

AllowOverride None
When i set this to my httpd.conf it does work, just the .htaccess files are failing me.

Should i post my httpd.conf?

Last edited by zerocool22; 06-04-2008 at 04:32 AM.
 
Old 06-04-2008, 04:56 AM   #2
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
The AllowOverride is available only in a <Directory...>...</Directory> section. If you want to restrict access in a directory using .htaccess, then you must put:
Code:
AllowOverride AuthConfig
inside that <Directory> section in httpd.conf.
 
Old 06-04-2008, 04:58 AM   #3
zerocool22
Member
 
Registered: Feb 2008
Posts: 95

Original Poster
Rep: Reputation: 15
So change .htaccess to this?
Quote:
AuthType Basic
AuthName "Give in Kerb 5 Username and Password Required active directory"
Require valid-user

AllowOverride Authconfig
Then in httpd.conf comment out all <directory> allowoveride all <...>?
 
Old 06-04-2008, 05:03 AM   #4
zerocool22
Member
 
Registered: Feb 2008
Posts: 95

Original Poster
Rep: Reputation: 15
hmm it dont work, now it says:

[Wed Jun 04 12:01:18 2008] [error] [test 10.20.1.28] Directory index forbidden by rule: /home/
 
Old 06-04-2008, 05:53 AM   #5
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
You didn't understand what I've told you.
If you want to restrict access to a directory (i.e. /home/test) by asking username/password, then you have to put .htaccess in that directory. The .htaccess should contain:
Code:
AuthType Basic
AuthName "Give in Kerb 5 Username and Password Required active directory"
Require valid-user
AuthUserFile    /path/to/ht-passwd
You need the path to the file that htpasswd creates passwords for the users that can access the protected directory.
In httpd.conf you should add (or edit if it exists) the following section:
Code:
<Directory /home/test>
...
AllowOverride Authconfig
...
</Directory>
 
Old 06-04-2008, 06:01 AM   #6
zerocool22
Member
 
Registered: Feb 2008
Posts: 95

Original Poster
Rep: Reputation: 15
ow, yeah if i put it in httpd.conf it allways work, but i have to do 380 folders, so i want to use .htaccess files to prevent anything changing in httpd.conf.
 
Old 06-04-2008, 06:16 AM   #7
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
What exactly do you want to do with .htaccess? You can put the AllowOverride directive in the main <Directory ..>section and then use .htaccess on a per directory basis
 
Old 06-04-2008, 06:18 AM   #8
zerocool22
Member
 
Registered: Feb 2008
Posts: 95

Original Poster
Rep: Reputation: 15
So only the user from active directory which has acces to that specific folder gets to see the contents of that folder with apache. So i dont know for sure how to set my httpd.conf up, the authentication part works just fine. But the reading of .htaccess files is another thing. I have set up a folder with a .htaccess but it says AllowOverride not allowed here.
 
  


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
Apache 2.0.52 and .htaccess ZC1 Linux - General 3 05-20-2006 10:38 AM
Apache and .htaccess jamluv Linux - Security 9 06-03-2005 02:53 PM
Apache/2.0.51 .htaccess 2782d4 Linux - Software 2 02-08-2005 12:12 PM
apache .htaccess linuxanswer Linux - General 1 05-01-2004 04:20 PM
.htaccess in apache 2 im1crazyassmofo Linux - Software 1 04-04-2003 01:50 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 10:02 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