LinuxQuestions.org
Go Job Hunting at the LQ Job Marketplace
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 04-14-2009, 01:41 PM   #1
PekinSOFT
LQ Newbie
 
Registered: Apr 2009
Location: Central Illinois
Distribution: Slackware 12.2
Posts: 2

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


Hey All,

First off, I have checked the similar threads and they were of no help. Further, I have read all of the Apache documentation and followed it to the letter, with no luck. I've also searched the web until my fingers have bled, without finding a clue.

So, here's the deal, I'm trying to host my own website, a website for my church and a website for a local ministry involving multiple churches, all from my one little system. I've got DNS through DynDNS.org pointing to:
pekinsoft.homelinux.org
cbpekin.homelinux.org
hope.homelinux.org
respectively.

No matter what advice I've followed, I continually get a "403 Forbidden" message for each and everyone of these web hops. I am running on Slackware 12.2, using Apache 2.2.10. Slackware breaks all configurations down to specific areas by having general configuration in the /etc/httpd/httpd.conf file and configuration for things like Virtual Hosts in a separate file, such as /etc/httpd/extra/httpd-vhosts.conf. I've configured the Virtual Hosts both in the httpd.conf file (to no avail) and then in the extra/httpd-vhosts.conf file (also, to no avail), but NEVER in both at the same time for fear of throwing the server daemon into conniptions.

My Virtual Hosts configuration file is as follows:

#
# Virtual Hosts
#
# If you want to maintain multiple domains/hostnames on your
# machine you can setup VirtualHost containers for them. Most configurations
# use only name-based virtual hosts so the server doesn't need to worry about
# IP addresses. This is indicated by the asterisks in the directives below.
#
# Please see the documentation at
# <URL:http://httpd.apache.org/docs/2.2/vhosts/>
# for further details before you try to setup virtual hosts.
#
# You may use the command line option '-S' to verify your virtual host
# configuration.

#
# Use name-based virtual hosting.
#
NameVirtualHost 192.168.1.2:80

#
# VirtualHost example:
# Almost any Apache directive may go into a VirtualHost container.
# The first VirtualHost section is used for all requests that do not
# match a ServerName or ServerAlias in any <VirtualHost> block.
#
<VirtualHost 192.168.1.2:80>
ServerAdmin PekinSOFT@gmail.com
DocumentRoot "/var/www/htdocs/pekinsoft"
ServerName pekinsoft.homelinux.org
ServerAlias pekinsoft
ErrorLog "/var/log/httpd/pekinsoft-error_log"
CustomLog "/var/log/httpd/pekinsoft-access_log" common

<Directory "/var/www/htdocs/pekinsoft">
Options +Indexes FollowSymLinks
AllowOverride None
Order allow,deny
</Directory>

<IfModule dir_module>
DirectoryIndex index.php index.html index.htm default.php default.html default.htm
</IfModule>

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

<VirtualHost 192.168.1.2:80>
ServerAdmin BrknShldr@gmail.com
DocumentRoot "/var/www/htdocs/cbpekin"
ServerName cbpekin.homelinux.org
ErrorLog "/var/log/httpd/cbpekin-error_log"
CustomLog "/var/log/httpd/cbpekin-access_log" common

<Directory "/var/www/htdocs/cbpekin">
Options +Indexes FollowSymLinks
AllowOverride None
Order allow,deny
</Directory>

<IfModule dir_module>
DirectoryIndex index.php index.html index.htm default.php default.html default.htm
</IfModule>

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

<VirtualHost 192.168.1.2:80>
ServerAdmin BrknShldr@gmail.com
DocumentRoot "/var/www/htdocs/hope"
ServerName hope.homelinux.org
ErrorLog "/var/log/httpd/hope-error_log"
CustomLog "/var/log/httpd/hope-access_log" common

<Directory "/var/www/htdocs/hope">
Options +Indexes FollowSymLinks
AllowOverride None
Order allow,deny
</Directory>

<IfModule dir_module>
DirectoryIndex index.php index.html index.htm default.php default.html default.htm
</IfModule>

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

My httpd.conf calls this file, thus:

# Virtual hosts
Include /etc/httpd/extra/httpd-vhosts.conf

The permissions on my directories are: owner-rwx; group-rwx; world-r-x. It is so for all subfolders as well. I read on one site to change the ownership of the server document root to the same user the server runs as ('apache' on my system) and I tried this, but it did not work. I have set the group on my document root to a group of my own design to allow me to edit files directly from my user account and I have also added the user 'apache' to that group, again to no avail.

I have been working on this problem for about 3 weeks now and am getting very frustrated, though the phrase "give it up" is NOT in my vocabulary. My pastor asks me every week if the site is on the internet and I am tired of telling him no. The site is almost completely written, but I can't seem to get my server to cooperate.

Any help that you all can give me is very gratefully appreciated! I look forward to finding out how much of an idiot I truly am for not being able to get this working. I am pretty sure that I am overlooking something simple.

By the way, the error log has not been very helpful. I get the same message again and again which boils down to "the user can't do that." The message is:

[Tue Apr 14 12:05:47 2009] [error] [client 12.215.62.55] client denied by server configuration: /var/www/htdocs/cbpekin/

Also, if I point my browser to "http://localhost/", I get the default "It Works!" page, so I know that my server is running and this is something to do with the Virtual Hosts configuration.

Thanks again for any help you all can give.

Cheers,

Sean Carrick
PekinSOFT Systems
 
Old 04-14-2009, 05:28 PM   #2
bathory
Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 10,975

Rep: Reputation: 1343Reputation: 1343Reputation: 1343Reputation: 1343Reputation: 1343Reputation: 1343Reputation: 1343Reputation: 1343Reputation: 1343Reputation: 1343
Try to add "Allow from all" after "Order allow,deny" and see if it helps.
 
Old 04-15-2009, 02:07 AM   #3
PekinSOFT
LQ Newbie
 
Registered: Apr 2009
Location: Central Illinois
Distribution: Slackware 12.2
Posts: 2

Original Poster
Rep: Reputation: 0
Thumbs up

bathory,

Thank you very much! That did the trick...I now have virtual hosts that are actually working. I truly can't thank you enough.

Cheers,

Sean Carrick
PekinSOFT Systems
 
  


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
Forbidden 403 error with my apache entz Linux - Software 2 12-17-2007 06:33 PM
Apache: 403 Forbidden Error daemonkl Linux - Newbie 4 10-14-2007 01:15 PM
Apache giving mysterious 403 Forbidden ktvoelker Linux - Software 5 03-14-2005 12:41 PM
apache error, 403 forbidden afrodocter Linux - Software 6 08-09-2004 09:35 PM
apache 403 error forbidden? bulliver Linux - General 4 01-31-2003 08:47 AM


All times are GMT -5. The time now is 11:00 PM.

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