LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   Apache and Named Virtual Hosts Giving 403 Forbidden Error (https://www.linuxquestions.org/questions/linux-server-73/apache-and-named-virtual-hosts-giving-403-forbidden-error-752784/)

durus123 09-04-2009 07:13 PM

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

carltm 09-05-2009 05:24 AM

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>


All times are GMT -5. The time now is 01:35 AM.