Post #149,738
4/1/04 6:45:19 PM
8/21/07 6:38:22 AM
|
Apache virtual hosts
are not WORKING! GRRRR. I've spent a whole day jacking with this.
I have one machine with an IP address. I need it to act like two different web sites. Some of my httpd.conf file:
DocumentRoot "/Library/WebServer/Documents" ServerName my.static.ip.address
NameVirtualHost my.static.ip.address:80
<VirtualHost my.static.ip.address:80> DocumentRoot "/Library/WebServer/abc" ServerName www.abc.net SSLEngine off </VirtualHost>
<VirtualHost my.static.ip.address:80> DocumentRoot "/Library/WebServer/xyz" ServerName www.xyz.net SSLEngine off </VirtualHost>
If I enter [link|http://localhost|http://localhost] I get the default document root But entering [link|http://www.abc.com|http://www.abc.com] also gets me the default document root.
I don't get it.
Java is a joke, only it's not funny.
--Alan Lovejoy
|
Post #149,739
4/1/04 6:53:11 PM
|
Let me know if you figure it out
I'm having the same problem.
===
Implicitly condoning stupidity since 2001.
|
Post #149,741
4/1/04 7:11:13 PM
|
perhaps in your hosts file
localhost will point to the default document root your example of www.abc.net is it in the hosts table as well as www.xyz.net if not it is defaulting to localhost who like meercat assumes that someone who knows what he is talking about will come along and explain it. thanx, bill
"You're just like me streak. You never left the free-fire zone.You think aspirins and meetings and cold showers are going to clean out your head. What you want is God's permission to paint the trees with the bad guys. That wont happen big mon." Clete questions, help? [link|mailto:pappas@catholic.org|email pappas at catholic.org]
|
Post #149,742
4/1/04 7:26:31 PM
8/21/07 6:38:26 AM
|
Not in the hosts file - domain is available by DNS though
Are you saying I should add it to hosts on the server anyhow?
Java is a joke, only it's not funny.
--Alan Lovejoy
|
Post #149,743
4/1/04 7:28:35 PM
|
I assume you've done the obvious things.
[link|http://www.apacheweek.com/features/vhost|Apacheweek - Using Virtual Hosts] has a little information.
[link|http://nebula.worldbank.org/manual/vhosts/|World Bank VHosts Manual] !
But perhaps this Usenet [link|http://groups.google.com/groups?hl=en&lr=&ie=UTF-8&oe=UTF-8&safe=off&th=b9b3cb103ab67a2&rnum=4|thread] is more useful.
HTH.
Cheers, Scott. (Who's just trying to save you some Googling...)
|
Post #149,746
4/1/04 8:43:00 PM
8/21/07 6:38:35 AM
|
Bingo!
The usenet thread was indeed the answer to my problem - I've been referring to that box by that ip address for so long that I had forgotten that the address really belonged to my gateway and was forwarding to something else.
Putting in the box's actual ip address seems to have solved the problem.
Thanks!
Java is a joke, only it's not funny.
--Alan Lovejoy
|
Post #149,747
4/1/04 9:28:02 PM
|
Glad to have helped.
|
Post #149,748
4/1/04 9:33:00 PM
|
Using * as I suggested would also have worked... :-P
To deny the indirect purchaser, who in this case is the ultimate purchaser, the right to seek relief from unlawful conduct, would essentially remove the word consumer from the Consumer Protection Act - [link|http://www.techworld.com/opsys/news/index.cfm?NewsID=1246&Page=1&pagePos=20|Nebraska Supreme Court]
|
Post #149,802
4/2/04 12:35:23 PM
8/21/07 6:39:17 AM
|
I tried that at one point
and either it didn't work - or MSIE tricked me into believing that it didn't work (the tenacity of IE's caching is really astonishing - what good is a reload button that doesn't reload?)
Java is a joke, only it's not funny.
--Alan Lovejoy
|
Post #149,804
4/2/04 12:39:14 PM
|
Crtl Reload
"You're just like me streak. You never left the free-fire zone.You think aspirins and meetings and cold showers are going to clean out your head. What you want is God's permission to paint the trees with the bad guys. That wont happen big mon." Clete questions, help? [link|mailto:pappas@catholic.org|email pappas at catholic.org]
|
Post #149,840
4/2/04 5:27:29 PM
8/21/07 6:40:11 AM
|
On OS X I think its alt
Java is a joke, only it's not funny.
--Alan Lovejoy
|
Post #149,744
4/1/04 7:32:45 PM
|
I know that it CAN work
Because it works on my development box. However the config is kind of long, and posting it would not be helpful since I didn't set it up, I don't know what matters, and it has some very specific tricks.
Example trick. I have 3 Apache servers generated from 1 template. One to reverse-proxy http, one to reverse-proxy https, and one to run mod_perl. That allows mod_perl requests to be served as quickly as I can generate data, and then the big mod_perl process can serve someone else while the client receives data however slowly they receive it.
But some questions come to mind. First of all, what version of Apache do you have? It is possible that you have Apache 2 and therefore need to do some things differently to make stuff work. (What, I don't know. I use Apache 1.3. As does most of the net.)
Also unless there is a really specific reason to do otherwise, BindAddress *, NameVirtualHost *, and VirtualHost *. But, you say, you know your IP address, why use *? My attitude is that it is a moving part. For instance are you testing the server from the same box? Is it possible that something, somewhere, is realizing that you are going to localhost, and the IP address that you are requesting is always localhost, which was not bound for use by virtual servers?
I'd also suggest considering "stupid errors". Such as, "Is my configuration even being looked at, or is Apache running based on a copy of the configuration somewhere other than where I'm looking at?" Can you get ANY configuration change to take effect?
Cheers, Ben
To deny the indirect purchaser, who in this case is the ultimate purchaser, the right to seek relief from unlawful conduct, would essentially remove the word consumer from the Consumer Protection Act - [link|http://www.techworld.com/opsys/news/index.cfm?NewsID=1246&Page=1&pagePos=20|Nebraska Supreme Court]
|
Post #149,758
4/1/04 11:36:03 PM
|
Here is how I do it.
$VHOST == Attempt to obfuscate # Virtual Host: perl.gregfolkert.net\n#####################################\n<VirtualHost *>\nServerAdmin greg@gregfolkert.net\nDocumentRoot $VHOST/net/perl/html\nServerName perl.gregfolkert.net\nErrorLog $VHOST/logs/perl.net.error_log\nCustomLog $VHOST/logs/perl.net.access_log full\nErrorDocument 404 /umm-oops.html\nScriptAlias /cgi-bin/ $VHOST/net/perl/cgi-bin/\n <Directory $VHOST/net/perl/cgi-bin/>\n AllowOverride None\n Options ExecCGI\n Order allow,deny\n Allow from all\n </Directory>\n</VirtualHost> If you need more help... lemme know. You don't really need the st.at.ic.ip:port number. As long as that is sepcified in the main conf area. The SSL stuff only needs to be there if you have it on by default. Also if the vhost setup isn't right... well it'll default to the first defined host. And if vhost is setup isn't proper... you will only get the "default" .
-- [link|mailto:greg@gregfolkert.net|greg], [link|http://www.iwethey.org/ed_curry|REMEMBER ED CURRY!] @ iwethey
'In view of the fact that Microsoft is a condemned monopolist and on the other hand the internal messages and financial transactions of SCO look ever doubtful, Microsoft should be really anxious that to the own company something does not remain sticking from the Gestank of the SCO.' --Plagarized from [link|http://www.groklaw.net/article.php?story=20040322133607169|GROKLAW]
|