You don't have permission to access javascript on this server

时间:2023-03-09 22:29:15
You don't have permission to access javascript on this server

今天访问遇到一个很奇怪的问题,在本地测试 http://localhost:9012/javascript/, 报错:

Forbidden
You don't have permission to access /javascript/ on this server.
Apache/2.2.22 (Ubuntu) Server at localhost Port 9012

当然,我已经检查了一遍又一遍的权限。

为了排除问题, 我尝试  move javascript js, and http://localhost:9012/js/  就可以访问

因此这既不是权限问题,也不是 9012 端口的配置问题

问题一定还在 Apache

原创文章,转载请注明:http://www.cnblogs.com/phpgcs

最终被找到了。。。

/etc/apache2/conf.d/javascript-common.conf

 Alias /javascript /usr/share/javascript/

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

赶紧禁用掉这个javascript别名配置文件吧。