LinuxQuestions.org
Review your favorite Linux distribution.
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 02-18-2007, 04:09 PM   #1
natv
Member
 
Registered: Mar 2006
Posts: 59

Rep: Reputation: 15
Apache - AllowOverride ALL but .htaccess isn't allowing


Hi guys,

I'm running CentOS 4.4, Apache 2.0

I'm learning Apache from a self-taught LinuxCBT course and followed along perfectly (I think) and am stuck.

The point of this lesson was to show what this use can do with .htaccess.


This entry was in httpd.conf and everything was working fine in terms of being able to access http://192.168.1.111/personal/index.html


Alias /personal/ "/var/www/html/personal/"
<Directory /var/www/html/personal>
Order deny,allow
Deny from all
Options -Indexes
Allow from 127.0.0.1 192.168.1
AllowOverride None
</Directory>



The next part of my course said to remove the above entry from httpd.conf, and paste it into an .htaccess at /var/www/html/personal

I did that, but then I was getting Internal Server Errors. The error logs show:

[Sun Feb 18 16:35:44 2007] [alert] [client 192.168.1.101] /var/www/html/personal/.htaccess: Alias not allowed here


I removed the Alias directive and put that back into httpd.conf file and restarted apache and tried it again and this time got:

[Sun Feb 18 16:47:34 2007] [alert] [client 192.168.1.101] /var/www/html/personal/.htaccess: <Directory not allowed here


Previously, I did as the course said to do, which was to locate the entry in httpd.conf relating to:

<Directory "/var/www/html">

and change 'AllowOverride None' to 'AllowOverride ALL'

As far as I can tell I've done everything I was supposed to, but I'm getting this error and I don't know what else to try.

I do have SELinux installed in case that is relavent.



Below are the relavent entries from my httpd.conf file.

Please let me know if you have any ideas of what I can change or do to get this working.



---------------------------------------------
DocumentRoot "/var/www/html"

<Directory "/var/www/html">

#
# Possible values for the Options directive are "None", "All",
# or any combination of:
# Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
#
# Note that "MultiViews" must be named *explicitly* --- "Options All"
# doesn't give it to you.
#
# The Options directive is both complicated and important. Please see
# http://httpd.apache.org/docs-2.0/mod/core.html#options
# for more information.
#
Options Indexes FollowSymLinks

#
# AllowOverride controls what directives may be placed in .htaccess files.
# It can be "All", "None", or any combination of the keywords:
# Options FileInfo AuthConfig Limit
#
# AllowOverride None
# updated to permit non-privilaged user darkeone to manage site

AllowOverride All

#
# Controls who can get stuff from this server.
#
Order allow,deny
Allow from all

</Directory>
---------------------------------------------


Any advice would be much appreciated.

Thanks in advance,
Nathalie
 
Old 02-18-2007, 04:36 PM   #2
bathory
Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 10,909

Rep: Reputation: 1326Reputation: 1326Reputation: 1326Reputation: 1326Reputation: 1326Reputation: 1326Reputation: 1326Reputation: 1326Reputation: 1326Reputation: 1326
Quote:
[Sun Feb 18 16:47:34 2007] [alert] [client 192.168.1.101] /var/www/html/personal/.htaccess: <Directory not allowed here
You have to remove the "<Directory /var/www/html/personal>" and "</Directory>" lines from your .htaccess. That is because the .htaccess is valid for the directory you put it, so there is no need to define that directory inside .htaccess.
 
1 members found this post helpful.
Old 02-18-2007, 05:23 PM   #3
natv
Member
 
Registered: Mar 2006
Posts: 59

Original Poster
Rep: Reputation: 15
Thank you!

Thanks, that was it.

I removed the Directory lines, then it complained about the Alias and AllowOverrides lines so I removed those too and now it works.


I don't understand though why it worked on the system that the teacher is demonstrating on (RHEL 4), as he has those lines in his .htaccess and didn't get any errors.
 
Old 02-19-2007, 03:34 AM   #4
bathory
Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 10,909

Rep: Reputation: 1326Reputation: 1326Reputation: 1326Reputation: 1326Reputation: 1326Reputation: 1326Reputation: 1326Reputation: 1326Reputation: 1326Reputation: 1326
Quote:
I don't understand though why it worked on the system that the teacher is demonstrating on (RHEL 4), as he has those lines in his .htaccess and didn't get any errors.
Are you sure about that? According to apache documentation the context of this directive is "server config, virtual host", that means that it's allowed inside the main config file and inside the vhost config part.
 
1 members found this post helpful.
Old 02-19-2007, 07:25 AM   #5
natv
Member
 
Registered: Mar 2006
Posts: 59

Original Poster
Rep: Reputation: 15
.htaccess

Hi,

Lol, turns out it wasn't working for the instructor after all, he later removed those directives after having the same error I did.


Thanks for the help on this



Nat

Last edited by natv; 02-19-2007 at 07:32 AM.
 
  


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
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
Help with Apache and .htaccess spud Programming 1 03-17-2005 11:52 AM
Apache/2.0.51 .htaccess 2782d4 Linux - Software 2 02-08-2005 12:12 PM
.htaccess in apache 2 im1crazyassmofo Linux - Software 1 04-04-2003 01:50 AM


All times are GMT -5. The time now is 01:27 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration