This is part of The Pile, a partial archive of some open source mailing lists and newsgroups.
comp.infosystems.www.servers.unix
From: "Erik Alvar" <ealvar@netzero.net.spamfree>
Subject: Re: Virtual Hosting not working.
Date: Mon, 11 Sep 2000 13:41:15 -0500
"Leviathan" <jsheen@leviathanstudios.com> wrote:
> Okay, I'm at my wit's end (No, not much of a trip!)
>
> Apache seems to be up and running, no problem.
>
> _But!_
>
> Virtual Hosting seems not to be working on it.
>
> Here's the "Virtual Hosting" section of my httpd.conf:
>
> ### Section 3: Virtual Hosts
> #
> # VirtualHost: If you want to maintain multiple domains/hostnames on
> your
> # machine you can setup VirtualHost containers for them.
> # Please see the documentation at
> <URL:http://www.apache.org/docs/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.
>
> #
> # If you want to use name-based virtual hosts you need to define at
> # least one IP address (and port number) for them.
> #
> #NameVirtualHost 12.34.56.78:80
> #NameVirtualHost 12.34.56.78
> NameVirtualHost 209.6.82.100
>
> #
> # VirtualHost example:
> # Almost any Apache directive may go into a VirtualHost container.
> #
> #<VirtualHost ip.address.of.host.some_domain.com>
> # ServerAdmin webmaster@host.some_domain.com
> # DocumentRoot /www/docs/host.some_domain.com
> # ServerName host.some_domain.com
> # ErrorLog logs/host.some_domain.com-error_log
> # CustomLog logs/host.some_domain.com-access_log common
> #</VirtualHost>
>
> #leviathanstudios.com
> <VirtualHost 209.6.82.100>
> ServerAdmin jsheen@leviathanstudios.com
> ServerName www.leviathanstudios.com
> ServerAlias leviathanstudios.com
> DocumentRoot /usr/home/jsheen/public_html/
> Options All
> AddHandler cgi-script .cgi
> ScriptAlias /cgi-bin/ /usr/home/jsheen/cgi_bin/
> TransferLog /usr/home/jsheen/access.log
> ErrorLog /usr/home/jsheen/error.log
> </VirtualHost>
>
> #<VirtualHost _default_:*>
> #</VirtualHost>
>
> Note that my <VirtualHost 209.6.82.100> line has also been:
>
> <VirtualHost www.leviathanstudios.com>
>
> In both cases, it remains the same: Going to "www.leviathanstudios.com"
> brings you the root directory, not to my directory.
>
> Is there something that has to be set prior to the "Virtual Hosting"
> section of my httpd.conf to allow VH to work?
>
> (For the perusal of interested parties, my httpd.conf file can be seen
> at:
>
> http://www.gweep.net/~jsheen/httpd.conf.HELP
>
> if you want to check it out and see something prior to the above.)
What do you have for the 'BindAddress' in your httpd.conf?
I had similar problems until I put in the IP I wanted
apache to listen on.
Also, under the main config (not the VirtualHost config)
what is your 'ServerName'? Does it conflict with your
'VirtualHost' 'Servername'?
===
From: Shrik Aithala <shrik@mail.utexas.edu>
Subject: Virtual Hosts with web forwarding services
Date: Mon, 11 Sep 2000 18:12:36 -0500
Hi, hope someone can help me out.
I am using a free web forwarding service (DHS.org) that forwards all
requests from the site xyz.home.dhs.org to the site
myserver.com/~myusername/ (myserver.com is an IRIX running Apache 1.3.9)
This even passes on the subdirectory names ie xyz.home.dhs.org/abc
becomes myserver.com/~myusername/abc
However the url indicator in the browser changes to the myserver.com
address. How can I prevent this from happening? I could change the
settings at dhs.org to enable "cloaking" but this would just insert a
frame in the page, and I dont want to do that. I want all clients coming
to myserver.com/~myusername/abc by any means (through dhs or directly)
to see the url xyz.home.dhs.org/abc
I have a feeling that a very simple solution exists by using Virtual
Host in my Apache httpd.conf file but I'm just not able to get it right.
===
From: "Joshua Slive" <slive+news@finance.commerce.ubc.ca>
Subject: Re: Virtual Hosts with web forwarding services
Date: 11 Sep 2000 23:35:51 GMT
Shrik Aithala <shrik@mail.utexas.edu> wrote:
> Hi, hope someone can help me out.
> I am using a free web forwarding service (DHS.org) that forwards all
> requests from the site xyz.home.dhs.org to the site
> myserver.com/~myusername/ (myserver.com is an IRIX running Apache 1.3.9)
> This even passes on the subdirectory names ie xyz.home.dhs.org/abc
> becomes myserver.com/~myusername/abc
> However the url indicator in the browser changes to the myserver.com
> address. How can I prevent this from happening? I could change the
> settings at dhs.org to enable "cloaking" but this would just insert a
> frame in the page, and I dont want to do that. I want all clients coming
> to myserver.com/~myusername/abc by any means (through dhs or directly)
> to see the url xyz.home.dhs.org/abc
> I have a feeling that a very simple solution exists by using Virtual
> Host in my Apache httpd.conf file but I'm just not able to get it right.
Nope. You can't do this. Otherwise, any site could claim to be any
other site. Do you really want any old site be able to claim to be
microsoft.com, or whitehouse.gov?
There are two ways that I know of to serve content from one site while
making it appear to come from another site. Both involve the request
initially going to the "other" site (so the whitehouse.gove example
won't work):
1. Frames. As you mentioned, that is a pretty ugly solution.
2. Proxying. The "other" site must actually grab the content from
your site and serve it back to the client as if it was its own.
This is usually called a "reverse proxy".
===
From: "Erik Alvar" <ealvar@netzero.net.spamfree>
Subject: Re: Virtual Hosts with web forwarding services
Date: Tue, 12 Sep 2000 15:25:14 -0500
"Shrik Aithala" <shrik@mail.utexas.edu> wrote:
> I am using a free web forwarding service (DHS.org) that forwards all
> requests from the site xyz.home.dhs.org to the site
> myserver.com/~myusername/ (myserver.com is an IRIX running Apache 1.3.9)
> This even passes on the subdirectory names ie xyz.home.dhs.org/abc
> becomes myserver.com/~myusername/abc
>
> However the url indicator in the browser changes to the myserver.com
> address. How can I prevent this from happening? I could change the
> settings at dhs.org to enable "cloaking" but this would just insert a
> frame in the page, and I dont want to do that. I want all clients coming
> to myserver.com/~myusername/abc by any means (through dhs or directly)
> to see the url xyz.home.dhs.org/abc
>
> I have a feeling that a very simple solution exists by using Virtual
> Host in my Apache httpd.conf file but I'm just not able to get it right.
The frames solution really isn't that ugly. I have used the following
and it works fine:
This is what I use...
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<HTML>
<HEAD>
<TITLE>Cloaked Page Title</TITLE>
<META name="description" content="Cloaked page, URL will
stay the same regardless of links clicked">
</HEAD>
<frameset rows="100%,*" frameborder="0" framespacing="0" border="0">
<frame name="FreeSite" src="http://freesite.com/homepage" marginwidth="0"
marginheight="0" frameborder="0" noresize>
<noframes>
<a href="http://freesite.com/homepage"> http://freesite.com/homepage if you
don't have frames</a>
</noframes>
</frameset>
</HTML>
===
From: efflandt@xnet.com (David Efflandt)
Subject: Re: virtual hosting for internal testing
Date: Mon, 11 Sep 2000 23:36:09 +0000 (UTC)
On Sun, 10 Sep 2000 20:24:52 +0200, AvA <ava@localhost.com> wrote:
>im a quit new at linux and apache...
>i want to try it out without connecting to the internet
>
>is it possible to create a virtual host for my local machine so i can test
>how it works?
Yes, just set up name or IP virtual hosts using any unused 127.x.x.x IP's
(other than localhost) or the IP for your network card and put the virtual
hostnames or aliases in /etc/hosts. I have done that to test if both name
and IP based vhosts work simultaniously (they do).
===
From: "Paul Gronke" <gronke@duke.edu>
Subject: Name Based Virtual Hosts, Apache
Date: Tue, 12 Sep 2000 23:21:04 -0400
Sorry to repost this query, but I have looked at the documentation and
reviewed previous posts on this topic. I must be doing something really
basic incorrectly.
Host machine = 152.3.32.10
Domain name = gronke.poli.duke.edu
Hosting two web servers:
gronke.com
www.webofpolitics.com
Both point to 152.3.32.10
Ok, so I have added this to the end of the /etc/httpd/conf/httpd.conf file:
NameVirtualHost 152.3.32.10
<VirtualHost 152.3.32.10>
ServerName gronke.com
DocumentRoot /home/gronke.com/public_html
</VirtualHost>
<VirtualHost 152.3.32.10>
ServerName www.webofpolitics.com
DocumentRoot /home/webpol/public_html
</VirtualHost>
And changed nothing else. I put test index.html files in each directory,
yet when I make this change to the file, the server gives back that rather
generic "System Admin has changed this Apache site, contact that person to
see what he has screwed up."
I must be missing something really basic. Help?
===
From: "James Leone" <webmaster@hollywoodandvine.com>
Subject: Re: Name Based Virtual Hosts, Apache
Date: 13 Sep 2000 21:13:35 GMT
"Paul Gronke" <gronke@duke.edu> wrote:
> Sorry to repost this query, but I have looked at the documentation and
> reviewed previous posts on this topic. I must be doing something really
> basic incorrectly.
>
> Host machine = 152.3.32.10
> Domain name = gronke.poli.duke.edu
>
> Hosting two web servers:
> gronke.com
> www.webofpolitics.com
>
> Both point to 152.3.32.10
>
> Ok, so I have added this to the end of the /etc/httpd/conf/httpd.conf
>
> NameVirtualHost 152.3.32.10
>
> <VirtualHost 152.3.32.10>
> ServerName gronke.com
> DocumentRoot /home/gronke.com/public_html
> </VirtualHost>
>
> <VirtualHost 152.3.32.10>
> ServerName www.webofpolitics.com
> DocumentRoot /home/webpol/public_html
> </VirtualHost>
>
> And changed nothing else. I put test index.html files in each directory,
> yet when I make this change to the file, the server gives back that rather
> generic "System Admin has changed this Apache site, contact that person to
> see what he has screwed up."
>
> I must be missing something really basic. Help?
you have defined that NameVirtualHost
so when you define the VirtualHost you shouldn't refer to them by the IP
again, apache knows this
<VirtualHost 152.3.32.10> should be <VirtualHost gronke.com> or
<VirtualHost www.webpolitics.com>
for the appropriate case.
Give that a shot, suprised apache didn't give you errors when it was
starting up.
===
From: Marcel Mason <mmason@nunanet.com>
Subject: Re: Name Based Virtual Hosts, Apache
Date: Wed, 13 Sep 2000 16:54:16 -0500
Paul Gronke wrote:
>
> NameVirtualHost 152.3.32.10
You forgot to give it a port
NameVirtualHost 152.3.32.10:80 (for example)
Restart apache and see how it goes
===
From: "Joshua Slive" <slive+news@finance.commerce.ubc.ca>
Subject: Re: Name Based Virtual Hosts, Apache
Date: 13 Sep 2000 23:21:07 GMT
James Leone <webmaster@hollywoodandvine.com> wrote:
> you have defined that NameVirtualHost
> so when you define the VirtualHost you shouldn't refer to them by the IP
> again, apache knows this
> <VirtualHost 152.3.32.10> should be <VirtualHost gronke.com> or
> <VirtualHost www.webpolitics.com>
> for the appropriate case.
> Give that a shot, suprised apache didn't give you errors when it was
> starting up.
No. Both ways should work, but using the IP address is recommended to
prevent DNS lookups during server start-up.
===
From: "Joshua Slive" <slive+news@finance.commerce.ubc.ca>
Subject: Re: Name Based Virtual Hosts, Apache
Date: 13 Sep 2000 23:21:26 GMT
Marcel Mason <mmason@nunanet.com> wrote:
> Paul Gronke wrote:
>>
>> NameVirtualHost 152.3.32.10
> You forgot to give it a port
> NameVirtualHost 152.3.32.10:80 (for example)
> Restart apache and see how it goes
This should not be necessary.
===
From: "Joshua Slive" <slive+news@finance.commerce.ubc.ca>
Subject: Re: Name Based Virtual Hosts, Apache
Date: 13 Sep 2000 23:21:53 GMT
Paul Gronke <gronke@duke.edu> wrote:
> And changed nothing else. I put test index.html files in each directory,
> yet when I make this change to the file, the server gives back that rather
> generic "System Admin has changed this Apache site, contact that person to
> see what he has screwed up."
The sites are working fine from where I sit. Did you clear your
cache?
===
From: Bill Moseley <usenet@hank.org>
Subject: It's the Wong Virtual Host, Grommit!
Date: Thu, 14 Sep 2000 11:32:34 -0700
Ok, I've got two name-based virtual hosts running on one
server. It's a current Apache with a current mod_perl. The
first virtual host is the default (when no Host: header is
presented), of course.
Let's assume Apache would never make a mistake for a minute,
ok?
So, for a request with a URL of the second virtual host to
end up in the 404 log of the first virtual host you would
expect that the client would fail to send the Host: header,
correct? Why no Host: header? Old browser, sure. But I've
got some indicating current clients. So why then? A proxy
server is dropping the host header?
Case in point yesterday: It's well known that AOL users come
from different IP numbers via proxies. In two seconds of
time yesterday, someone clicked on a link to the second
virtual host. They ended up at the first virtual host 404
page. This page contains two images. Both of those images
where requested (from now two different IP numbers) to the
_second_ virtual host. So it seems that the proxy that did
the first request lost the Host: header.
In my 404 log for the first virtual host I have lots and
lots of requests for URLs in the second virtual host. Many
of which are indicating clients that _should_ be sending
Or is there something else going on here?
Any ideas besides start logging Host: headers?
===
From: jediaz@my-deja.com
Subject: Virtual Hosts, proxying and caching
Date: Fri, 15 Sep 2000 18:24:57 GMT
I want to enable caching by setting the http
headers in apache. However, I use proxypass in a
virtual host to access a weblogic server on a
different sun box. When I do this, and try to
set the http headers, the headers are not set.
Is there a way to do this? This is the relevant
section of the httpd.conf file I am using:
<VirtualHost _default_:8002>
ProxyPass / http://saturn:8002/
ProxyPassReverse / http://saturn:8002/
ProxyPass /pqa http://saturn:8002/pqa
ProxyPassReverse /pqa http://saturn:8002/pqa
ProxyPass /wml http://saturn:8002/wml
ProxyPassReverse /wml http://saturn:8002/wml
ExpiresActive On
ExpiresByType image/gif A2592000
ExpiresByType image/jpg A2592000
ExpiresByType text/css A2592000
<files *.gif>
Header append Cache-Control "public"
</files>
<files *.jpg>
Header append Cache-Control "public"
</files>
<files *.js>
Header append Cache-Control "public"
</files>
<files *.css>
Header append Cache-Control "public"
</files>
<Directory proxy:*>
ExpiresActive On
ExpiresByType image/gif A2592000
ExpiresByType image/jpg A2592000
ExpiresByType text/css A2592000
<files *.gif>
Header append Cache-Control "public"
</files>
<files *.jpg>
Header append Cache-Control "public"
</files>
<files *.js>
Header append Cache-Control "public"
</files>
<files *.css>
Header append Cache-Control "public"
</files>
</Directory>
</VirtualHost>
===
From: ASTY Patrick <pasty@micronet.fr>
Subject: Re: Virtual Hosts, proxying and caching
Date: Fri, 15 Sep 2000 20:36:12 +0200
jediaz@my-deja.com wrote:
> I want to enable caching by setting the http
> headers in apache. However, I use proxypass in a
> virtual host to access a weblogic server on a
> different sun box. When I do this, and try to
> set the http headers, the headers are not set.
> Is there a way to do this? This is the relevant
> section of the httpd.conf file I am using:
You need a patch... Try this:
or this:
> <VirtualHost _default_:8002>
> ProxyPass / http://saturn:8002/
> ProxyPassReverse / http://saturn:8002/
> ProxyPass /pqa http://saturn:8002/pqa
> ProxyPassReverse /pqa http://saturn:8002/pqa
> ProxyPass /wml http://saturn:8002/wml
> ProxyPassReverse /wml http://saturn:8002/wml
> ExpiresActive On
> ExpiresByType image/gif A2592000
> ExpiresByType image/jpg A2592000
> ExpiresByType text/css A2592000
> <files *.gif>
> Header append Cache-Control "public"
> </files>
> <files *.jpg>
> Header append Cache-Control "public"
> </files>
> <files *.js>
> Header append Cache-Control "public"
> </files>
> <files *.css>
> Header append Cache-Control "public"
> </files>
> <Directory proxy:*>
> ExpiresActive On
> ExpiresByType image/gif A2592000
> ExpiresByType image/jpg A2592000
> ExpiresByType text/css A2592000
> <files *.gif>
> Header append Cache-Control "public"
> </files>
> <files *.jpg>
> Header append Cache-Control "public"
> </files>
> <files *.js>
> Header append Cache-Control "public"
> </files>
> <files *.css>
> Header append Cache-Control "public"
> </files>
> </Directory>
> </VirtualHost>
===
From: jediaz@my-deja.com
Subject: Virtual Hosts, Proxying and caching
Date: Fri, 15 Sep 2000 18:31:46 GMT
I am trying to cache some images in my files without caching the entire
document. I have a virtual host which proxies to a weblogic server on
another system. When I try to add http headers they seem to be
ignored. Here is the section of the httpd.conf file:
<VirtualHost _default_:8002>
ProxyPass / http://saturn:8002/
ProxyPassReverse / http://saturn:8002/
ProxyPass /pqa http://saturn:8002/pqa
ProxyPassReverse /pqa http://saturn:8002/pqa
ProxyPass /wml http://saturn:8002/wml
ProxyPassReverse /wml http://saturn:8002/wml
ExpiresActive On
ExpiresByType image/gif A2592000
ExpiresByType image/jpg A2592000
ExpiresByType text/css A2592000
<files *.gif>
Header append Cache-Control "public"
</files>
<files *.jpg>
Header append Cache-Control "public"
</files>
<files *.js>
Header append Cache-Control "public"
</files>
<files *.css>
Header append Cache-Control "public"
</files>
<Directory proxy:*>
ExpiresActive On
ExpiresByType image/gif A2592000
ExpiresByType image/jpg A2592000
ExpiresByType text/css A2592000
<files *.gif>
Header append Cache-Control "public"
</files>
<files *.jpg>
Header append Cache-Control "public"
</files>
<files *.js>
Header append Cache-Control "public"
</files>
<files *.css>
Header append Cache-Control "public"
</files>
</Directory>
</VirtualHost>
If anyone could tell me the right way to do this I would much
appreciate it. Thanks, Jossie
===
From: "Joshua Slive" <slive+news@finance.commerce.ubc.ca>
Subject: Re: Virtual Host Brain Teaser???
Date: 19 Sep 2000 21:26:57 GMT
pop123 <pop123@lcc.net> wrote:
> I am implementing (trying) Name Based Virtual Hosting Apache V 1.3.9
> on a Mac OS X Server with little luck. Here is my setup:
> ServerName ns1.cyberclone.net - a registered host and domain name to use
> as a configuration server ;no hosting from main server.
> Here is my setup:
> NameVirtualHost 192.168.1.253
There must be more to it than that! What about a VirtualHost section?
The first problem I see is that
ns1.cyberclone.net does not resolve to 192.168.1.253.
===
From: efflandt@xnet.com (David Efflandt)
Subject: Re: Apache Virtual Brain Teasing
Date: Tue, 19 Sep 2000 23:59:52 +0000 (UTC)
On pop123 <pop123@lcc.net> wrote:
>I am implementing (trying) Name Based Virtual Hosting
>Apache V 1.3.9 on a Mac OS X Server with little luck. Here
>is my setup: ServerName ns1.cyberclone.net - a registered
>host and domain name to use as configuration server no
>hosting from main server. NameVirtualHost 192.168.1.253
I don't get it. You say you have a registered domain, but the ServerName
does not resolve in public DNS and you are using a private IP. It might
work locally if you put that name for that IP in wherever Mac keeps its
"hosts" file. But it will not work on the internet without a hostname
that resolves to an internet IP with DNS (assuming that your ISP does not
block incoming requests on port 80).
===
From: malch@malch.com (Malcolm Hoar)
Subject: Re: Apache Virtual Brain Teasing
Date: Wed, 20 Sep 2000 14:26:30 GMT
In article <slrn8sfvg6.1l7.efflandt@efflandt.xnet.com>, efflandt@xnet.com wrote:
>On Tue, 19 Sep 2000 15:19:58 -0500, pop123 <pop123@lcc.net> wrote:
>>I am implementing (trying) Name Based Virtual Hosting Apache V 1.3.9
>>on a Mac OS X Server with little luck. Here is my setup:
>>ServerName ns1.cyberclone.net - a registered host and domain name to use
>>as configuration server no hosting from main server.
>>NameVirtualHost 192.168.1.253
>
>I don't get it. You say you have a registered domain, but the ServerName
>does not resolve in public DNS and you are using a private IP. It might
>work locally if you put that name for that IP in wherever Mac keeps its
>"hosts" file. But it will not work on the internet without a hostname
>that resolves to an internet IP with DNS (assuming that your ISP does not
>block incoming requests on port 80).
This seems perfectly resonable to me (although that doesn't mean
that everything is correctly configured).
ns1.cyberclone.net resolves. The fact that the server has a
different (private non-routable) IP assigned to its adapter
is not uncommon esp. if the machine is firewalled.
===
From: efflandt@xnet.com (David Efflandt)
Subject: Re: Apache Virtual Brain Teasing
Date: Wed, 20 Sep 2000 23:44:13 +0000 (UTC)
On Wed, 20 Sep 2000 14:26:30 GMT, Malcolm Hoar <malch@malch.com> wrote:
>In article <slrn8sfvg6.1l7.efflandt@efflandt.xnet.com>, efflandt@xnet.com wrote:
>>On Tue, 19 Sep 2000 15:19:58 -0500, pop123 <pop123@lcc.net> wrote:
>>>I am implementing (trying) Name Based Virtual Hosting Apache V 1.3.9
>>>on a Mac OS X Server with little luck. Here is my setup:
>>>ServerName ns1.cyberclone.net - a registered host and domain name to use
>>>as configuration server no hosting from main server.
>>>NameVirtualHost 192.168.1.253
>>
>>I don't get it. You say you have a registered domain, but the ServerName
>>does not resolve in public DNS and you are using a private IP. It might
>>work locally if you put that name for that IP in wherever Mac keeps its
>>"hosts" file. But it will not work on the internet without a hostname
>>that resolves to an internet IP with DNS (assuming that your ISP does not
>>block incoming requests on port 80).
>
>This seems perfectly resonable to me (although that doesn't mean
>that everything is correctly configured).
>
>ns1.cyberclone.net resolves. The fact that the server has a
>different (private non-routable) IP assigned to its adapter
>is not uncommon esp. if the machine is firewalled.
It did not resolve for me last night, but maybe I mistyped it or DNS was
not set up yet then. But it looks like he solved it, because I now get
this reply to a HEAD request:
===
From: "Greg" <greg@grinc.org>
Subject: Newbie needs virtual hosting help
Date: Tue, 19 Sep 2000 22:58:54 -0500
Ok, here's my situation:
I have 1 web server with 1 IP address and want to host multiple domains on
Apache (Linux system). (I'm using Webmin as a nifty helper, but may have to
end up editing my config files manually, I dont know). Each domain is set
for the exact same IP address.
Anyways, my machine has an outside accessable IP address, which is mapped to
an internal IP address on the LAN by another machine (that I don't own) (so
the server really only understands the local address if you want to get
technical). I don't know if that has any significance to my problem or not
but I wanted to make sure you knew just in case.
It seems that no matter what combination of virtual hosting options I try,
it either hosts one website or the other (for both domains), and never a
different site for each domain. Any ideas? What should I do? I guess one of
my main questions is: Does the DNS need to direct the requests to the
appropriate port on the web server or does the web server figure this out on
its own or does this even matter? My DNS admin says he can only direct to an
ip, and not an ip and a port. So I guess this is done by the webserver. But
how does the web server tell which domain is being requested? Ahh! Please
help!
===
From: "Joshua Slive" <slive+news@finance.commerce.ubc.ca>
Subject: Re: Newbie needs virtual hosting help
Date: 20 Sep 2000 07:23:14 GMT
Greg <greg@grinc.org> wrote:
> Ok, here's my situation:
> I have 1 web server with 1 IP address and want to host multiple domains on
> Apache (Linux system). (I'm using Webmin as a nifty helper, but may have to
> end up editing my config files manually, I dont know). Each domain is set
> for the exact same IP address.
> Anyways, my machine has an outside accessable IP address, which is mapped to
> an internal IP address on the LAN by another machine (that I don't own) (so
> the server really only understands the local address if you want to get
> technical). I don't know if that has any significance to my problem or not
> but I wanted to make sure you knew just in case.
DNS handles only the IP. By default, all http requests use the same
port (80).
Why don't you post a little of your configuration, so we can see what
you are doing. Remember that the IP address used in the
NameVirtualHost directive and the VirtualHost blocks must be the one
associated with the physical interface on the machine serving the
requests.
===
From: "Michael Josephson" <mjosephson@navicare.com>
Subject: Re: Newbie needs virtual hosting help
Date: Wed, 20 Sep 2000 13:54:24 -0500
"Greg" <greg@grinc.org> wrote in message
> I have 1 web server with 1 IP address and want to host
> multiple domains on Apache (Linux system). (I'm using
> Webmin as a nifty helper, but may have to end up editing
> my config files manually, I dont know). Each domain is set
> for the exact same IP address. Anyways, my machine has an
> outside accessable IP address, which is mapped to an
> internal IP address on the LAN by another machine (that I
> don't own) (so the server really only understands the
> local address if you want to get technical). I don't know
> if that has any significance to my problem or not but I
> wanted to make sure you knew just in case. It seems that
> no matter what combination of virtual hosting options I
> try, it either hosts one website or the other (for both
> domains), and never a different site for each domain. Any
> ideas? What should I do? I guess one of my main questions
> is: Does the DNS need to direct the requests to the
> appropriate port on the web server or does the web server
> figure this out on its own or does this even matter? My
> DNS admin says he can only direct to an ip, and not an ip
> and a port. So I guess this is done by the webserver. But
> how does the web server tell which domain is being
> requested? Ahh! Please help!
See the messages that I posted earlier today, I think it solves your
problem. The important settings in httpd.conf are:
ServerName [external IP address]
BindAddress [internal IP address]
VirtualNameServer [internal IP address]
<VirtualHost [internal IP address]>
===
From: "Michael Josephson" <mjosephson@navicare.com>
Subject: Virtual Host help
Date: Wed, 20 Sep 2000 12:11:01 -0500
Oh no, not another virtual host question.
Ok, I've done searches on the news group, and I've seen that other people
have add the problem I'm having, but I can't figure out what I'm doing
wrong.
I'm setting up Apache with a virtual host directive. However, when I try to
browse to my virtual host, Apache tries to serve
/usr/local/htdocs/index.html. Which, of course, doesn't exist, and is not
defined anywhere in httpd.conf (and there is not a rogue httpd.conf hiding
somewhere). A syntax check with apachectl -t runs fine, and apache -S a
virtual host is setup, but it's not working. Anyway, here are the revelant
portions of my httpd.conf:
------------------------------------------------------------
ServerName 208.42.18.182
#DocumentRoot "/usr/local/share/apache/htdocs"
...
NameVirtualHost 208.42.18.182
#
# Virtual host definition -- www.mjjtech.net
#
<VirtualHost 208.42.18.182>
ServerName www.mjjtech.net
ServerAdmin webmaster@mjjtech.net
DocumentRoot /home/www/mjjtech.net
ServerAlias mjjtech.net *.mjjtech.net
ErrorLog /var/log/apache/www.mjjtech.net-error_log
CustomLog /var/log/apache/www.mjjtech.net-access_log common
<Directory "/home/www/mjjtech.net/">
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
Allow from all
</Directory>
ScriptAlias /cgi-bin/ "/home/www/mjjtech.net/cgi-bin/"
<Directory "/home/www/mjjtech.net/cgi-bin">
AllowOverride None
Options None
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
#end mjjtech.net
----------------------------------------------------------------------------
-----------
The output of apache -S is:
VirtualHost configuration:
208.42.18.182:80 is a NameVirtualHost
default server www.mjjtech.net
(/etc/apache/httpd.conf:986)
port 80 namevhost www.mjjtech.net
(/etc/apache/httpd.conf:986)
When I point my browser at www.mjjtech.net, I get a "This page cannot be
found." error. /var/log/apache/error_log has the message "File does not
the message to be in /var/log/apache/www.mjjtech.net-error_log, if the
virtual host was being resolved correctly. Clearly it is not. I've been
banging my head against the wall all morning. What am I missing?
===
From: "Michael Josephson" <mjosephson@navicare.com>
Subject: Re: Virtual Host help
Date: Wed, 20 Sep 2000 12:57:40 -0500
Doesn't it always seem to work this way? As soon as I post to the newsgroup,
I solve my own problem. Anyway, I'll post my solution here in case anyone is
having the same problem.
I have a DSL connection in which my Cicso 675 modem is assigned a static IP.
I configured NAT on the 675 to pass along the appropriate requests to my
internal server (10.0.0.11). So, instead of refering to the public IP in the
virtual host directives, I needed to reference the internal IP:
BindAddress 10.0.0.11
ServerName 208.42.18.182
VirtualNameHost 10.0.0.11
<VirtualHost 10.0.0.11>
ServerName www.mjjtech.net
...
</VirtualHost>
I just knew I was overlooking something basic.
===
From: mchitti@my-deja.com
Subject: Bizarre Virtual Host Logging Problem
Date: Fri, 22 Sep 2000 15:09:44 GMT
I have a machine Running RedHat release 5.1 (Manhattan) and
Apache 1.2.6
On this machine exist a hundred or so Virtual Hosts all
configured the same. (same stanzas just changed to reflect
the name-based virtual hosting) and for some reason one of
them almost in the middle of thelists of virtual hosts shows
up as the %v log argument for all the other virtual hosts.
The hosts do no have induvidual custom log statements, a
blank is used for the entire server.
So any idea why one seemingly random named-based virutal
host is showing up as the name of all the other virtual
hosts in the logs?
===
From: "Joshua Slive" <slive+news@finance.commerce.ubc.ca>
Subject: Re: Bizarre Virtual Host Logging Problem
Date: 22 Sep 2000 20:31:48 GMT
mchitti@my-deja.com wrote:
> I have a machine Running RedHat release 5.1 (Manhattan) and Apache 1.2.6
Ouch! I think you need to upgrade to a less obsolete version of
of Apache. 1.3.12 would be a good start.
===
From: rob_ent2000@my-deja.com
Subject: Virtual Domain Hosting
Date: Sun, 24 Sep 2000 20:01:59 GMT
I'm setting up a virtual domain using solaris & apache.
I'm running the virt domain using ssl from the same server as the
primary domain which also uses ssl.
What's set up is: www.wars.com
What needs to be set up is: www.star.wars.com
I beleive this can be achieved by adding a new line in the DNS zone.
What is set up is: www.wars IN CNAME www-inet1.wars.com
What I will add is: www.star.wars IN CNAME www-inet1.wars.com
This should allow DNS named to resolve "www.star.wars.com" correct?
Now I have to make sure the apache server can resolve
"www.star.wars.com".The main domain's document root is www/htdocs.
This is done by adding this in section 3 of httpd.conf:
<VirtualHost 192.168.1.2:443>
ServerAdmin me@wars.com
DocumentRoot /www/htdocs/star
ServerName www.star.wars.com
ErrorLog logs/error_log
CustomLog logs/access_log
</VirtualHost>
The webserver currently is running the wars.com servers on
ports 80 & 443. I'm adding another certificate to run the star.wars.com
server. Only ssl connections are needed to this virtual host. I'm
thinking that adding another cert will not cause any problems running
ssl for the standard wars.com:443. Is there anything else that I'm
missing?? Does anyone have any helpful hint/tips. Any corrections??
My main goal is to have the browser's URL stay at
will change after the enter button is pushed. example:
===
From: rob_ent2000@my-deja.com
Subject: Re: Virtual Domain Hosting
Date: Mon, 02 Oct 2000 05:37:47 GMT
In article <8qlmum$bnv$1@nnrp1.deja.com>,
rob_ent2000@my-deja.com wrote:
> I'm setting up a virtual domain using solaris & apache.
> I'm running the virt domain using ssl from the same server as the
> primary domain which also uses ssl.
> example:
> What's set up is: www.wars.com
> What needs to be set up is: www.star.wars.com
>
> I beleive this can be achieved by adding a new line in the DNS zone.
> What is set up is: www.wars IN CNAME www-inet1.wars.com
> What I will add is: www.star.wars IN CNAME
www-inet1.wars.com
>
> This should allow DNS named to resolve "www.star.wars.com" correct?
>
> Now I have to make sure the apache server can resolve
> "www.star.wars.com".The main domain's document root is www/htdocs.
>
> This is done by adding this in section 3 of httpd.conf:
>
> <VirtualHost 192.168.1.2:443>
> ServerAdmin me@wars.com
> DocumentRoot /www/htdocs/star
> ServerName www.star.wars.com
> ErrorLog logs/error_log
> CustomLog logs/access_log
> </VirtualHost>
>
> The webserver currently is running the wars.com servers on
> ports 80 & 443. I'm adding another certificate to run the
> star.wars.com
> server. Only ssl connections are needed to this virtual host. I'm
> thinking that adding another cert will not cause any problems
running
> ssl for the standard wars.com:443. Is there anything else that I'm
> missing?? Does anyone have any helpful hint/tips. Any corrections??
> My main goal is to have the browser's URL stay at
> http://www.star.wars.com instead of the usual aliases in which the
URL
> will change after the enter button is pushed. example:
> http://www.star.wars.com turns to http://www.wars.com
Is any one able to help??
I believe that SSL does not support name-based solutions. Only IP based
name hosting. Is this true.
Can anyone add some info.
There was a problem with my deja mail but it's fixed now.
I don't see any additional posts. So I'm submitting again.
===
From: Paul Rubin <phr-n2000@nightsong.com>
Subject: Re: Virtual Domain Hosting
Date: 01 Oct 2000 22:54:49 -0700
rob_ent2000@my-deja.com writes:
> Is any one able to help??
> I believe that SSL does not support name-based solutions. Only IP based
> name hosting. Is this true.
> Can anyone add some info.
> There was a problem with my deja mail but it's fixed now.
> I don't see any additional posts. So I'm submitting again.
Your question is kind of confusing but yes, an SSL server can't
see the host header til after it has already sent the certificate.
So you can't do the usual type of name-based virtual hosts when
SSL is active.
===
From: Bill Moseley <usenet@hank.org>
Subject: Re: Will Virtual Hosting do this??
Date: Tue, 26 Sep 2000 06:42:14 -0700
On Mon, 25 Sep 2000 21:33:05 -0700 Chip (chip@wiegand.org) remarked...
> I am planning on serving up my own web site (www.wiegand.org)
> that is currently on a public isp and would like to allow my boys
> there own web pages. I suppose they would be like this -
> www.wiegand.org/~austin/ and www.wiegand.org/~david/. I don't
> believe I need registered domain names for them, this is a common
> practice for many isp's. I have created home directories for them
> in /usr/home/austin and /usr/home/david. I have been reading many
> of the posts here about virtual hosting and am just as confused
> as I was before I read any of them. I don't see any that reflect
> this type of hosting.
Because what you are describing is not virtual hosting. If you register
names for them and want www.davidmysonhomepage.com then you would set up
virtual hosting.
If you haven't already, you will want to look at this
> This shouldn't be too much trouble, after
> all, I got the web server working and serving my home page, (I
> use
> <meta http-equiv="Refresh" etc etc> for redirecting from the
> public isp to my home server).
Why the redirect? Ask your DNS host (or use granitecanyon.com or
centeralinfo.net free DNS) to have www.wiegand.org point to your
machine. You don't want to have to redirect from your ISPs web site to
yours.
===
From: "Paul Gronke" <gronke@duke.edu>
Subject: Another Name Virtual Host query
Date: Wed, 27 Sep 2000 00:45:54 -0400
I have two domains running off of my box, http://gronke.com and
My query is pretty simple. I have successfully set up NameVirtualHost
directives so that each web site is served by its proper files/directories.
However, I have tried to set it up so that http://webofpolitics.com defaults
to http://www.webofpolitics.com, but instead it goes to http://gronke.com.
Why, even though I have the correct lines (see below).
Furthermore, I don't understand why http://152.3.32.10 also goes to
default server directory in the httpd.conf file is set up as
/home/httpd/html, not the subdirectory devoted to gronke.com). I tried to
fix this in the first section of the VirtualHost below, but this didn't
take.
==== portion of httpd.conf below ===
NameVirtualHost 152.3.32.10
<VirtualHost 152.3.32.10>
ServerAdmin gronke@duke.edu
DocumentRoot /home/httpd/html
ServerName gronke.poli.duke.edu
</VirtualHost>
<VirtualHost 152.3.32.10>
ServerAdmin mgronke@hotmail.com
DocumentRoot /home/httpd/html/matt
ServerName gronke.com
ServerAlias *.gronke.com
</VirtualHost>
<VirtualHost 152.3.32.10>
ServerAdmin gronke@duke.edu
DocumentRoot /home/httpd/html/webofpolitics
ServerName www.webofpolitics.com
ServerAlias webofpolitics.com,*.webofpolitics.com
</VirtualHost>
<VirtualHost 152.3.32.10>
ServerAdmin p_gronke@hotmail.com
DocumentRoot /home/httpd/html/paulgronke.com
ServerName www.paulgronke.com
ServerAlias *.paulgronke.com,*.paulgronke.net,*.paulgronke.org
</VirtualHost>
===
From: "Joshua Slive" <slive+news@finance.commerce.ubc.ca>
Subject: Re: Another Name Virtual Host query
Date: 27 Sep 2000 05:09:09 GMT
Paul Gronke <gronke@duke.edu> wrote:
[...]
> However, I have tried to set it up so that http://webofpolitics.com defaults
> to http://www.webofpolitics.com, but instead it goes to http://gronke.com.
> Why, even though I have the correct lines (see below).
> Furthermore, I don't understand why http://152.3.32.10 also goes to
> http://gronke.com. It's as if gronke.com is the "default" (even though the
> default server directory in the httpd.conf file is set up as
> /home/httpd/html, not the subdirectory devoted to gronke.com).
Yes, as the documentation states, whenever an IP address is served
by name-vhosts, NO requests for that IP will go to the "main" server.
In fact, the first listed <VirtualHost> becomes the "default" for
that IP address.
Your second problem is likely in your ServerAlias lines. Different
names should be seperated by spaces, not commas.
===
From: Lynn Dobbs <news@bethechange.net>
Subject: virtual httpd hosts
Date: Fri, 29 Sep 2000 14:02:45 -0700
Hello,
I have a linux box up and running with a 416K each way DSL
and dedicated IP.
I now have choices to make. I will be hosting four or five
domains on this box. The apache documents tell me that I
have the choice of using 1 ip and using a NameServer which
is relatively simple or using a dedicated ip for each
domain which is more work to set up but will work for any
browser.
Unfortunately (or fortunately, depending how one thinks
about it), that isn't enough information for me to make up
my mind.
My ISP has no problem giving me as many IPs and I want/need.
But each time I want more, it will change all the existing
ones I have. So what ever I choose, I will have to live with
it for some time to come.
What are the big reasons for one over the other? Which is
less likely to get me into trouble with my linux box? Which
is most likely to get a browser where it wants to go? Which
would be more secure?
Hosting multiple domains includes email for each domain,
too. So setting up mail for each domain plays a part in the
decision.
===
From: Nick Kew <nick@webthing.com>
Subject: Re: virtual httpd hosts
Date: Sat, 30 Sep 2000 07:56:46 +0000
Verily, Lynn Dobbs <news@bethechange.net> wrote thusly in article <MPG.143ea33daedb84629896c3@nntp.cts.com>
> I have a linux box up and running with a 416K each way DSL
> and dedicated IP.
Lucky you.
> I now have choices to make. I will be hosting four or five
> domains on this box.
That's all pretty common: the big hosting companies of course have
vastly higher numbers per-box.
> The apache documents tell me that I
> have the choice of using 1 ip and using a NameServer which
> is relatively simple or using a dedicated ip for each
> domain which is more work to set up but will work for any
> browser.
You mean that three-and-a-half year old page, dealing with what was
already a legacy issue of old browsers in early 1997? Don't worry
about it: any browser that can't cope with your single IP will see
so little of the Web as to be unfit for general use. Thoiugh of course
even browsers such as Netscape 1.0 or earlier Mosaics can still see
your server if the users (IT department or ISP) put them behind
a proxy.
> My ISP has no problem giving me as many IPs and I want/need.
That's just sick: b***** american profligacy when the rest of us
pay through the nose for IP addresses. Please don't make yourself
part of it.
===
From: "Joshua Slive" <slive+news@finance.commerce.ubc.ca>
Subject: Re: User directive in <VirtualHost> requires SUEXEC wrapper.
Date: 2 Oct 2000 00:45:35 GMT
Alan Bryant <abryant@ultimatehwf.net> wrote:
> Hi, I'm having trouble with Apache. It worked fine yesterday, but now it is
> giving this warning when I run /usr/sbin/httpd:
> Warning: User directive in <VirtualHost> requires SUEXEC wrapper.
> Any help would be GREATLY appreciated.
This means you put a "User" directive inside a <VirtualHost>
section, but you have not compiled apache to use suexec.
The User directive is only meaningful if suexec is being used.
If you don't intend to use suexec, then just remove the user
directive. If you do intend to use suexec, then you need to
figure out why it isn't properly compiled.
===
From: "Alan Bryant" <abryant@ultimatehwf.net>
Subject: User directive in <VirtualHost> requires SUEXEC wrapper.
Date: Sun, 1 Oct 2000 19:11:21 -0700
Hi, I'm having trouble with Apache. It worked fine yesterday, but now it is
giving this warning when I run /usr/sbin/httpd:
Any help would be GREATLY appreciated.
===