[Apache] Using main server config _and_ virtual hosting?
Hey,
I've hit a weird one. Most likely I'm just overlooking something but I don't know what, hopefully some one can point it out to me.
I have a server running Apache, all setup in the main server section. Just now I tried to add a name based virtual host and the NBVH seems to be "taking over" the main server config. It's pretty wierd. In other words, when I request the original _non_ virtual host's URL, I'm getting the pages for the NBVH instead.
After reading http://httpd.apache.org/docs/vhosts/examples.html#default it seems to me that this is not right:
"Using such a default vhost with a wildcard port effectively prevents any request going to the main server."
Presumign that "main server" does _not_ mean main _virtual_ server, this sounds to me like as long as I don't have a "_default_:*" NBVH set, any requests send to the server that don't match a NBVH should go to the main server config. But that is not happening.
If all of the above is confusing, just think of it this way: the NBVH is hijacking all requests going to the server. How do I get the NBVH to not interfere with the main server configuration?
Do I have set up a NBVH for the main server config too? I know I _can_, but do I _have_ to?
Here's the sum of everything I changed when I added the NBVH:
BindAddress *
NameVirtualHost 216.205.93.46:80
JW wrote:
I've hit a weird one. Most likely I'm just overlooking something but I don't know what, hopefully some one can point it out to me.
I have a server running Apache, all setup in the main server section. Just now I tried to add a name based virtual host and the NBVH seems to be "taking over" the main server config. It's pretty wierd. In other words, when I request the original _non_ virtual host's URL, I'm getting the pages for the NBVH instead.
Presumign that "main server" does _not_ mean main _virtual_ server, this sounds to me like as long as I don't have a "_default_:*" NBVH set, any requests send to the server that don't match a NBVH should go to the main server config. But that is not happening.
BindAddress * NameVirtualHost 216.205.93.46:80
ServerAdmin joe@claborn.net DocumentRoot /home/webhome/clickpatrol DirectoryIndex cpeindex.php ServerName www.clickpatroleurope.com ServerAlias clickpatroleurope.com ErrorLog logs/clickpatroleurope.com-error_log CustomLog logs/clickpatroleurope.com-access_log combined </VirtualHost> If I comment those things out everything goes back to normal for the main server.
Any ideas how to get a regular server and NBVH to peacefully co-exist?
I have limited experience with this, but I'm pretty sure you need a different ip address for the virtual host. If you give the same ip for the virtual as for the main, the last one listed in the config is in effect. If your main server ip is 216.205.93.46 and is assigned to eth0; then you should assign 216.205.93.47 (or whatever you have assigned to you) to your virtual host, then run ifconfig eth0 add 216.205.93.47 then your 2 addresses can come in on the same ethernet card, main as eth0, and the virtual as eth0:0 I heard that there is some technique for having a bunch of virtual hosts all on the same ip address, but most isps don't like it, as it messes up their dns. If you are stuck with 1 ip address, you could always resort to putting your virtualhosts in individual homedirs and accessing them with ~ off of the main server. Hope it helped, maybe other network experts will expound or clarify this.
Name based virtual hosting only works for HTTP 1.1. Most clients are
HTTP 1.0. Use IP address based virtual hosting if you can.
HTH,
Jeffrey
Quoting JW
Hey,
I've hit a weird one. Most likely I'm just overlooking something but I don't know what, hopefully some one can point it out to me.
I have a server running Apache, all setup in the main server section. Just now I tried to add a name based virtual host and the NBVH seems to be "taking over" the main server config. It's pretty wierd. In other words, when I request the original _non_ virtual host's URL, I'm getting the pages for the NBVH instead.
After reading http://httpd.apache.org/docs/vhosts/examples.html#default it seems to me that this is not right:
"Using such a default vhost with a wildcard port effectively prevents any request going to the main server."
Presumign that "main server" does _not_ mean main _virtual_ server, this sounds to me like as long as I don't have a "_default_:*" NBVH set, any requests send to the server that don't match a NBVH should go to the main server config. But that is not happening.
If all of the above is confusing, just think of it this way: the NBVH is hijacking all requests going to the server. How do I get the NBVH to not interfere with the main server configuration?
Do I have set up a NBVH for the main server config too? I know I _can_, but do I _have_ to?
Here's the sum of everything I changed when I added the NBVH:
BindAddress * NameVirtualHost 216.205.93.46:80
ServerAdmin joe@claborn.net DocumentRoot /home/webhome/clickpatrol DirectoryIndex cpeindex.php ServerName www.clickpatroleurope.com ServerAlias clickpatroleurope.com ErrorLog logs/clickpatroleurope.com-error_log CustomLog logs/clickpatroleurope.com-access_log combined </VirtualHost> If I comment those things out everything goes back to normal for the main server.
Any ideas how to get a regular server and NBVH to peacefully co-exist?
Jonathan Wilson System Administrator
Cedar Creek Software http://www.cedarcreeksoftware.com Central Texas IT http://www.centraltexasit.com
-- I don't do Windows and I don't come to work before nine. -- Johnny Paycheck
Quoting Jeffrey Taylor
Name based virtual hosting only works for HTTP 1.1. Most clients are HTTP 1.0. Use IP address based virtual hosting if you can.
This is not correct. Name Based Virtual Hosting has been working well since the 3.x based browsers. Most clients are indeed HTTP 1.1 capable.
Do I have set up a NBVH for the main server config too? I know I _can_, but do I _have_ to?
I think so.
Here's the sum of everything I changed when I added the NBVH:
BindAddress * NameVirtualHost 216.205.93.46:80
ServerAdmin joe@claborn.net DocumentRoot /home/webhome/clickpatrol DirectoryIndex cpeindex.php ServerName www.clickpatroleurope.com ServerAlias clickpatroleurope.com ErrorLog logs/clickpatroleurope.com-error_log CustomLog logs/clickpatroleurope.com-access_log combined </VirtualHost>
I have the BindAddress commented out. I do not have a port number on the NameVirtualHost address (just ip) Then I have a VirtualHost section for EVERY domain that is served, including the native one. I hope this helps. Greg gjohnson@frozen.com
At 04:41 PM 11/30/2001 -0600, you wrote:
Quoting Jeffrey Taylor
: Name based virtual hosting only works for HTTP 1.1. Most clients are HTTP 1.0. Use IP address based virtual hosting if you can.
This is not correct. Name Based Virtual Hosting has been working well since the 3.x based browsers. Most clients are indeed HTTP 1.1 capable.
Agreed.
Do I have set up a NBVH for the main server config too? I know I _can_, but do I _have_ to?
I think so.
yeah, I came to that unfortunate conclusion about 3 hours ago :-/
Here's the sum of everything I changed when I added the NBVH:
BindAddress * NameVirtualHost 216.205.93.46:80
ServerAdmin joe@claborn.net DocumentRoot /home/webhome/clickpatrol DirectoryIndex cpeindex.php ServerName www.clickpatroleurope.com ServerAlias clickpatroleurope.com ErrorLog logs/clickpatroleurope.com-error_log CustomLog logs/clickpatroleurope.com-access_log combined </VirtualHost> I have the BindAddress commented out.
Ok. I can't really figure out if I need it or not, it doesn't seem to make any difference but docs I read made it look like I should use it :-?
I do not have a port number on the NameVirtualHost address (just ip) Then I have a VirtualHost section for EVERY domain that is served, including the native one.
I think have to use port number or it interferes with the SSL host. (at least I know for sure that using * in the post number interferes with the SSL vhost because I tried setting up a
I hope this helps.
It does, thanks.
Greg gjohnson@frozen.com
-- To unsubscribe send e-mail to suse-linux-e-unsubscribe@suse.com For additional commands send e-mail to suse-linux-e-help@suse.com Also check the FAQ at http://www.suse.com/support/faq and the archives at http://lists.suse.com
---------------------------------------------------- Jonathan Wilson System Administrator Cedar Creek Software http://www.cedarcreeksoftware.com Central Texas IT http://www.centraltexasit.com
Not according to my Apache access logs. In fact, I see no HTTP 1.1
clients in it at all.
Jeffrey
Quoting Greg Johnson
Quoting Jeffrey Taylor
: Name based virtual hosting only works for HTTP 1.1. Most clients are HTTP 1.0. Use IP address based virtual hosting if you can.
This is not correct. Name Based Virtual Hosting has been working well since the 3.x based browsers. Most clients are indeed HTTP 1.1 capable.
Do I have set up a NBVH for the main server config too? I know I _can_, but do I _have_ to?
I think so.
Here's the sum of everything I changed when I added the NBVH:
BindAddress * NameVirtualHost 216.205.93.46:80
ServerAdmin joe@claborn.net DocumentRoot /home/webhome/clickpatrol DirectoryIndex cpeindex.php ServerName www.clickpatroleurope.com ServerAlias clickpatroleurope.com ErrorLog logs/clickpatroleurope.com-error_log CustomLog logs/clickpatroleurope.com-access_log combined </VirtualHost> I have the BindAddress commented out. I do not have a port number on the NameVirtualHost address (just ip) Then I have a VirtualHost section for EVERY domain that is served, including the native one.
I hope this helps.
Greg gjohnson@frozen.com
-- I don't do Windows and I don't come to work before nine. -- Johnny Paycheck
At 05:43 PM 11/30/2001 -0600, you wrote:
Not according to my Apache access logs. In fact, I see no HTTP 1.1 clients in it at all.
Jeffrey
Dude most everything is 1.1 now. ccs003:~ # grep "HTTP/1.1" /var/log/httpd/access_log |wc -l 2079 ccs003:~ # grep "HTTP/1.0" /var/log/httpd/access_log |wc -l 1553 ---------------------------------------------------- Jonathan Wilson System Administrator Cedar Creek Software http://www.cedarcreeksoftware.com Central Texas IT http://www.centraltexasit.com
# grep "HTTP/1.1" /var/log/httpd/access_log |wc -l
0
# grep "HTTP/1.0" /var/log/httpd/access_log |wc -l
12023
4 to 3 is hardly "most everything". So you plan on building a web site
that doesn't work for over forty percent of visitors? Interesting.
Jeffrey
Quoting JW
At 05:43 PM 11/30/2001 -0600, you wrote:
Not according to my Apache access logs. In fact, I see no HTTP 1.1 clients in it at all.
Jeffrey
Dude most everything is 1.1 now.
ccs003:~ # grep "HTTP/1.1" /var/log/httpd/access_log |wc -l 2079
ccs003:~ # grep "HTTP/1.0" /var/log/httpd/access_log |wc -l 1553
Jonathan Wilson System Administrator
Cedar Creek Software http://www.cedarcreeksoftware.com Central Texas IT http://www.centraltexasit.com
-- I don't do Windows and I don't come to work before nine. -- Johnny Paycheck
I have got ar record strange record in my logfile, i have two apache servers on the net and the record are on both server. 217.227.118.117 - - [04/Dec/2001:13:11:37 +0100] "GET http://217.227.118.117:8283/ HTTP/1.0" 200 2843 anybody know what this means?? Thanks Best regards Tage Danielsen Denmark tage@htd-information.dk
This is an access record. Someone at 217.227.118.117 requested a page
at port 8283 of the same IP address. The status was 200 (OK) and 2843
bytes were returned. Is the IP address yours? Either someone is
spoofing your address or Apache is talking to itself. Can you show
some more context? Running nslookup gives
pD9E37675.dip.t-dialin.net. I think that's a German ISP.
HTH,
Jeffrey
Quoting Tage
I have got ar record strange record in my logfile, i have two apache servers on the net and the record are on both server.
217.227.118.117 - - [04/Dec/2001:13:11:37 +0100] "GET http://217.227.118.117:8283/ HTTP/1.0" 200 2843
anybody know what this means?? Thanks
-- I don't do Windows and I don't come to work before nine. -- Johnny Paycheck
I have a danish IP 193.241.88.210 and there is only that record in the
logfile on both servers, i have been looking on the internet and found
another site with the link
http://www.incidents.org/archives/intrusions/msg01083.html
I don't know what is happen, and what i have to do to be safe??
Best regards
Tage Danielsen
Denmark
**************************************************************************
-----Oprindelig meddelelse-----
Fra: Jeffrey Taylor [mailto:jeff.taylor@ieee.org]
Sendt: 4. december 2001 17:22
Til: suse-linux-e@suse.com
Emne: Re: [SLE] [Apache] logfile
This is an access record. Someone at 217.227.118.117 requested a page
at port 8283 of the same IP address. The status was 200 (OK) and 2843
bytes were returned. Is the IP address yours? Either someone is
spoofing your address or Apache is talking to itself. Can you show
some more context? Running nslookup gives
pD9E37675.dip.t-dialin.net. I think that's a German ISP.
HTH,
Jeffrey
Quoting Tage
I have got ar record strange record in my logfile, i have two apache
servers
on the net and the record are on both server.
217.227.118.117 - - [04/Dec/2001:13:11:37 +0100] "GET http://217.227.118.117:8283/ HTTP/1.0" 200 2843
anybody know what this means?? Thanks
-- I don't do Windows and I don't come to work before nine. -- Johnny Paycheck -- To unsubscribe send e-mail to suse-linux-e-unsubscribe@suse.com For additional commands send e-mail to suse-linux-e-help@suse.com Also check the FAQ at http://www.suse.com/support/faq and the archives at http://lists.suse.com
participants (5)
-
Greg Johnson
-
Jeffrey Taylor
-
JW
-
Tage
-
zentara