无法运行CGI,显示纯文本格式(Ubuntu的13.10阿帕奇2.4) [英] Cannot run cgi, show plain text only (Ubuntu 13.10 Apache 2.4)

查看:151
本文介绍了无法运行CGI,显示纯文本格式(Ubuntu的13.10阿帕奇2.4)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚刚安装Ubuntu 13.10,我试图安装Apache。但是,当我试图运行在cgi-bin目录一个Perl文件时,浏览器显示,只有纯文本。

I just install Ubuntu 13.10 and I am trying to install Apache. But when I tried to run a perl file in cgi-bin, the browser showed only plain text.

我的Apache default.conf是如下:

My default.conf of Apache is below:

    AddHandler cgi-script .cgi .pl
    ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
    <Directory "/usr/lib/cgi-bin">
            AllowOverride None
            Options +Indexes +ExecCGI +MultiViews +SymLinksIfOwnerMatch
            #Order allow,deny
            Require all granted
            Allow from all
    </Directory>

这是我的Perl CGI文件:

This is my perl cgi file:

    #!/usr/bin/perl
    print "Content-type: text/html\n\n";
    print "<html>\n";
    print "<title> PERL CGI</title>\n";
    print "<body>";
    print "hello perl-cgi!!!!!!!";
    print "</body>";
    print "</html>\n";

我已经打开了处理程序mime.conf该文件是/ usr / lib目录/ cgi-bin目录,我运行它作为HTTP不是文件:///。我还安装了mod_perl的。
我是新来的Apache。我已经搜索了几个小时,试图无尽的Apache配置,请阅读Apache的文档,但仍然解决不了。难道是因为+ ExecCGIcode有一些问题?我看到另外一个人也更新的Ubuntu 12.04到13.10后达到类似的问题。也许Ubuntu的是什么问题?
请帮忙。 Apache的配置和Ubuntu许可几乎把我逼疯。

I have turned on the Handler in mime.conf The file is in /usr/lib/cgi-bin, and I run it as http not file:///. I have also installed mod_perl. I am new to Apache. I have searched for several hours, try endless Apache configurations, read Apache document but still cannot solve it. Is it because the "+ExecCGI" code has some problem? I saw another person also meet similar problem after updating Ubuntu 12.04 to 13.10. Maybe Ubuntu is the problem? Please help. The Apache configuration and Ubuntu permission almost drive me mad.

推荐答案

尝试
须藤a2enmod CGI

Try sudo a2enmod cgi

然后重新启动Apache!

Then restart apache!

这篇关于无法运行CGI,显示纯文本格式(Ubuntu的13.10阿帕奇2.4)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆