I figured out why <a href="http://foobar.domain1.com">foobar.domain1.com</a> was always displaying the page for <a href="http://foo.domain1.com">foo.domain1.com</a> when going to port 80. From the Apache website: "If no matching virtual host is found, then
<strong>the first listed virtual host</strong> that matches the IP
address will be used." So I moved my entry with the invalid DocumentRoot to the top, and now it works. I'm still getting a couple "no VirtualHosts" warnings. Both are for domain2, which is a .us domain. There isn't anything weird with a .us domain, is there?
<br><br><div><span class="gmail_quote">On 6/1/07, <b class="gmail_sendername">Tim Wilson</b> <<a href="mailto:tim_linux@wilson-home.com">tim_linux@wilson-home.com</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
It looks like I have it working, what I did was in addition to the entry for <a href="http://foobar.domain1.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">foobar.domain1.com</a> on port 8080, I added the following:
<br><VirtualHost <a href="http://127.0.0.1:80" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
127.0.0.1:80</a>><br> ServerName <a href="http://foobar.domain1.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">foobar.domain1.com</a><br> DocumentRoot /var/www/foobar<br></VirtualHost>
<br><br>Where /var/www/foobar doesn't exist. That way, if someone goes to
<a href="http://foobar.domain1.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">foobar.domain1.com</a> on port 80, they'll get a 404. Until today, I was only listening on 8080, keeping people from finding I had a web server running (since most only scan port 80). However, I have some legit people accessing certain sites, but some where having problems going to 8080.
<br><br>The one problem is if someone goes to the actual IP address, they're still presented with the <a href="http://foo.domain1.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">foo.domain1.com
</a> page instead of an error. I'll see if there's a way to do a redirect or rewrite.
<div><span class="e" id="q_112ea1bef611a07a_1"><br><br><div><span class="gmail_quote">On 6/1/07, <b class="gmail_sendername">Barry Von Ahsen</b> <<a href="mailto:barry@vonahsen.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
barry@vonahsen.com</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Tim Wilson wrote:<br>> On 6/1/07, Chris Freeman <<a href="mailto:cwfreeman@gmail.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">cwfreeman@gmail.com</a>> wrote:<br>>><br>>>
<br>>><br>>> On 6/1/07, David Champion <<a href="mailto:dchampion@visionary.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
dchampion@visionary.com</a>> wrote:<br>>> ><br>>> > ...<br>>> > Doing a search / replace on the IP isn't that hard (at least using joe.<br>>> > Doing it in vi, well, that's another story).
<br>>> ><br>>> > -dc<br>>><br>>><br>>> <off-topic flame="on" why="because I can" ><br>>> While doing it in joe might not be hard, doing it in vi is downright
<br>>> easy.<br>>> And fun. ;-)<br>>> </off-topic><br>>><br>>><br>>><br>>> _______________________________________________<br>>> Cialug mailing list<br>>> <a href="mailto:Cialug@cialug.org" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
Cialug@cialug.org</a><br>>> <a href="http://cialug.org/mailman/listinfo/cialug" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">http://cialug.org/mailman/listinfo/cialug</a><br>>><br>>>
<br>> Ignoring the potential flame war (FTR, I use emacs, and it is very easy), I
<br>> tried it with IP addresses and with *. With *, I get warnings when<br>> restarting httpd. With IP addresses (or with *), If I go to<br>> <a href="http://foobar.domain1.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
foobar.domain1.com</a> (port 80), I get what I would expect from
<br>> <a href="http://foo.domain1.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">foo.domain1.com</a>.<br>> Is there a way to display an error when someone goes to<br>> foobar.domain1.comon
port 80, but display the page when they go to<br>> port 8080? I did add
<br>> NameVirtualHost lines with the appropriate ports.<br>><br><br>you could do<br><VirtualHost foobarip:80><br> ServerName <a href="http://foobar.domain1.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
foobar.domain1.com</a><br> Redirect /
<a href="http://foobar.domain1.com:8080/" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">http://foobar.domain1.com:8080/</a><br></VirtualHost><br><br>to redirect them or<br><br> RedirectMatch permanent (.*)
<a href="http://foobar.domain1.com:8080$1" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">http://foobar.domain1.com:8080$1
</a><br><br>to redirect them to what they requested<br><br>-barry<br>_______________________________________________<br>Cialug mailing list<br><a href="mailto:Cialug@cialug.org" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
Cialug@cialug.org</a><br><a href="http://cialug.org/mailman/listinfo/cialug" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
http://cialug.org/mailman/listinfo/cialug</a><br></blockquote></div><br><br clear="all"><br></span></div>-- <br><span class="sg">Tim
</span></blockquote></div><br><br clear="all"><br>-- <br>Tim