Today, my problem was solved. Now I am happy. From last two days, I was trying to configure Apache2 with CGI. But it gave many errors from the starting point. FIrstly, I does not have default file in sites-available folder of Apache2 ,Actually dafault file contains code for CGI. So I changed the permissions (from -r-to -rw-) of etc/Apache2/sites-available/000-dafult.conf file and write CGI code in it. But still it gaves Internal Error when I run hello.py on browser. Whole day, I was trying.
But today, Sir help me and my problem solved. Actually I run python file hello.py from /var/www/ Which can’t run python file. It just run HTML files. I have to run python file from usr/lib/cgi-bin/hello.py. But it gives error NOT FOUND when I run hello.py from /usr/lib/cgi-bin/hello.py. Beacause I did not write comment #! usr/bin/python , When I add this comment to my file. It works.