Re: VirtualHost / subdomain problems

This is a discussion on Re: VirtualHost / subdomain problems within the Apache forums in Application Servers & Tools category; On Sat, Nov 8, 2008 at 5:52 AM, Giancarlo Rivas <giaym.mail @ gmail.com> wrote: > NameVirtualHost > ============================= > Originally I didn't have NameVirtualHost but now I have this line before the > virtualhost definitions: > NameVirtualHost <static ip address>:80 > > I can't seem to do what everyone can, I hope I am just missing something > simple. What you missed is that the value you give the NameVirtualHost directive must be identical to what you use in your <VirtualHost> blocks. So if your NameVirtualHost statement looks like this: NameVirtualhost 123.4.5.6:80 Than your <VirtualHosts> blocks must start like this: ...

Go Back   Application Development Forum > Application Servers & Tools > Apache

Object Mix

Register FAQ Calendar Search Today's Posts Mark Forums Read
  #1  
Old 11-08-2008, 04:04 AM
Krist van Besien
Guest
 
Default Re: VirtualHost / subdomain problems

On Sat, Nov 8, 2008 at 5:52 AM, Giancarlo Rivas <giaym.mail@gmail.com> wrote:

> NameVirtualHost
> =============================
> Originally I didn't have NameVirtualHost but now I have this line before the
> virtualhost definitions:
> NameVirtualHost <static ip address>:80
>
> I can't seem to do what everyone can, I hope I am just missing something
> simple.


What you missed is that the value you give the NameVirtualHost
directive must be identical to what you use in your <VirtualHost>
blocks.

So if your NameVirtualHost statement looks like this:

NameVirtualhost 123.4.5.6:80

Than your <VirtualHosts> blocks must start like this:
<VirtualHost 123.4.5.6:80>

Putting an IP address in the NameVirtualHost directive is usually not
needed, and putting the static IP addres of the router in there is
certainly not going to work. The only IP address that would make sense
here would be the local address of the machine apache runs on. You
usually don't need to worry about your apache server's internal
address though.

The best solution usually is to have this:

NameVirtualHost *:80

<VirtualHost *:80>
# First, default virtualhost.
....
</VirtualHost *:80>
<VirtualHost *:80>
# Second host...
....
<VirtualHost>

and so on.

To test things you can start apache like this:

httpd -S

This should list all the virtualhosts apache found in the config.

HTH,

Krist


--
krist.vanbesien@gmail.com
krist@vanbesien.org
Bremgarten b. Bern, Switzerland
--
A: It reverses the normal flow of conversation.
Q: What's wrong with top-posting?
A: Top-posting.
Q: What's the biggest scourge on plain text email discussions?

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
" from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Reply With Quote
  #2  
Old 11-09-2008, 01:08 PM
Giancarlo Rivas
Guest
 
Default Re: VirtualHost / subdomain problems

Thank you very much, it is working now.

On Sat, Nov 8, 2008 at 4:04 AM, Krist van Besien
<krist.vanbesien@gmail.com> wrote:
> On Sat, Nov 8, 2008 at 5:52 AM, Giancarlo Rivas <giaym.mail@gmail.com> wrote:
>
>> NameVirtualHost
>> =============================
>> Originally I didn't have NameVirtualHost but now I have this line before the
>> virtualhost definitions:
>> NameVirtualHost <static ip address>:80
>>
>> I can't seem to do what everyone can, I hope I am just missing something
>> simple.

>
> What you missed is that the value you give the NameVirtualHost
> directive must be identical to what you use in your <VirtualHost>
> blocks.
>
> So if your NameVirtualHost statement looks like this:
>
> NameVirtualhost 123.4.5.6:80
>
> Than your <VirtualHosts> blocks must start like this:
> <VirtualHost 123.4.5.6:80>
>
> Putting an IP address in the NameVirtualHost directive is usually not
> needed, and putting the static IP addres of the router in there is
> certainly not going to work. The only IP address that would make sense
> here would be the local address of the machine apache runs on. You
> usually don't need to worry about your apache server's internal
> address though.
>
> The best solution usually is to have this:
>
> NameVirtualHost *:80
>
> <VirtualHost *:80>
> # First, default virtualhost.
> ...
> </VirtualHost *:80>
> <VirtualHost *:80>
> # Second host...
> ...
> <VirtualHost>
>
> and so on.
>
> To test things you can start apache like this:
>
> httpd -S
>
> This should list all the virtualhosts apache found in the config.
>
> HTH,
>
> Krist
>
>
> --
> krist.vanbesien@gmail.com
> krist@vanbesien.org
> Bremgarten b. Bern, Switzerland
> --
> A: It reverses the normal flow of conversation.
> Q: What's wrong with top-posting?
> A: Top-posting.
> Q: What's the biggest scourge on plain text email discussions?
>
> ---------------------------------------------------------------------
> The official User-To-User support forum of the Apache HTTP Server Project.
> See <URL:http://httpd.apache.org/userslist.html> for more info.
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
> " from the digest: users-digest-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
>
>


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
" from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Reply With Quote
Reply


Thread Tools
Display Modes


All times are GMT -5. The time now is 04:24 PM.


Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0
vB Ad Management by =RedTyger=

In an effort to better serve ads to our visitors, cookies are used on objectmix.com. For more information, check out our Privacy Policy.