Trouble running python script as cgi under apache (ubuntu 12)

后端 未结 6 1771
再見小時候
再見小時候 2021-02-07 15:31

Disclosure: I searched a lot, and I don\'t think my question (for my configuration) is answered here. For example run python script as cgi apache server doesn\'t answer it.

6条回答
  •  有刺的猬
    2021-02-07 15:42

    try this

        
                Options Indexes FollowSymLinks MultiViews
                AllowOverride None
                Order allow,deny
                allow from all
        
    

    cgi script

    import cgi
    import cgitb; cgitb.enable()
    print "Content-type: text/html\n\n"
    print "

    Hello from Python!

    "

    Why don't you configure like this? here.

    ScriptAlias /cgi-bin/ /var/www/my_cgi_dir/
    
        AllowOverride None
        Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
        Order allow,deny
        Allow from all
    
    

提交回复
热议问题