Forum Moderators: phranque

Message Too Old, No Replies

VirtualHost problems

html and htm pages wont load.

         

Stuperfied

2:13 pm on Apr 7, 2005 (gmt 0)

10+ Year Member



With some much needed and much appreciated help from people here at webmaster world, I finally got VirtualHosts setup and working but there is still one problem. html and htm pages wont load inside of VirtualHost directories.

If I set the DocumentRoot for the VirtualHost to C:/web, the default index.html or index.htm pages (as set by the DirectoryIndex) inside of that directory work. However if I set it to C:/web/example the same (*copied) pages will not load.

ie:
I used the following setup for my server.


NameVirtualHost *

<VirtualHost *>
DocumentRoot C:/web
ServerName *
</VirtualHost>

<VirtualHost *>
DocumentRoot C:/web/example
ServerName www.example.com.au
ServerAlias example.com.au www.example.com.au
</VirtualHost>


I made a test page called "index.html" and tested it to make sure it works. I placed the file into the directory "C:/web/example". I typed "http://220.***.21.36/example" into IE and the page worked. When I typed "http://www.example.com.au" into Internet Explorer the page failed to load. I then created an ActiveHTML page and saved it as index.asp, I then tested the page to make sure it worked and placed it into the "C:/web/example" directory. I typed "http://www.example.com.au" into IE and it worked.

I then tried the following configuration for my server.


NameVirtualHost *

<VirtualHost *>
DocumentRoot C:/web
ServerName *
</VirtualHost>

<VirtualHost *>
DocumentRoot C:/web
ServerName www.example.com.au
ServerAlias example.com.au www.example.com.au
</VirtualHost>


With this configuration, the html file which I placed in "C:/web" loaded when I typed "http://www.example.com.au" into IE.

Why would the html files work in "C:/web" when accessed through a VirtualHost and not in "C:/web/example" when accessed through a VirtualHost?
Is there something so obviously simple and stupid that I am missing?
Any help would be appreciated and I thank you for taking the time to read my post. I appologise if I have made this too hard to understand, im not good at explaining things.

[edited by: jdMorgan at 2:58 pm (utc) on April 11, 2005]
[edit reason] Examplified. [/edit]

Stuperfied

1:28 am on Apr 8, 2005 (gmt 0)

10+ Year Member



Ive just spent the last 2hrs surfing the Apache online documentation as I have been the last few weeks. I still cant find a solution to this latest problem, I can only guess that since no-one has replied that no-one else can find a solution either.

Maybe I just found the latest bug...:(

sitz

3:48 am on Apr 8, 2005 (gmt 0)

10+ Year Member



I can only guess that since no-one has replied that no-one else can find a solution either.

Or, more likely, they simply aren't having the problem. ;) As tempting as it is to assume that if you can't find the answer after $DAYS or $WEEKS of looking, as I've learned on several occassions, it's almost NEVER the software's fault and almost INVARIABLY the admin's. Sure, all software has bugs. The trap is *assuming* that the software has bugs. If you go in with the mindset that the software works fine and it's just a matter of finding the right magic, you'll be right far more often.

However if I set it to C:/web/example the same (*copied) pages will not load.

Define 'not load'; 404 error? 403? Something else? Have you checked the error log for details?

[edited by: jdMorgan at 2:59 pm (utc) on April 11, 2005]
[edit reason] Examplifed [/edit]

Stuperfied

8:40 am on Apr 10, 2005 (gmt 0)

10+ Year Member



All I get in the browser is 404 file not found and the log reports no errors.

Stuperfied

8:42 am on Apr 10, 2005 (gmt 0)

10+ Year Member



Im going to have to redirect it back to the avs network now though for a while because im getting too many complaints about the site not being up.

Still if you have any ideas I would love to hear them cause I will point it back at our server a little later on when we get closer to the solution.

py9jmas

9:28 am on Apr 10, 2005 (gmt 0)

10+ Year Member



Where did you get
ServerName *

from? I can't see anything in the Apache docs saying '*' is a valid server name.

Have you checked your vhost configuration? What does

apachectl -t -D DUMP_VHOSTS
look like?

sitz

2:35 pm on Apr 10, 2005 (gmt 0)

10+ Year Member



All I get in the browser is 404 file not found and the log reports no errors.

If 404s are appearing in the browser, a message of some sort should get logged to the error log, which will include the full path to the file that couldn't be found.

Stuperfied

11:43 pm on Apr 10, 2005 (gmt 0)

10+ Year Member



I changed that ServerName to localhost but no effect. The URL "http://www.example.com.au" is a registered domain for our business, I had it redirected at our server for trouble shooting purposes. The URL hasnt been redirected back to AVS yet so I accessed the URL so I could spam this info for you.

IE Browser page.


The page cannot be found
The page you are looking for might have been removed, had its name changed, or is temporarily unavailable.

--------------------------------------------------------------------------------

Please try the following:

If you typed the page address in the Address bar, make sure that it is spelled correctly.

Open the www.example.com.au home page, and then look for links to the information you want.
Click the Back button to try another link.
Click Search to look for information on the Internet.

HTTP 404 - File not found
Internet Explorer

Access Log.


12.202.26.207 - - [11/Apr/2005:08:28:48 +1000] "GET /neoclan/wartimetest.asp HTTP/1.1" 200 1099
12.202.26.207 - - [11/Apr/2005:08:28:55 +1000] "GET /favicon.ico HTTP/1.1" 404 287
12.202.26.207 - - [11/Apr/2005:08:29:31 +1000] "POST /neoclan/wartimetest.asp HTTP/1.1" 200 1175
12.202.26.207 - - [11/Apr/2005:08:29:42 +1000] "GET /favicon.ico HTTP/1.1" 404 287
12.202.26.207 - - [11/Apr/2005:08:29:48 +1000] "POST /neoclan/wartimetest.asp HTTP/1.1" 200 1175
12.202.26.207 - - [11/Apr/2005:08:29:53 +1000] "GET /favicon.ico HTTP/1.1" 404 287
68.248.136.119 - - [11/Apr/2005:08:38:13 +1000] "GET /FTO/Banners/Draco_sig_600x100.gif HTTP/1.1" 200 33091
192.168.0.251 - - [11/Apr/2005:09:35:00 +1000] "GET / HTTP/1.1" 404 25

That last one was me, I didnt list all of Monday because its too long.

Error Log.


[Mon Apr 11 08:29:53 2005] [error] [client 12.***.26.207] File does not exist: C:/web/favicon.ico
[Mon Apr 11 09:32:54 2005] [notice] Parent: Received shutdown signal -- Shutting down the server.
[Mon Apr 11 09:32:54 2005] [notice] Child 3396: Exit event signaled. Child process is ending.
[Mon Apr 11 09:32:56 2005] [notice] Child 3396: Released the start mutex
[Mon Apr 11 09:33:02 2005] [notice] Child 3396: Waiting for 250 worker threads to exit.
[Mon Apr 11 09:33:02 2005] [notice] Child 3396: All worker threads have exited.
[Mon Apr 11 09:33:02 2005] [notice] Child 3396: Child process is exiting
[Mon Apr 11 09:33:03 2005] [notice] Parent: Child process exited successfully.
[Mon Apr 11 09:33:13 2005] [notice] Parent: Created child process 3788
[Mon Apr 11 09:33:14 2005] [notice] Child 3788: Child process is running
[Mon Apr 11 09:33:14 2005] [notice] Child 3788: Acquired the start mutex.
[Mon Apr 11 09:33:14 2005] [notice] Child 3788: Starting 250 worker threads.
[Mon Apr 11 09:33:32 2005] [notice] Parent: Received restart signal -- Restarting the server.
[Mon Apr 11 09:33:32 2005] [notice] Child 3788: Exit event signaled. Child process is ending.
[Mon Apr 11 09:33:32 2005] [notice] Parent: Created child process 3868
[Mon Apr 11 09:33:33 2005] [notice] Child 3868: Child process is running
[Mon Apr 11 09:33:33 2005] [notice] Child 3788: Released the start mutex
[Mon Apr 11 09:33:33 2005] [notice] Child 3868: Acquired the start mutex.
[Mon Apr 11 09:33:33 2005] [notice] Child 3868: Starting 250 worker threads.
[Mon Apr 11 09:33:34 2005] [notice] Child 3788: Waiting for 250 worker threads to exit.
[Mon Apr 11 09:33:34 2005] [notice] Child 3788: All worker threads have exited.
[Mon Apr 11 09:33:34 2005] [notice] Child 3788: Child process is exiting

Thats everything thats in the error log for Monday.

Unfortunately I dont know what you mean by apachect1 or whatever it was, I tried opening my windows command prompt and typed it but it didnt do anything.

[edited by: jdMorgan at 3:01 pm (utc) on April 11, 2005]
[edit reason] Obscured specifics. [/edit]

sitz

2:48 am on Apr 12, 2005 (gmt 0)

10+ Year Member



So, the first thing we need to do (well, at this point, I suppose it's at least the fourth thing. heh.) is to figure out which <VirtualHost> container is getting the requests. In the main area of your server config is a 'CustomLog' directive which specifies the path and format of the access log. Copy this line into each of <VirtualHost> blocks, then change the path of the logfile a bit to differentiate them from both each other and the main server config. Then restart apache, make a few requests of the URL that's giving you problems, and see which log gets written to.

Stuperfied

8:21 am on Apr 12, 2005 (gmt 0)

10+ Year Member



I have already setup costom logs for it and it reports an access but does not report an error.

I have just stumbled on to some new information. We had to reset the <example> domain name to point back at the AVS Networks web server. After it was reset, I tried and tried to access the site but failed. I then noticed that my redirects in our server were still working so I checked the dns register using ipconfig /displaydns and it was associating www.example.com.au with our server IP 220.***.21.36. So I flushed the dns on all computers and tried again but It still errored out. I checked the DNS register again and it had recreated the association.

Everytime I flush the dns and even if I turn off the Apache web server, it keeps registering www.example.com.au to point to 220.***.21.36.

Any ideas about that one? I think this is what has been the cause of the problem all along.

[edited by: jdMorgan at 1:41 pm (utc) on April 12, 2005]
[edit reason] Removed specifics per TOS. [/edit]