I am a newbie so I saw some tutorials. I have a python script as first.py
#!/usr/bin/python3
print "Content-type: text/html\n"
print "Hello, world!"
I have multiple versions of python on my computer. I couldn't figure out my cgi enabled directory so I pasted this code at three places
/usr/lib/cgi-bin/first.py
/usr/lib/cups/cgi-bin/first.py
/var/www/html/first.py
Now when I run this code in terminal it works fine but when I type
curl http://localhost/first.py
it spit out just simple text and does not execute.
I have given all the permissions to first.py
I have enabled and started the server by commands
a2enmod cgi
systemctl restart apache2
Please tell how do I execute and what is going on here? Thanks in advance.