logo
Apache Lounge
Webmasters

 

About Forum Index Downloads Search Register Log in RSS X


Keep Server Online

If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.

or

Bitcoin

A donation makes a contribution towards the costs, the time and effort that's going in this site and building.

Thank You! Steffen

Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.
Post new topic   Forum Index -> Apache View previous topic :: View next topic
Reply to topic   Topic: A crazy Virtual Host Issue
Author
tazmon95



Joined: 23 Dec 2005
Posts: 3

PostPosted: Fri 06 Jan '06 14:14    Post subject: A crazy Virtual Host Issue Reply with quote

Hello and thanks for all that you do for the community. I was not looking forward to having to figure out how to compile 2.2.0 and I'm very grateful that you did it for me Very Happy Thanks

Ok, on to my issues. I've had a server running for a couple years now that is back in the states. Not very powerful and I've been running into a lot of issues with it crashing when I'm processing pictures to add to my gallery. So I now live in Japan and have a server here and I am moving some of my domains to this box. Up until now everything has gone smooth but when trying to get my VirtualHost tags to work right I'm pulling out my hair.

Ok so say my IP is 220.157.147.144

Here's what I have in the httpd.conf
Code:
NameVirtualHost 220.157.147.144

<VirtualHost 220.157.147.144>
   ServerAdmin admin@tazmon.com
   DocumentRoot D:/Webs/Taz
   ServerName tazmon.com
   ServerAlias www.tazmon.com
   ErrorLog logs/tazmon.com-error_log
   CustomLog logs/tazmon.com-access_log common
</VirtualHost>

But when I use this it doesn't go to the file that's in the D:/Webs/Taz directoy, instead it pulls my default index.htm file from D:/Webs which is my DocumentRoot

Now here's what really makes no sense to me at all. One time while re-typing the whole thing, I made a typo and then it all worked...
Code:
NameVirtualHost 220.157.147.144

<VirtualHost 220.157.1147.144>
   ServerAdmin admin@tazmon.com
   DocumentRoot D:/Webs/Taz
   ServerName tazmon.com
   ServerAlias www.tazmon.com
   ErrorLog logs/tazmon.com-error_log
   CustomLog logs/tazmon.com-access_log common
</VirtualHost>

Notice the 1147 in the IP... I can't figure this out, I've read through all my Apache2 Manuals, Read through the Apache.org Manual on everything having to do with VirtualHosts and tried it all. If you or anyone here can help me out I would be very grateful.

Thanks,
Taz
Back to top
Steffen
Moderator


Joined: 15 Oct 2005
Posts: 3092
Location: Hilversum, NL, EU

PostPosted: Fri 06 Jan '06 14:25    Post subject: Reply with quote

Hi

You can try:

Listen 80
..
NameVirtualHost *
<VirtualHost 220.157.147.144>
..
..

or
NameVirtualHost *

<VirtualHost *>
...

When you want to bind to a IP make:

Listen 220.157.147.144:80


Steffen
Back to top
tazmon95



Joined: 23 Dec 2005
Posts: 3

PostPosted: Fri 06 Jan '06 14:50    Post subject: Reply with quote

Thanks for the help Steffen,

What ended up working was close the the second idea you had.

Listen 80
...
NameVirtualHost *
...
<VirtualHost *>
...

no where in my .conf files do I have my IP which seems kinda strange to me

If I try Listen 220.157.147.144:80 the server won't start. I get a pop up saying, "The requestion operation has failed!" But with just the port it works... Not sure why but this works for the sub-domains too. Thanks for the help.
Back to top
James Blond
Moderator


Joined: 19 Jan 2006
Posts: 7371
Location: Germany, Next to Hamburg

PostPosted: Mon 23 Jan '06 16:38    Post subject: Reply with quote

If the IP is not 127.0.0.1 (localhost) make sure that you tell it Windows in the hosts file in C:\WINDOWS\system32\drivers\etc
With a non static IP just Listen the Port.
Back to top


Reply to topic   Topic: A crazy Virtual Host Issue View previous topic :: View next topic
Post new topic   Forum Index -> Apache