Forum Moderators: phranque
<script type="text/javascript" src="/javascript/alertTest.js"></script> does not work.
Oddly, if I type
http://virtuaHostName/css/style.css If I try
http://virtuaHostName/javascript/alertTest.js If I try
http://virtuaHostName/css/ If I try
http://virtuaHostName/javascript/ When I try to
ls -la the website's document root all files and folders are owned by me and have the same permissions. Does anyone know what is causing this?
thank you,
George
If I try
http://virtuaHostName/javascript/
I get permission denied.
This will probably be because there in no index file (index.html or similar) in that directory, and your configuration blocks the listing of the directory contents. This is not a problem in itself, in fact it's good practice.
If the server is running Linux or similar Unix-type OS (rather than Windows), then check the capitalization of your Javascript file. Linux is case-sensitive when it comes to file names, unlike Windows, so "alertTest.js" is not the same as "AlertTest.js" or "alerttest.js".
This is happening in all the virtual hosts I have set up so I'm thinking that it is some module or setting in apache.
I have disabled the deflate mods in case they were affecting thing but this has made no difference.
Any help would be greatly appreciated.
cheers,
George
/javascript/ pointing to /usr/share/javascript/ - so your /javascript/ directory in your document-root is being bypassed/ignored. See: [httpd.apache.org...]
If this is the case, either remove the alias in httpd.conf and then Apache will use your directory rather than the alias, or keep the alias but change the directory name of your
/javascript/ directory to something else.
My httpd.conf file has nothing in it that I can see would alias javascript/
I checked the conf.d folder in apache and in there there is a file called javascript-common.conf which alias' javascript to /usr/share/javascript/
Once I'd commented out this file it all works as normal.
cheers,
George
[bugs.debian.org...]
The suggestion there is to rename
/usr/share/javascript/ to /usr/share/javascript-common/ (as root), then adjust the Alias in javascript-common.conf to point to the renamed directory. This depends of course what exactly resides in the shared javascript directory in the first place - it may not be required at all in your case.