ScriptAlias configuration not working in apache2

2019-07-04 01:20发布

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条回答
forever°为你锁心
2楼-- · 2019-07-04 01:42

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/.

查看更多
登录 后发表回答