IWETHEY v. 0.3.0 | TODO
1,095 registered users | 0 active users | 0 LpH | Statistics
Login | Create New User
IWETHEY Banner

Welcome to IWETHEY!

New 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
Expand Edited by tuberculosis Aug. 21, 2007, 06:38:22 AM EDT
New Let me know if you figure it out
I'm having the same problem.
===

Implicitly condoning stupidity since 2001.
New 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]
New 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
Expand Edited by tuberculosis Aug. 21, 2007, 06:38:26 AM EDT
New 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...)
New 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
Expand Edited by tuberculosis Aug. 21, 2007, 06:38:35 AM EDT
New Glad to have helped.
New 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]
New 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
Expand Edited by tuberculosis Aug. 21, 2007, 06:39:17 AM EDT
New 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]
New On OS X I think its alt



Java is a joke, only it's not funny.

     --Alan Lovejoy
Expand Edited by tuberculosis Aug. 21, 2007, 06:40:11 AM EDT
New 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]
New 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]
     Apache virtual hosts - (tuberculosis) - (12)
         Let me know if you figure it out - (drewk)
         perhaps in your hosts file - (boxley) - (1)
             Not in the hosts file - domain is available by DNS though - (tuberculosis)
         I assume you've done the obvious things. - (Another Scott) - (6)
             Bingo! - (tuberculosis) - (5)
                 Glad to have helped. -NT - (Another Scott)
                 Using * as I suggested would also have worked... :-P -NT - (ben_tilly) - (3)
                     I tried that at one point - (tuberculosis) - (2)
                         Crtl Reload -NT - (boxley) - (1)
                             On OS X I think its alt -NT - (tuberculosis)
         I know that it CAN work - (ben_tilly)
         Here is how I do it. - (folkert)

There are some who call me... LRPD.
138 ms