Networking Forums

Networking Forums > Computer Networking > Linux Networking > Apache virtualhost issue

Reply
Thread Tools Display Modes

Apache virtualhost issue

 
 
Jon C
Guest
Posts: n/a

 
      11-12-2004, 04:28 PM
I'm actually using FreeBSD but that really shouldn't matter.

I'm trying to get subdomains to work. If I add this to my httpd.conf,
I get "Forbidden. You don't have permission to access / on this
server." for domain.com and blah.domain.com... *but* subdirectories
all work. However, blah.domain.com subdirectories are still coming
from the main apache directory, not /usr/home/blah/public_html

<VirtualHost *>
DocumentRoot "/usr/home/blah/public_html"
ServerName blah.domain.com
ErrorLog /usr/home/blah/apache_error.log
CustomLog /usr/home/blah/apache_access.log common
</VirtualHost>

Thoughts? Please?
 
Reply With Quote
 
 
 
 
Davide Bianchi
Guest
Posts: n/a

 
      11-12-2004, 04:41 PM
On 2004-11-12, Jon C <(E-Mail Removed)> wrote:
> I get "Forbidden. You don't have permission to access / on this
> server."


To be served by apache the "DocumentRoot" and all the parents
directories have to be world-executable and world-readable.
Check if /usr and /usr/home and /usr/home/blah are
rwxr-xr-x.
Also, do you have an index.html file in there, is that index.html
file world-readable?

Davide

--
An Emacs reference mug is what I want. It would hold ten gallons of coffee.
---- Steve VanDevender
 
Reply With Quote
 
Jon C
Guest
Posts: n/a

 
      11-12-2004, 08:06 PM
Davide Bianchi wrote:

> On 2004-11-12, Jon C <(E-Mail Removed)> wrote:
>
>>I get "Forbidden. You don't have permission to access / on this
>>server."

>
>
> To be served by apache the "DocumentRoot" and all the parents
> directories have to be world-executable and world-readable.
> Check if /usr and /usr/home and /usr/home/blah are
> rwxr-xr-x.
> Also, do you have an index.html file in there, is that index.html
> file world-readable?
>
> Davide
>


Yes to both.
 
Reply With Quote
 
Michael Heiming
Guest
Posts: n/a

 
      11-12-2004, 08:27 PM
In comp.os.linux.networking Jon C <(E-Mail Removed)>:
> I'm actually using FreeBSD but that really shouldn't matter.


> I'm trying to get subdomains to work. If I add this to my httpd.conf,
> I get "Forbidden. You don't have permission to access / on this
> server." for domain.com and blah.domain.com... *but* subdirectories
> all work. However, blah.domain.com subdirectories are still coming
> from the main apache directory, not /usr/home/blah/public_html


> <VirtualHost *>
> DocumentRoot "/usr/home/blah/public_html"
> ServerName blah.domain.com
> ErrorLog /usr/home/blah/apache_error.log
> CustomLog /usr/home/blah/apache_access.log common
> </VirtualHost>


> Thoughts? Please?


You probably need something like this in the <Directory ...>
directive(s) for your VirtualHost:

Order Allow,Deny
Allow from all

You seem to lack any <Directory ...> directive for your
VirtualHost completely, no wonder access is denied, if there's
nothing apache can deliver.

I'd suggest checking the apache docs and getting a good book if
you are serious about apache

Good luck

BTW
Remains unclear what this has to do with Linux/networking?

--
Michael Heiming (X-PGP-Sig > GPG-Key ID: EDD27B94)
mail: echo (E-Mail Removed) | perl -pe 'y/a-z/n-za-m/'
#bofh excuse 81: Please excuse me, I have to circuit an AC
line through my head to get this database working.
 
Reply With Quote
 
Jon C
Guest
Posts: n/a

 
      11-12-2004, 10:00 PM
Michael Heiming wrote:

> In comp.os.linux.networking Jon C <(E-Mail Removed)>:
>
>>I'm actually using FreeBSD but that really shouldn't matter.

>
>
>>I'm trying to get subdomains to work. If I add this to my httpd.conf,
>>I get "Forbidden. You don't have permission to access / on this
>>server." for domain.com and blah.domain.com... *but* subdirectories
>>all work. However, blah.domain.com subdirectories are still coming
>>from the main apache directory, not /usr/home/blah/public_html

>
>
>><VirtualHost *>
>> DocumentRoot "/usr/home/blah/public_html"
>> ServerName blah.domain.com
>> ErrorLog /usr/home/blah/apache_error.log
>> CustomLog /usr/home/blah/apache_access.log common
>></VirtualHost>

>
>
>>Thoughts? Please?

>
>
> You probably need something like this in the <Directory ...>
> directive(s) for your VirtualHost:
>
> Order Allow,Deny
> Allow from all
>
> You seem to lack any <Directory ...> directive for your
> VirtualHost completely, no wonder access is denied, if there's
> nothing apache can deliver.
>
> I'd suggest checking the apache docs and getting a good book if
> you are serious about apache
>
> Good luck
>
> BTW
> Remains unclear what this has to do with Linux/networking?
>


I have a <directory> section for /usr/home/*/public_html which should
take care of that, no? Besides, I get access denied for the root page
as well as the virtualhost. The virtualhost doesn'te ven seem to work
at all as blah.domain.com/test points to my test/ in the root directory,
not in /usr/home/blah/public_html/
 
Reply With Quote
 
Davide Bianchi
Guest
Posts: n/a

 
      11-13-2004, 09:15 AM
On 2004-11-12, Jon C <(E-Mail Removed)> wrote:
> Yes to both.


Ok, another thing: do you have a NameVirtualHost * in your
config?
Davide

--
Linux: the dot in "dot org". -- From a Slashdot.org post
 
Reply With Quote
 
Jon C
Guest
Posts: n/a

 
      11-13-2004, 02:43 PM
Davide Bianchi wrote:

> On 2004-11-12, Jon C <(E-Mail Removed)> wrote:
>
>>Yes to both.

>
>
> Ok, another thing: do you have a NameVirtualHost * in your
> config?
> Davide
>


Yes.

When I change the directory to /usr/local/data2, the entire website
(domain.com gets served up from /usr/local/data2.

This is what I have right now:

NameVirtualHost *

<VirtualHost *>
DocumentRoot /usr/local/www/data2
ServerName data2.domain.com
</VirtualHost>

Requests to domain.com get served from data2, despite the fact that I have:

ServerName domain.com
DocumentRoot /usr/local/www/data

In the beginning of httpd.conf


What am I missing?
 
Reply With Quote
 
Jon C
Guest
Posts: n/a

 
      11-13-2004, 03:12 PM
Jon C wrote:

> I'm actually using FreeBSD but that really shouldn't matter.
>
> I'm trying to get subdomains to work. If I add this to my httpd.conf,
> I get "Forbidden. You don't have permission to access / on this
> server." for domain.com and blah.domain.com... *but* subdirectories
> all work. However, blah.domain.com subdirectories are still coming
> from the main apache directory, not /usr/home/blah/public_html
>
> <VirtualHost *>
> DocumentRoot "/usr/home/blah/public_html"
> ServerName blah.domain.com
> ErrorLog /usr/home/blah/apache_error.log
> CustomLog /usr/home/blah/apache_access.log common
> </VirtualHost>
>
> Thoughts? Please?


I actually got it to work by adding this:

<VirtualHost *>
ServerName www.domain.com
DocumentRoot /usr/local/www/data
</VirtualHost>

Go figure.

Thanks for the help. Anyone want to try to explain why adding that made
http://domain.com work properly? Before I added that http://domain.com
was served by the DocumentRoot specified in the quoted VirtualHost.

Jon
 
Reply With Quote
 
 
 
Reply

Thread Tools
Display Modes

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
IIS Vs Apache NeWGeeK Windows Networking 4 06-22-2009 03:04 PM
Apache mrdjmagnet@aol.com Linux Networking 1 12-14-2008 01:05 AM
No logon server available - Windows 2003 Trust Issue? NS Issue? newsgroups.jd@gmail.com Windows Networking 15 08-21-2006 07:38 PM
Senao 2611CB3+Deluxe setup issue, network configuration issue, orboth? RWM Wireless Internet 0 01-27-2006 06:00 PM
IIS vs Apache...???? gerry Home Networking 9 09-07-2004 07:15 PM



1 2 3 4 5 6 7 8 9 10 11