Forum Moderators: phranque

Message Too Old, No Replies

Apache 2.2 on Win XP - problems with virtual hosts

Problem browsing site set up as virtual host

         

udon333

1:30 am on Jan 24, 2009 (gmt 0)

10+ Year Member



Hi there,
I'm a front-end web developer with little experience with servers and server-side scripts. I hope you'll bear with me...

I'm trying to set up virtual host on Apache in order to have a development environment where I can use absolute paths for links.
I've followed the instructions on [httpd.apache.org ]
and when I restart Apache, no errors appear.
I have added the new host names in the hosts file in Windows.
The site files are located under C:/SITES/www/MyWebSite
with an index.html as a test page.

THE PROBLEM:
When i try to browse the site (By typing [MyWebSite),...] it doesn't load. The message in the status bar is "waiting for MyWebSite..."

Could anyone please tell me what I might be doing wrong?
Is it my directory structure, or something more technical in the configuration?

Any help on this would be much appreciated!

extra information:
It was running fine with the 'Virtual hosts' turned off in httpd.conf - At the time, my folder structure was /My Documents/apachepub/localhost/www/index.html,
so I would type [localhost...] and my index page would load.
I have since changed the location but have updated the config file accordingly.

Caterham

1:49 am on Jan 24, 2009 (gmt 0)

10+ Year Member



Did you edit your hosts file to add

127.0.0.1    MyWebSite

so that MyWebSite resolves to your local machine?

You can find the hosts file usually under C:\WINDOWS\system32\drivers\etc\hosts

udon333

2:25 pm on Jan 24, 2009 (gmt 0)

10+ Year Member



Hi Caterham, yes I did that.
Any suggestions like this is helpful though, thanks!
...got any more please..?
;o)

Caterham

3:25 pm on Jan 25, 2009 (gmt 0)

10+ Year Member



So you could ping MyWebSite and your system should reply. Unless you removed the 'Listen 80' directive accidentally, the request for MyWebSite on port 80 should reach apache. How does your setting look like?

Listen 80
NameVirtualhost *:80
#
<Virtualhost *:80>
ServerName localhost
DocumentRoot "C:/My Documents/apachepub/localhost/www"
</Virtualhost>
#
<Virtualhost *:80>
ServerName MyWebSite
DocumentRoot "C:/SITES/www/MyWebSite"
</Virtualhost>

udon333

12:51 pm on Jan 26, 2009 (gmt 0)

10+ Year Member



Hi, yes I have all those lines across two files (httpd.conf + /extra/httpd-vhosts.conf)
I just restarted Apache and checked the error log, and I'm seeing these messages below - Does any of it indicate problems that could be located? :
start log text -

The Apache2.2 service is restarting.
The Apache2.2 service has restarted.
arent: Received restart signal -- Restarting the server.
[Mon Jan 26 12:39:21 2009] [notice] Child 588: Exit event signaled. Child process is ending.
[Mon Jan 26 12:39:22 2009] [notice] Child 588: Released the start mutex
[Mon Jan 26 12:39:23 2009] [notice] Child 588: All worker threads have exited.
[Mon Jan 26 12:39:23 2009] [notice] Child 588: Child process is exiting
[Mon Jan 26 12:39:25 2009] [notice] Apache/2.2.9 (Win32) configured -- resuming normal operations
[Mon Jan 26 12:39:25 2009] [notice] Server built: Jun 13 2008 04:04:59
[Mon Jan 26 12:39:25 2009] [notice] Parent: Created child process 988
[Mon Jan 26 12:39:29 2009] [notice] Child 988: Child process is running
[Mon Jan 26 12:39:29 2009] [notice] Child 988: Acquired the start mutex.
[Mon Jan 26 12:39:29 2009] [notice] Child 988: Starting 64 worker threads.
[Mon Jan 26 12:39:29 2009] [notice] Child 988: Starting thread to listen on port 80.
- end log text

Thanks so much for your time!

udon333

2:45 pm on Jan 26, 2009 (gmt 0)

10+ Year Member



Hello, I've got my virtual hosts working - I'm not sure how, but I started from scratch again, and this time actually stopped and started Apache instead of hitting the restart (I noticed this time, that my restart wasn't changing anything) - I don't know if this had been the problem all along, but I guess for now, it's sorted.
Thanks very much for your time - it's always good to know someone's out there willing to lend a few brain cells!
Many thanks

Caterham

4:08 pm on Jan 26, 2009 (gmt 0)

10+ Year Member



checked the error log, and I'm seeing these messages below

That are just notices showing you what's going on; nothing to worry about.