Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I am trying to run a very basic webserver for development/debugging. The static HTML seems to be delivered correctly, but it seems that the JavaScript libraries are not being delivered to the browser. The page HTML says something like

<html>
<head>
  <script type='text/javascript' src="/lib/json.js"></script>
...

Now, I have set up a link for /lib/ in my httpd.conf as:

Scriptalias /lib/ "/SomeFolder/lib/"

When I do this, it can't fetch the files because this is what I see in my apache error log:

... [error] [client ::1] client denied by server configuration: /SomeFolder/lib/json.js, referer: http://localhost/SomeSite

It seems that apache is not allowing access to the folder, so I add this to httpd.conf:

<Directory "/SomeFolder/lib/">
    Allow from all
</Directory>

After this, browsing the page still does not run the JS, instead I see the following error in my apache error log:

[error] [client ::1] (13)Permission denied: exec of '/SomeFolder/lib/json.js' failed, referer: http://localhost/SomeSite

So now, it seems that apache is trying to run the JS files on the server like a cgi script or something. But I have not made that folder a cgi-bin folder. The only lines where SomeFolder is mentioned by name is in these lines in httpd.conf:

Scriptalias /lib/ "/SomeFolder/lib/"
<Directory "/SomeFolder/lib/">
    Allow from all
</Directory>
share|improve this question

1 Answer 1

up vote 2 down vote accepted

Because you are using ScriptAlias, it is treating everything in that directory like a CGI script. What you'll want to use instead is Alias:

Alias /lib "/SomeFolder/lib"

Andrew

share|improve this answer
    
Thanks! That did it! –  highBandWidth Jan 13 '11 at 23:01

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.