ScriptAlias指令的配置不工作的Apache2 [英] ScriptAlias configuration not working in apache2
问题描述
我安装在Ubuntu的Apache2。我添加以下内容 /etc/apache2/httpd.conf
文件
I installed apache2 on ubuntu. I added the following to /etc/apache2/httpd.conf
file
的ScriptAlias / cgi-bin目录//家庭/项目/ cgi-bin目录/
我能够打开文件的cgi,如果我复制CGI文件 /usr/lib/cgi-bin/hello.cgi
[DocumentRoot的目录],并访问网址 HTTP://localhost/cgi-bin/hello.cgi
,但我得到无法访问该文件,如果我把它放在 /家庭/ PROJECT /cgi-bin/hello.cgi
即使的ScriptAlias
设置并重新启动的Apache2
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 ?
推荐答案
我有同样的问题。原因是在httpd.conf中,我不得不删除全局
I had the same problem. The reason was in httpd.conf, I had to remove global
ScriptAlias /cgi-bin/ /var/www/cgi-bin/
否则一切开始/ cgi-bin目录/跌入/无功/网络/ cgi-bin目录/.
otherwise everything starting /cgi-bin/ fell into /var/www/cgi-bin/.
这篇关于ScriptAlias指令的配置不工作的Apache2的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!