Hi folks,
I've just put CentOS 4.1 on my webserver, displacing OpenBSD (1 up for Linux :-))
I found that the Virtual Hosts function doesn't appear to work. All virtual hosts accesses default to the main www directory instead of serving from their respective directories.
Has anyone else found the same problem?
Thanks.
Ben
On Sunday 03 July 2005 21:51, Ben wrote:
I found that the Virtual Hosts function doesn't appear to work. All virtual hosts accesses default to the main www directory instead of serving from their respective directories.
Has anyone else found the same problem?
Seems to work here - have you checked your apachectl -S output?
Peter.
On Sun, 3 Jul 2005 21:54:55 -0400, you wrote:
%On Sunday 03 July 2005 21:51, Ben wrote: %> I found that the Virtual Hosts function doesn't appear to work. All %> virtual hosts accesses default to the main www directory instead of %> serving from their respective directories. %> %> Has anyone else found the same problem? %Seems to work here - have you checked your apachectl -S output? % Hi Peter,
Here's what I have from -S
xx.xx.xx.xx:80 is a NameVirtualHost default server www.svgeek.com (......) port 80 namevhost www.svgeek.com (.....) port 80 namevhost www.blu....com (.....) port 80 namevhost www.power...com (.......) wildcard NameVirtualHosts and _default_ servers: _default_:443 xxx.svgeek.com (.....)
What seems to happen is that the 2nd and 3rd URLs deliver content from the directories of the first URL.
Ben
Am Mo, den 04.07.2005 schrieb Ben um 4:02:
Here's what I have from -S
xx.xx.xx.xx:80 is a NameVirtualHost default server www.svgeek.com (......) port 80 namevhost www.svgeek.com (.....) port 80 namevhost www.blu....com (.....) port 80 namevhost www.power...com (.......) wildcard NameVirtualHosts and _default_ servers: _default_:443 xxx.svgeek.com (.....)
What seems to happen is that the 2nd and 3rd URLs deliver content from the directories of the first URL.
Ben
Why you have a vhost with the same servername as the main host?
Time for reading the docs: http://httpd.apache.org/docs-2.0/vhosts/
Alexander
On Sun, 2005-07-03 at 18:51 -0700, Ben wrote:
Hi folks,
I've just put CentOS 4.1 on my webserver, displacing OpenBSD (1 up for Linux :-))
I found that the Virtual Hosts function doesn't appear to work. All virtual hosts accesses default to the main www directory instead of serving from their respective directories.
Has anyone else found the same problem?
It works fine ... if it didn't, CentOS wouldn't be much of an Enterprise OS :)
Make sure to un-remark the line:
NameVirtualHost *:80
On Sun, 03 Jul 2005 21:01:25 -0500, you wrote:
%On Sun, 2005-07-03 at 18:51 -0700, Ben wrote: %> Hi folks, %> %> I've just put CentOS 4.1 on my webserver, displacing OpenBSD (1 up for %> Linux :-)) %> %> I found that the Virtual Hosts function doesn't appear to work. All %> virtual hosts accesses default to the main www directory instead of %> serving from their respective directories. %> %> Has anyone else found the same problem? %> % %It works fine ... if it didn't, CentOS wouldn't be much of an Enterprise %OS :) % %Make sure to un-remark the line: % %NameVirtualHost *:80
I did. Here's a snip:
NameVirtualHost xxx.xxx.xxx.xxx:80
<VirtualHost xxx.xxx.xxx.xxx:80> DocumentRoot /www/svgeek ServerName www.svgeek.com </VirtualHost>
<VirtualHost xxx.xxx.xxx.xxx:80> DocumentRoot /www/bluesky ServerName www.blueskyinnovations.com </VirtualHost>
<VirtualHost xxx.xxx.xxx.xxx:80> DocumentRoot /www/bluesky ServerName www.power-boot.com </VirtualHost>
where xxx.xxx.xxx.xxx is the external/public IP address.
Ben
On Sunday 03 July 2005 22:06, Ben wrote:
NameVirtualHost xxx.xxx.xxx.xxx:80
<VirtualHost xxx.xxx.xxx.xxx:80> DocumentRoot /www/svgeek ServerName www.svgeek.com </VirtualHost>
<VirtualHost xxx.xxx.xxx.xxx:80> DocumentRoot /www/bluesky ServerName www.blueskyinnovations.com </VirtualHost>
<VirtualHost xxx.xxx.xxx.xxx:80> DocumentRoot /www/bluesky ServerName www.power-boot.com </VirtualHost>
where xxx.xxx.xxx.xxx is the external/public IP address.
Looks good so far - is there anything logged in your error.log? Did this setup work (and you upgraded something) or is this something new you're trying to set up?
Peter.
On 7/3/05, Peter Arremann loony@loonybin.org wrote:
On Sunday 03 July 2005 22:06, Ben wrote:
NameVirtualHost xxx.xxx.xxx.xxx:80
<VirtualHost xxx.xxx.xxx.xxx:80> DocumentRoot /www/svgeek ServerName www.svgeek.com </VirtualHost>
<VirtualHost xxx.xxx.xxx.xxx:80> DocumentRoot /www/bluesky ServerName www.blueskyinnovations.com </VirtualHost>
<VirtualHost xxx.xxx.xxx.xxx:80> DocumentRoot /www/bluesky ServerName www.power-boot.com </VirtualHost>
where xxx.xxx.xxx.xxx is the external/public IP address.
Looks good so far - is there anything logged in your error.log? Did this setup work (and you upgraded something) or is this something new you're trying to set up?
I would be curious to learn the answer. We have a related problem with virtual hosts for https urls on REHL3 systems. The symptoms are similar, ie the DocumentRoot for the http url is substituted for the https url. Don't have the exact parameters available at home, but will look up and report back.
-----Original Message----- From: centos-bounces@centos.org [mailto:centos-bounces@centos.org] On Behalf Of Collins Richey Sent: Sunday, July 03, 2005 10:17 PM To: CentOS mailing list Subject: Re: [CentOS] CentOS 4.1 Apache
On 7/3/05, Peter Arremann loony@loonybin.org wrote:
On Sunday 03 July 2005 22:06, Ben wrote:
NameVirtualHost xxx.xxx.xxx.xxx:80
<VirtualHost xxx.xxx.xxx.xxx:80> DocumentRoot /www/svgeek ServerName www.svgeek.com </VirtualHost>
<VirtualHost xxx.xxx.xxx.xxx:80> DocumentRoot /www/bluesky ServerName www.blueskyinnovations.com </VirtualHost>
<VirtualHost xxx.xxx.xxx.xxx:80> DocumentRoot /www/bluesky ServerName www.power-boot.com </VirtualHost>
where xxx.xxx.xxx.xxx is the external/public IP address.
Looks good so far - is there anything logged in your error.log? Did this setup work (and you upgraded something) or is this something new you're trying to set up?
I would be curious to learn the answer. We have a related problem with virtual hosts for https urls on REHL3 systems. The symptoms are similar, ie the DocumentRoot for the http url is substituted for the https url. Don't have the exact parameters available at home, but will look up and report back.
-- Collins
To my knowledge, you need a separate IP address for each https vhost, else the default ssl cert is used.
Mike
On Mon, 2005-07-04 at 00:10 -0500, Mike Kercher wrote:
-----Original Message----- From: centos-bounces@centos.org [mailto:centos-bounces@centos.org] On Behalf Of Collins Richey Sent: Sunday, July 03, 2005 10:17 PM To: CentOS mailing list Subject: Re: [CentOS] CentOS 4.1 Apache
On 7/3/05, Peter Arremann loony@loonybin.org wrote:
On Sunday 03 July 2005 22:06, Ben wrote:
NameVirtualHost xxx.xxx.xxx.xxx:80
<VirtualHost xxx.xxx.xxx.xxx:80> DocumentRoot /www/svgeek ServerName www.svgeek.com </VirtualHost>
<VirtualHost xxx.xxx.xxx.xxx:80> DocumentRoot /www/bluesky ServerName www.blueskyinnovations.com </VirtualHost>
<VirtualHost xxx.xxx.xxx.xxx:80> DocumentRoot /www/bluesky ServerName www.power-boot.com </VirtualHost>
where xxx.xxx.xxx.xxx is the external/public IP address.
Looks good so far - is there anything logged in your error.log? Did this setup work (and you upgraded something) or is this something new you're trying to set up?
I would be curious to learn the answer. We have a related problem with virtual hosts for https urls on REHL3 systems. The symptoms are similar, ie the DocumentRoot for the http url is substituted for the https url. Don't have the exact parameters available at home, but will look up and report back.
-- Collins
To my knowledge, you need a separate IP address for each https vhost, else the default ssl cert is used.
Mike
Absoultely true ... you must have sepearate IP addresses for https sites ... BECAUSE ... the http headers have to be unencrypted before the server can find out what the virtual host is (the server can't read the location you are trying to get to while the header is still encrypted). So, the system has to pick a certificate to use to decode the request if there are multiple ones listed for that IP.
On Mon, 2005-04-07 at 00:10 -0500, Mike Kercher wrote:
To my knowledge, you need a separate IP address for each https vhost, else the default ssl cert is used.
This is true, but you can use a wildcard certificate and deploy the same cert across many sub-domains.
HTH,
Ranbir
Quoting Kanwar Ranbir Sandhu m3freak@rogers.com:
On Mon, 2005-04-07 at 00:10 -0500, Mike Kercher wrote:
To my knowledge, you need a separate IP address for each https vhost, else the default ssl cert is used.
This is true, but you can use a wildcard certificate and deploy the same cert across many sub-domains.
Another option is to use subjectAltName to name all the virtual hosts.
This (and wildcard certificates) are easy workarounds in some cases. For example, if you have only handfull of virtual hosts on the single server *and* you are liable for all of them. Not really a solution for service providers (service provider is not liable for individual virtual hosts that he is hosting, plus clients would probably want to use their own certificates). If you are service provider and simply host other people's web sites, separate IP address for each virtual host is the only option.
---------------------------------------------------------------- This message was sent using IMP, the Internet Messaging Program.
On Sun, 2005-07-03 at 19:06 -0700, Ben wrote:
On Sun, 03 Jul 2005 21:01:25 -0500, you wrote:
%On Sun, 2005-07-03 at 18:51 -0700, Ben wrote: %> Hi folks, %> %> I've just put CentOS 4.1 on my webserver, displacing OpenBSD (1 up for %> Linux :-)) %> %> I found that the Virtual Hosts function doesn't appear to work. All %> virtual hosts accesses default to the main www directory instead of %> serving from their respective directories. %> %> Has anyone else found the same problem? %> % %It works fine ... if it didn't, CentOS wouldn't be much of an Enterprise %OS :) % %Make sure to un-remark the line: % %NameVirtualHost *:80
I did. Here's a snip:
NameVirtualHost xxx.xxx.xxx.xxx:80
<VirtualHost xxx.xxx.xxx.xxx:80> DocumentRoot /www/svgeek ServerName www.svgeek.com </VirtualHost>
<VirtualHost xxx.xxx.xxx.xxx:80> DocumentRoot /www/bluesky ServerName www.blueskyinnovations.com </VirtualHost>
<VirtualHost xxx.xxx.xxx.xxx:80> DocumentRoot /www/bluesky ServerName www.power-boot.com </VirtualHost>
where xxx.xxx.xxx.xxx is the external/public IP address.
When you say external/public IP ... is that the IP of a ethX device on the server OR an external firewall.
On Sun, 03 Jul 2005 22:26:05 -0500, you wrote:
%On Sun, 2005-07-03 at 19:06 -0700, Ben wrote: %> %> where xxx.xxx.xxx.xxx is the external/public IP address. %> %When you say external/public IP ... is that the IP of a ethX device on %the server OR an external firewall.
That's the IP on the external firewall.
Ben
Ben wrote:
On Sun, 03 Jul 2005 22:26:05 -0500, you wrote:
%On Sun, 2005-07-03 at 19:06 -0700, Ben wrote: %> %> where xxx.xxx.xxx.xxx is the external/public IP address. %> %When you say external/public IP ... is that the IP of a ethX device on %the server OR an external firewall.
That's the IP on the external firewall.
heh, Johnny is sharp huh?
I guess then that the ip on the box itself is an internal one and that the firewall NAT's the external ip to the internal one? (Nothing to do with the apache config this question)
If so, change the ip(s) to the internal ip. if you have multiple internal ips that get mapped to different ips on the firewall, put the corresponding one in the conrresponding virtual host config block.
On Mon, 04 Jul 2005 12:38:52 +0800, you wrote:
%Ben wrote: %> %> That's the IP on the external firewall. % %heh, Johnny is sharp huh? % %I guess then that the ip on the box itself is an internal one and that %the firewall NAT's the external ip to the internal one? (Nothing to do %with the apache config this question) % %If so, change the ip(s) to the internal ip. if you have multiple %internal ips that get mapped to different ips on the firewall, put the %corresponding one in the conrresponding virtual host config block.
Okay, here's what I just did. I used the internal IP address (IP of the web server) instead of the external (world wide) IP address that www.svgeek.com resolves to.
What happens is that the other 2 domains get mapped to the CentOS Apache Test Page.
Ben
I wrote:
%Okay, here's what I just did. I used the internal IP address (IP of %the web server) instead of the external (world wide) IP address that %www.svgeek.com resolves to. % %What happens is that the other 2 domains get mapped to the CentOS %Apache Test Page.
I found out that the reason for that is that Apache could not find the index.html file. So it defaulted to the Test Page.
So this solution works : by using the server's IP address (instead of the world wide, external IP).
The problem in my case was that welcome.html was not accepted by this version of Apache as equivalent to index.html. At least not out of the box.
Thanks all.
Ben
On Sun, 3 Jul 2005, Ben wrote:
I did. Here's a snip:
NameVirtualHost xxx.xxx.xxx.xxx:80
<VirtualHost xxx.xxx.xxx.xxx:80> DocumentRoot /www/svgeek ServerName www.svgeek.com </VirtualHost>
<VirtualHost xxx.xxx.xxx.xxx:80> DocumentRoot /www/bluesky ServerName www.blueskyinnovations.com </VirtualHost>
<VirtualHost xxx.xxx.xxx.xxx:80> DocumentRoot /www/bluesky ServerName www.power-boot.com </VirtualHost>
You can simplify this setup like:
NameVirtualHost xxx.xxx.xxx.xxx:80
<VirtualHost xxx.xxx.xxx.xxx:80> DocumentRoot /www/svgeek ServerName www.svgeek.com </VirtualHost>
<VirtualHost xxx.xxx.xxx.xxx:80> DocumentRoot /www/bluesky ServerName www.blueskyinnovations.com ServerAlias www.power-boot.com </VirtualHost>
Or if you want to consolidate a set of URLs to a single URL:
NameVirtualHost *:80
<VirtualHost *:80> ServerName dag.wieers.com DocumentRoot /var/www/dag.wieers.com/ </VirtualHost>
<VirtualHost *:80> ServerName dag.wieers.be ServerAlias www.dag.wieers.com www.dag.wieers.be Redirect Permanent / http://dag.wieers.com/ </VirtualHost>
This way you prevent people bookmarking an older URL that might be out of use after some timeframe.
Tip: It's also much better for Google, since all links to your site will go to a unique location (not spread over different domains holding the same content).
Kind regards, -- dag wieers, dag@wieers.com, http://dag.wieers.com/ -- [all I want is a warm bed and a kind word and unlimited power]