Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

Today I just updated my ubuntu from 12.04 to 13.10 . And then some thing happened really bad.

I cannot execute Python CGI in ubuntu 13.10 apache 2.4 even through I already config everything in Apache2 setting. But I still cannot execute it (Its show a python cgi source code in browers instead of running) .

Before install 13.10 I was using 12.04 and everything worked fine . But now I don't know why. I'm writting a website and I have to be finished soon . But now I don't know how to solve this problem.

Why this happened ?

Where did I wrong ?

/etc/apache2/apache2.conf :

IncludeOptional mods-enabled/*.load
IncludeOptional mods-enabled/*.conf
Include ports.conf
Include conf-available/serve-cgi-bin.conf

Options +Indexes +FollowSymLinks +ExecCGI

AllowOverride None
Allow from all
AddHandler cgi-script .py
Require all granted
Options +Indexes +FollowSymLinks +ExecCGI

AllowOverride None
Allow from all 
AddHandler cgi-script .py
Require all granted
Options +Indexes +FollowSymLinks +ExecCGI

AllowOverride None
Allow from all
AddHandler cgi-script .py
Require all granted

/etc/apache2/sites-available/000-default.conf :

Include conf-available/serve-cgi-bin.conf

ServerAdmin webmaster@localhost
DocumentRoot /media/web

Options +ExecCGI
AddHandler cgi-script .py

<Directory /media/web/>
    Options +Indexes +FollowSymLinks +ExecCGI
    AllowOverride None
    AddHandler cgi-script .py
    Allow from all
    Require all granted
</Directory> 

/etc/apache2/conf-enabled/serve-cgi-bin.conf :

<IfModule mod_cgi.c>
    Define ENALBLE_USR_LIB_CGI_BIN
</IfModule>

<IfModule mod_cgid.c>
    Define ENALBLE_USR_LIB_CGI_BIN
</IfModule>

<IfDefine ENALBLE_USR_LIB_CGI_BIN>
    ScriptAlias /cgi-bin/ /media/web/

    <Directory "/media/web">
        AllowOverride None

        Options +ExecCGI +MultiViews +SymLinksIfOwnerMatch +FollowSymLinks
        Allow from all

        AddHandler cgi-script .py
</Directory>
</IfDefine>

vim: syntax=apache ts=4 sw=4 sts=4 sr noet

I can accces localhost normally and work fine .I already restart & reload apache 2 for thousand time but still not working !

share|improve this question
2  
If you want people to answer your question, you should really fix the formatting. –  don.joey Nov 24 '13 at 2:14
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.