I am new to python cgi programming. I have installed apache 2.2 server on linux mint and I have my html form in var/www folder which is being displayed properly. Action to the form is a cgi script that I've put in the folder /usr/lib/cgi-bin. But on submit, it says "The requested URL /usr/lib/cgi-bin/file.cgi as not found on this server." Does anyone know the fix for this?
1
votes
1 Answers
3
votes
- What is the name of your Python program? Is it
/usr/lib/cgi-bin/file.cgi? - What are the rights of this file? Can it be read by apache? Can it be executed?
- Is first line with
#!/usr/bin/env pythonor similar good? Make sure that this file can be run from command line (ie. shebang is good) - Does apache receive request with that file? Look at apache logs, especially
error.logandaccess.log(probably in/var/log/apache) - Make sure you have enabled
ExecCGIfor/usr/lib/cgi-bin/directory in Apache configuration. For examples see at: http://opensuse.swerdna.org/suseapache.html. You can also useScriptAliasdirective.