Apache Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsSystem AdministrationApache Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old March 3rd, 2002, 09:41 PM
kingjr3 kingjr3 is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2001
Posts: 11 kingjr3 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via Yahoo to kingjr3
Virtual Hosting - seems simple?

Okay. I have searched this forum but have had no luck finding answers.

Allow me to introduce my setup as this is pretty complicated.

I have a "static" IP (24.160.xxx.xxx) that is assigned to my cable modem. I am using a Linksys router to share the connection and have a redhat 7.1 client running 1.3.20 with the assigned IP of 192.168.1.101. I have configured the router/firewall to forward ALL port 80 requests to the redhat box.

I own a domain name that I am using mydomain.com to manage. I have enabled IP forwarding, pointing my domain (lydiascatering.com) to the IP (24.160.xxx.xxx).

I have also tried to configure Virtual Hosting in apache and the problem I am having is that EVERY request is using the virtual host directive's docroot. I only want the domain name request to use the docroot of the virtual host directive.

here is the directive snippet.
...
NameVirtualHost 192.168.1.101
...
<VirtualHost 192.168.1.101>
ServerName www.lydiascatering.com
ServerAlias lydiascatering.com cater
ServerAdmin webmaster@lydiascatering.com
ErrorLog logs/lydiascatering.com-error_log
CustomLog logs/lydiascatering.com-access_log common
DocumentRoot /home/lydia/www
</VirtualHost>

I have a different docroot defined outside of the VirtualHost section. But am not able to access that.

So all 192.168.1.101, 24.160.xxx.xxx, and www.lydiascatering.com are using the same docroot, and I only want the domain request to.

Does this make sense? Can anyone help. I would be more than willing to work offline with someone more knowledgeable. Email me at kingjr3@yahoo.com

Thanks in advance. Please help. My goal is to host many domains from my house, and I first need to get ONE working correctly.

Reply With Quote
  #2  
Old March 3rd, 2002, 11:24 PM
freebsd freebsd is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2001
Posts: 5 freebsd User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
>> I am having is that EVERY request is using the virtual host directive's docroot

How many <VirtualHost> block do you currently have? What are they? Note, if you have just one, then that overrides what you defined in global context, and is really redundant in doing so because you don't have a vhost, it really is your default host.

>> NameVirtualHost 192.168.1.101

It would make your life easier if you just use NameVirtualHost * and <VirtualHost *> to begin with.

Reply With Quote
  #3  
Old March 4th, 2002, 11:43 AM
kingjr3 kingjr3 is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2001
Posts: 11 kingjr3 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via Yahoo to kingjr3
one

I only have one Virtual host block. I will have multiple in the future.

I did change it to *.

The thing is I want the domain based request to use the vhost block and the IP based reqests to use the default. Is this even possible? or is there a way I can differentiate with another vhost block ? what will happen if the request doesn't match any of the servernames?

I did read that if the client does not pass the host information (via the host header) then the first virtualhost block will ALWAYS be used. I am guessing this is the case because this is likely since I am using the router to direct the request and a domain management service to route the request to my IP.

Reply With Quote
  #4  
Old March 5th, 2002, 12:19 AM
freebsd freebsd is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2001
Posts: 5 freebsd User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
>> I want the domain based request to use the vhost block and the IP based reqests to use the default

You don't appear to have more than 1 IP, therefore you can't use IP-based. As far ad Name-based, the 1st <VirtualHost> has highest priority.

>> I will have multiple in the future

Then configure <VirtualHost> when you have them. Currently you just can't.

Reply With Quote
  #5  
Old March 6th, 2002, 01:18 PM
kingjr3 kingjr3 is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2001
Posts: 11 kingjr3 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via Yahoo to kingjr3
thanks

Makes sense.

All that I did was add
<Virtualhost *>
DocumentRoot /some/other/docroot
</Virtualhost>

before my other vhost section.

and this served as my "default".

Thanks again Freebsd.

Reply With Quote
  #6  
Old March 6th, 2002, 02:05 PM
freebsd freebsd is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2001
Posts: 5 freebsd User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
>> before my other vhost section

Like I said, the very 1st <VirtualHost> is the default and has higher priority.

When adding additional <VirtualHost *>, at the minimum you need to specify a DocumentRoot and ServerName.

Reply With Quote
Reply

Viewing: Dev Shed ForumsSystem AdministrationApache Development > Virtual Hosting - seems simple?


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway