forum.vmspython.org Forum Index forum.vmspython.org
Forum system
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Using PYTHON with APACHE

 
Post new topic   Reply to topic    forum.vmspython.org Forum Index -> Python for OpenVMS
View previous topic :: View next topic  
Author Message
rft



Joined: 20 Jun 2007
Posts: 43
Location: Massachusetts

PostPosted: Tue Jun 10, 2014 10:34 pm    Post subject: Using PYTHON with APACHE Reply with quote

We have setup PYTHON using the LD images. It appears to be working properly, but there is little guidance to it to work with APACHE on VMS.

We have added the following to our HTTPD.CONF file:

addHandler cgi-script .com .exe .py

and written the small hello.py as shown below:

Code:

$ mcr python_root:[vms.bin]python
print "Content-type: text/html"
print
print "<html><head>"
print ""
print "</head><body>"
print "Hello."
print "</body></html>"


This works and produces the expected output. Looking at the supplied applications, the format is significantly different:

Code:

#! /DSA0/SYS0/SYSCOMMON/python254/vms/bin/python.exe
#Fix and uncomment those 2 lines if your moin command doesn't find the MoinMoin>
#import sys
#sys.path.insert(0, '/usr/lib/python/site-packages')
from MoinMoin.script.moin import run
run()


Or the following CGI example:

Code:

#!/usr/bin/env python

"""CGI test 1 - check server setup."""

# Until you get this to work, your web server isn't set up right or
# your Python isn't set up right.

# If cgi0.sh works but cgi1.py doesn't, check the #! line and the file
# permissions.  The docs for the cgi.py module have debugging tips.

print "Content-type: text/html"
print
print "<h1>Hello world</h1>"
print "<p>This is cgi1.py"


Both of the above code samples fail. Any suggestions?
Back to top
View user's profile Send private message
jfp



Joined: 12 Jul 2004
Posts: 618

PostPosted: Wed Jun 11, 2014 8:48 pm    Post subject: Reply with quote

I don't use Apache on OpenVMS.
What is the error?

JF
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    forum.vmspython.org Forum Index -> Python for OpenVMS All times are GMT + 2 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group