激活Apache2 ubuntu 14.04的CGI

激活Apache2 ubuntu 14.04的CGI,apache,ubuntu,cgi,Apache,Ubuntu,Cgi,我无法设置cgi服务器,但是可以访问像/var/www/html/index.html这样的普通页面。我对设置web服务器和处理系统设置非常陌生,所以我可能缺少一些基本的东西。 我是以下和教程。我认为问题在于LoadModule cgi_module modules/mod_cgi.so。但我不确定。 我正在写我所做的配置更改 在文件/etc/apache2/apache.conf中,我添加了以下行: Include /etc/apache2/httpd.conf 下面是/etc/apache

我无法设置cgi服务器,但是可以访问像/var/www/html/index.html这样的普通页面。我对设置web服务器和处理系统设置非常陌生,所以我可能缺少一些基本的东西。 我是以下和教程。我认为问题在于LoadModule cgi_module modules/mod_cgi.so。但我不确定。 我正在写我所做的配置更改

在文件/etc/apache2/apache.conf中,我添加了以下行:

Include /etc/apache2/httpd.conf
下面是/etc/apache2/httpd.conf的外观:

<Directory /var/www/html/cgi>
Options ExecCGI
SetHandler cgi-script
</Directory>
<Directory /var/www/html>
Options +ExecCGI
AddHandler cgi-script .cgi .py
</Directory>
#LoadModule cgi_module modules/mod_cgi.so
如果在未注释httpd.conf(LoadModule..)的最后一行时执行此操作,则会出现以下错误:

apache2: Syntax error on line 146 of /etc/apache2/apache2.conf: Syntax error on line 12 of /etc/apache2/httpd.conf: Cannot load modules/mod_cgi.so into server: /etc/apache2/modules/mod_cgi.so: cannot open shared object file: No such file or directory
Your MPM seems to be threaded. Selecting cgid instead of cgi.
Module cgid already enabled
我看了看答案。我确实在mods enabled目录中进行了查找,但在那里找不到cgi.load,尽管cgid.load在那里

在httpd.conf中的LoadModule行被注释后,我在执行sudo a2enmod cgi时得到以下消息:

Your MPM seems to be threaded. Selecting cgid instead of cgi.
Module cgid already enabled
然而,在这两种情况下,当我试图从浏览器打开test.py文件时,我都会

500 Internal Server Error
我不认为test.py有什么问题。但是,它只有一行:

print "Hello World"
任何帮助都将不胜感激

print "Hello World"