LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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 09-04-2009, 07:13 PM   #1
durus123
LQ Newbie
 
Registered: Dec 2006
Posts: 6

Rep: Reputation: 0
Apache and Named Virtual Hosts Giving 403 Forbidden Error


Hi

I'm running Apache 2.2.11 on Red Hat 5. I have 2 virtual hosts configured that work just fine. When I added a 3rd one, I get the HTTP 403 Forbidden error. The permissions on the relevant documentroot directories and files for each virtual host are 775.

I wondered if someone could help me get this running. Nothing I've read so far has helped.

Here are the relevant part of my httpd.conf. I've mostly taken all the defaults.

#
ServerRoot "/apps/httpd-2.2.11"

#
Listen 192.168.49.20:80
Listen 192.168.49.206:80
Listen 192.168.49.5:80
Listen 192.168.49.101:80

DocumentRoot "/apps/httpd-2.2.11/htdocs"

#
<Directory />
Options FollowSymLinks
AllowOverride None
Order deny,allow
Deny from all
</Directory>

#
<IfModule dir_module>
DirectoryIndex index.html index.php
</IfModule>

#
<FilesMatch "^\.ht">
Order allow,deny
Deny from all
Satisfy All
</FilesMatch>

Include conf/extra/httpd-vhosts.conf

Include conf/extra/httpd-ssl.conf
#
<IfModule ssl_module>
SSLRandomSeed startup builtin
SSLRandomSeed connect builtin
</IfModule>


Here is my httpd-vhosts.conf file. As I said, the first 2 virtual hosts work just fine.

NameVirtualHost 192.168.49.20:80
NameVirtualHost 192.168.49.206:80
NameVirtualHost 192.168.49.5:80
NameVirtualHost 192.168.49.101:80

<VirtualHost 192.168.49.20:80>
DocumentRoot "/apps/httpd-2.2.11/htdocs"
ServerName foo.brownstone.edu
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URL}$1
</VirtualHost>
#
<Directory "/apps/demo">
Allow from All
</Directory>

<VirtualHost 192.168.49.206:80>
ServerName demo
RedirectPermanent / https://demo.brownstone.edu
</VirtualHost>

<VirtualHost 192.168.49.206:80>
DocumentRoot "/apps/demo"
ServerName demo.brownstone.edu
</VirtualHost>
#
<Directory "/apps/helpdesk">
Options Indexes FollowSymLinks
Allow from All
</Directory>

<VirtualHost 192.168.49.5:80>
DocumentRoot "/apps/helpdesk"
ServerName helpdesk.brownstone.edu
</VirtualHost>
#
<Directory "/apps/csi">
Options Indexes FollowSymLinks
Allow from All
</Directory>

<VirtualHost 130.20.249.101:80>
DocumentRoot "/apps/csi"
ServerName csi.brownstone.edu
</VirtualHost>



Thanks.



Cathy
 
Old 09-05-2009, 05:24 AM   #2
carltm
Member
 
Registered: Jan 2007
Location: Canton, MI
Distribution: CentOS, SuSE, Red Hat, Debian, etc.
Posts: 697

Rep: Reputation: 93
Hi Cathy,

The only thing I see different on your VirtualHosts compared to mine is that
the Directory tag is not within your VirtualHost tag. Try replacing this:
Quote:
<Directory "/apps/demo">
Allow from All
</Directory>

<VirtualHost 192.168.49.206:80>
ServerName demo
RedirectPermanent / https://demo.brownstone.edu
</VirtualHost>

<VirtualHost 192.168.49.206:80>
DocumentRoot "/apps/demo"
ServerName demo.brownstone.edu
</VirtualHost>
with this:
Quote:
<VirtualHost 192.168.49.206:80>
ServerName demo
RedirectPermanent / https://demo.brownstone.edu
</VirtualHost>

<VirtualHost 192.168.49.206:80>
DocumentRoot "/apps/demo"
ServerName demo.brownstone.edu
<Directory "/apps/demo">
Allow from All
</Directory>
</VirtualHost>
 
  


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 and Named Virtual Hosts Giving 403 Forbidden Error PekinSOFT Linux - Server 2 04-15-2009 01:07 AM
Forbidden 403 error with my apache entz Linux - Software 2 12-17-2007 05:33 PM
Apache: 403 Forbidden Error daemonkl Linux - Newbie 4 10-14-2007 12:15 PM
Apache giving mysterious 403 Forbidden ktvoelker Linux - Software 5 03-14-2005 11:41 AM
apache error, 403 forbidden afrodocter Linux - Software 6 08-09-2004 08:35 PM


All times are GMT -5. The time now is 09:38 AM.

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