Cannot access javascript folder

Solution 1:

Ubuntu Apache configuration already has Alias /javascript /usr/share/javascript/, see /etc/apache2/conf.d/javascript-common.conf. You could change this alias or remove this file altogether but I don't know if this breaks something else.

Solution 2:

The issue:

Web applications that use JavaScript need to distribute it through HTTP. Using a common path for every script avoids the need to enable this path in the HTTP server for every package.

This is the package that creates /usr/share/javascript alias and enables it in the Apache webserver.

Recommended fix

And that's it, you won't have any other problem with javascript directories. Another fix could be to rename /usr/share/javascript/ to /usr/share/javascript-common/, then adjust the Alias in javascript-common.conf to point to the renamed dir. Still not sure if this will affect any future update.

Another Fix:

Go to /etc/apache2/conf-available/javascript-common.conf, you will find this:

Alias /javascript /usr/share/javascript/
<Directory "/usr/share/javascript/">
     Options FollowSymLinks MultiViews

So you just have to comment this lines (with the # char) (is not recommend to edit directly the file in conf-enabled) to avoid the forbidden error. After that, do this:

a2disconf javascript-common
a2enconf javascript-common