Python Internal Server Error
Question: I'm new to Python Web Development and I have written the following code and
uploaded into the root of my server (`public_html`) folder:

    
    
    import web
    urls = ('/','index')
    app = web.application(urls, globals())
    class index:
        def GET(self):
            greeting = "Hello World"
            return greeting
    
    app.run()
    

My `.htaccess` file is:

    
    
    AddType text/html py
    AddHandler cgi-script .py .cgi
    

When I open my site, I get the following error:

    
    
    Internal Server Error
    
    The server encountered an internal error or misconfiguration and was unable to complete your request.
    
    Please contact the server administrator, webmaster@example.com and inform them of the time the error occurred, and anything you might have done that may have caused the error.
    
    More information about this error may be available in the server error log.
    
    Additionally, a 500 Internal Server Error error was encountered while trying to use an ErrorDocument to handle the request.
    

My cPanel Error Log shows:

    
    
    [Thu Jul 30 10:44:42 2015] [error] [client 1.1.1.1] client denied by server configuration: /home/user/public_html/.htaccess
    [Thu Jul 30 10:36:53 2015] [error] [client 1.1.1.1] attempt to invoke directory as script: /home/user/public_html/cgi-bin/, referer: http://example.com/
    

Most of the places I searched for said that the `.py` file should be given
permission 755. I did the same and in addition, even gave 755 permission to
`.htaccess` file.

What may be the probable solution?


Answer: I believe its neither issue with py or .htaccess file permissions, its all
about provide access to the files under .htaccess in the configuration
section... check that out!!!!

