如何配置的Apache2运行Perl CGI脚本? [英] How do I configure apache2 to run Perl CGI scripts?
问题描述
我想配置的Apache2
上运行的Kubuntu
执行的Perl CGI
脚本。我试过,我碰到google搜索通过一些措施,但似乎没有任何工作。
可有人请点我实现这一目标的正确方法?
I would like to configure apache2
running on Kubuntu
to execute Perl CGI
scripts. I've tried some steps that I came across by googling, but nothing seems to work.
Can someone please point me to the right way of achieving this?
推荐答案
您将需要看看你的apache的错误日志,看看什么是内部服务器错误的说法。四个最有可能的情况下,我的经验是:
You'll need to take a look at your apache error log to see what the "internal server error" is. The four most likely cases, in my experience would be:
-
CGI程序是在未启用CGI执行的目录。解决方法:要么通过httpd.conf文件或.htaccess文件的
ExecCGI
选项添加到该目录
Apache的配置为只从一个专用的cgi-bin
目录运行CGI程序。解决方法:有移动CGI程序或添加 AddHandler的CGI脚本的CGI
语句的httpd.conf
Apache is only configured to run CGIs from a dedicated cgi-bin
directory. Solution: Move the CGI program there or add an AddHandler cgi-script .cgi
statement to httpd.conf.
CGI程序没有设置为可执行。解决方案(假设一个* nix的类型操作系统):搭配chmod + X my_prog.cgi
The CGI program is not set as executable. Solution (assuming a *nix-type operating system): chmod +x my_prog.cgi
CGI程序正在退出而不发送标题。解决方法:在命令行中运行程序,验证一个),实际上它运行,而不是一个编译时错误垂死和b)它生成正确的输出,其中应包括,在很miniumum,一个内容类型
头和继上次的头一个空行。
The CGI program is exiting without sending headers. Solution: Run the program from the command line and verify that a) it actually runs rather than dying with a compile-time error and b) it generates the correct output, which should include, at the very miniumum, a Content-Type
header and a blank line following the last of its headers.
这篇关于如何配置的Apache2运行Perl CGI脚本?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!