ScriptAlias configuration not working in apache2

╄→гoц情女王★ 提交于 2019-12-23 16:30:04

问题


I installed apache2 on ubuntu. I added the following to /etc/apache2/httpd.conf file

ScriptAlias /cgi-bin/ "/home/PROJECT/cgi-bin/"

I am able to open the cgi file if i copy the cgi file to /usr/lib/cgi-bin/hello.cgi[DocumentRoot directory] and access the URL http://localhost/cgi-bin/hello.cgi, but i get cannot access the file if i put it in /home/PROJECT/cgi-bin/hello.cgi even though ScriptAlias is set and apache2 restarted.

Any thing that i am missing here ?


回答1:


I had the same problem. The reason was in httpd.conf, I had to remove global

ScriptAlias /cgi-bin/ /var/www/cgi-bin/

otherwise everything starting /cgi-bin/ fell into /var/www/cgi-bin/.



来源:https://stackoverflow.com/questions/7166150/scriptalias-configuration-not-working-in-apache2

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!