Visit Jeremy's Blog.
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 05-01-2008, 10:19 AM   #1
LQ Newbie
Registered: Mar 2004
Posts: 10

Rep: Reputation: 0
Angry Apache2 .htaccess and virtual hosts

Hi All,

I have been configuring my apache server and ran across a few issues, the main httpd.conf is configured to allow .htaccess and AllowOverride is set to Limit and Indexes which is what i need.

The document root which is the same as the first virtual host my .htaccess access works perfectly, Allows in when supposed to and shows the forbidden page when you cant get in

I created a second virtualhost with a different documentroot and placed a .htaccess file and it stopped didnt work, I then went ahead and placed the following in the virtual host config

<Directory /var/www/vhosts/rhc>
Options Indexes FollowSymLinks
AllowOverride Limit Indexes

and it started to work but on failed requests instead of showing the forbidden page it takes me to the default nohtml page for CentOS

my question is really.

1. the config in the httpd.conf does this only apply to the documentroot it specifies?
2. Why does it go to the nohtml page rather than show you are forbidden from accessing this page.
3. Where is the document file which shows the forbidden page !?

Many thanks!!!
Old 05-02-2008, 08:31 AM   #2
Registered: Sep 2002
Location: New Jersey, USA
Distribution: Ubuntu, Xubuntu, Debian
Posts: 62

Rep: Reputation: 16
I am no expert, but.. is there a specific ErrorDocument 403 directive for the virtual host? Show us the .htaccess file in the virtual host's web doc root.
Old 05-02-2008, 11:17 AM   #3
Registered: Feb 2006
Location: NJ, USA
Distribution: Debian
Posts: 72

Rep: Reputation: 17
What could be happening is its trying to show the 403 error page, but can't find it so it ends up showing the other one, check the other apache config files for these settings.



apache, centos, htaccess, virtualhost

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
apache2 virtual hosts dave`2005 Ubuntu 1 11-19-2007 07:17 AM
Virtual hosts on apache2 70mas Linux - Server 3 07-16-2007 02:29 AM
Apache2 - need help with virtual hosts bioalchemist Linux - Software 5 08-11-2006 01:24 PM
Apache2, SSL, 2 Virtual Hosts franticbob Linux - Software 0 04-07-2004 09:48 PM
apache2 virtual hosts viniosity Linux - Software 4 02-07-2004 12:15 AM > Forums > Linux Forums > Linux - Server

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