http://192.168.1.13:8001/cgi-bin/GetRaspData.py
I am trying to execute python script which is hosted in apache2(/var/www/cgi-bin/) (on Raspberry Pi - Noobs OS) by using Javascript http get method.
but it returns content of the .py script. I want to execute(run) this script. please support.
**************My python script***************************
#!/usr/bin/python
import time
from time import strftime
import datetime
#import json
def main():
print 'Content-type: text-xson\n\n'
today = datetime.datetime.today().date()
#EMUnits = json.JSONEncoder().encode({"Site":"Wymon Demo Kit","Date":str(today)})
print today
main()
**********************************************************************
>>>>>>>>>>>>>>>>Apache config>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
<VirtualHost 192.168.1.13:8001>
ServerAdmin webmaster@localhost
DocumentRoot /var/www
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory /var/www/>
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all
</Directory>
ScriptAlias /cgi-bin/ /var/www/cgi-bin/
<Directory "/var/www/cgi-bin">
AllowOverride None
Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
AddHandler cgi-script .cgi .py .pl
Order allow,deny
Allow from all
</Directory>
ErrorLog ${APACHE_LOG_DIR}/error.log
# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel warn
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
..........................>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>