View Full Version : Apache2 not serving page properly

October 27th, 2009, 04:00 PM
I have a basic html page with some javascript libraries. When I open the page using firefox using the File -> Open the page loads and works as expected. But when I try to load it via my apache2 server it doesn't load properly. I type localhost/inaglaze/custom.html This opens the page up, but it doesn't run the javascript. What am I missing?

October 28th, 2009, 03:42 PM

October 28th, 2009, 04:28 PM
Did you had a look at for example the firefox error console? Maybe there's information for you.

October 28th, 2009, 08:20 PM
Without a bit of source code I don't think anybody will be of great assistance.
Can you show the part where you load the javascript?

My guess is that the javascript may be loaded from a hardcoded path like so:

<script type="text/javascript" src="/home/<user>/<path>/javascript"></script>

That does work when loading the html file with "file -> open" but does not work when loading the javascript though apache.

October 28th, 2009, 08:28 PM
... Because Apache serves a ‘virtual directory tree’ to the world which does not have its root at / but rather at the directory Apache is configured to serve (e.g. /var/www/).