The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.
|
 |
|
Dev Shed Forums
> Programming Languages
> Python Programming
|
running jython on apache
Discuss running jython on apache in the Python Programming forum on Dev Shed. running jython on apache Python Programming forum discussing coding techniques, tips and tricks, and Zope related information. Python was designed from the ground up to be a completely object-oriented programming language.
|
|
 |
|
|
|
|

Dev Shed Forums Sponsor:
|
|
|

May 11th, 2003, 11:20 PM
|
|
Junior Member
|
|
Join Date: May 2003
Posts: 5
Time spent in forums: < 1 sec
Reputation Power: 0
|
|
|
running jython on apache
hi mark,
u r probably working on Linux. My problem is, I am on windows, so when I need to specify the path to python interpreter, its, #!/python23/python. Similarly the path to jython interpreter is #!/jython-2.1/jython.
The file with path to python interpreter works fine, however the second file doesn't.
Any idea abt what the problem can be. The line to be interpreted is rather simple, its:- print "<p>This is a test</p>"
Regards,
Manish
|

May 12th, 2003, 06:42 PM
|
 |
Hello World :)
|
|
Join Date: Mar 2003
Location: Hull, UK
|
|
|
Windows
On the contrary, im running a windows box (but yes I also have a Linux server) and #!/usr/bin/env jython works fine, as does #!/usr/bin/env python and perl. Have you tested the Jython interpriter? i.e. run the interpriter through MSdos. If that works then have a look at the Apache error log, maybe that could give you some useful info?
I'm not sure about this but if you go into the Jython directory there should be a registry file, if you double click that then Jython should be found by #!usr/bin/env, if it isn't been found already
Hope this is some help,
Mark.
|

May 14th, 2003, 05:29 AM
|
|
Junior Member
|
|
Join Date: May 2003
Posts: 5
Time spent in forums: < 1 sec
Reputation Power: 0
|
|
Hi mark,
I have tried running Jython scripts with the method u suggested, i.e.; replacing path with /usr/bin/env Jython as header. The scripts run fine, when I do so from the prompt. However, when I run them from the explorer, Netscape, an error creeps in, which is:
/usr/bin/env: jython: Permission denied
[Fri Jun 13 15:51:58 2003] [error] [client 127.0.0.1] Premature end of script headers: /usr/local/apache/cgi-bin/mv.py
When I change path with the complete path to the jython interpreter, a new error crops up , which is:
[Fri Jun 13 16:00:57 2003] [error] (13)Permission denied: exec of /usr/local/apache/cgi-bin/mv.py failed
[Fri Jun 13 16:00:57 2003] [error] [client 127.0.0.1] Premature end of script headers: /usr/local/apache/cgi-bin/mv.py
Can u suggest a way out.
P.S. I am now running the scripts on a Red hat Linux now.
Regards,
|

May 14th, 2003, 07:29 AM
|
 |
Hello World :)
|
|
Join Date: Mar 2003
Location: Hull, UK
|
|
|
HTTP Headers
Hi Manish,
The error which says "Premature end of script headers" seems to be taking about http headers(?), if it is then all you should need to do is add a new line after the content-type header.
i.e. print 'Content-Type: text/html\n'
That should fix that error and hopefully the first too..
Could you post a copy of what your trying to run so I could take a look?
Mark
|

May 15th, 2003, 12:57 AM
|
|
Junior Member
|
|
Join Date: May 2003
Posts: 5
Time spent in forums: < 1 sec
Reputation Power: 0
|
|
|
Hi,
these are the scripts that I was trying to run.
The first scripts generates the first error that I had specified in my previous mail.
#!/usr/bin/env jython
print "Content-Type: text/plain\n\n"
print ""
print "Manish\n"
the following scripts generates the second error:
#!/root/jython-2.1/jython
print "Content-Type: text/plain\n\n"
print ""
print "Manish\n"
Regards,
|

May 16th, 2003, 11:52 AM
|
 |
Hello World :)
|
|
Join Date: Mar 2003
Location: Hull, UK
|
|
|
Permission denied
I've been thinking about your problem, but the only thing I can imagin the error is being caused by has something to do with Permissions, try chmoding the file to 755, which is what a CGI file has to be inable to run on my webhost.
Also i'd try changing your Apache config file so that CGI can be run outside the CGI-BIN directory. you can do this by comenting out this line ScriptAlias /cgi-bin/ "path to cgi-bin"
I've only done a little work with Linux so I dont know what else to suggest being a Linux newbe, maybe ask this question in the Apache section of this forum?
Mark
|
Developer Shed Advertisers and Affiliates
| Thread Tools |
Search this Thread |
|
|
|
| Display Modes |
Rate This Thread |
Linear Mode
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
|