LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 01-15-2008, 11:28 AM   #1
chaney44145
LQ Newbie
 
Registered: Dec 2007
Location: Cleveland, OH
Distribution: Fedora X
Posts: 2

Rep: Reputation: 0
Python CGI-Bin Scripts


I have Fedora 6 running Apache/PHP/MySQL and Python 2.5.
I can make a web page that submits data to a Python app and it works, see below.
Web form.
<form name="form1" id="form1" method="post" action="/cgi-bin/software_proc_codes.py">

Python code.
#!/usr/bin/python
import cgi
print "Content-Type: text/plain"
print "Hello, world"

The problem I am having is how to call a compiled Python code.

I have tried changing the web form to call
/cgi-bin/software_proc_codes.pyc and failed.

I have removed the "#!/usr/bin/python" from the script, compiled and tried the following.
#!/usr/bin/python
import /var/www/cgi-bin/hello.pyc

Do I need to set something up in Apache to handle .pyc?

Last edited by chaney44145; 01-15-2008 at 11:30 AM.
 
Old 01-15-2008, 11:44 AM   #2
indienick
Senior Member
 
Registered: Dec 2005
Location: London, ON, Canada
Distribution: Arch, Ubuntu, Slackware, OpenBSD, FreeBSD
Posts: 1,853

Rep: Reputation: 65
Check out the mod_cgi module in httpd.conf.
I haven't used Apache in a while, and I can't recall how you configure module behaviours. I use Lighttpd at home, and I everything is just handled in the lighttpd.conf file.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
webprogramming python script in Debian Etch can't find cgi-bin firedancer Linux - Newbie 1 11-18-2007 07:17 AM
How to run perl scripts outside cgi-bin? xpucto Linux - Server 3 04-20-2007 02:23 AM
Where do I put my cgi-bin scripts? BrianK Linux - Software 2 10-12-2005 10:59 PM
Running perl scripts outside of cgi-bin ylikone Programming 1 09-08-2005 04:34 AM
.CGI scripts enabled with #!/usr/bin/perl -i?? computerdaves Fedora 8 02-18-2005 04:03 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 01:49 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration