PDA

View Full Version : Apache2 not serving page properly



bryce4president
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?

bryce4president
October 28th, 2009, 03:42 PM
anybody?

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

CyberJack
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.

Reiger
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/).