Python Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsProgramming LanguagesPython Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old May 11th, 2003, 11:20 PM
manishbh manishbh is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2003
Posts: 5 manishbh User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via Yahoo to manishbh
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

Reply With Quote
  #2  
Old May 12th, 2003, 06:42 PM
netytan's Avatar
netytan netytan is offline
Hello World :)
Dev Shed Frequenter (2500 - 2999 posts)
 
Join Date: Mar 2003
Location: Hull, UK
Posts: 2,537 netytan User rank is Second Lieutenant (5000 - 10000 Reputation Level)netytan User rank is Second Lieutenant (5000 - 10000 Reputation Level)netytan User rank is Second Lieutenant (5000 - 10000 Reputation Level)netytan User rank is Second Lieutenant (5000 - 10000 Reputation Level)netytan User rank is Second Lieutenant (5000 - 10000 Reputation Level)netytan User rank is Second Lieutenant (5000 - 10000 Reputation Level)netytan User rank is Second Lieutenant (5000 - 10000 Reputation Level) 
Time spent in forums: 1 Week 2 Days 18 h 17 m 47 sec
Reputation Power: 68
Send a message via ICQ to netytan Send a message via AIM to netytan Send a message via MSN to netytan Send a message via Yahoo to netytan
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.

Reply With Quote
  #3  
Old May 14th, 2003, 05:29 AM
manishbh manishbh is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2003
Posts: 5 manishbh User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via Yahoo to manishbh
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,

Reply With Quote
  #4  
Old May 14th, 2003, 07:29 AM
netytan's Avatar
netytan netytan is offline
Hello World :)
Dev Shed Frequenter (2500 - 2999 posts)
 
Join Date: Mar 2003
Location: Hull, UK
Posts: 2,537 netytan User rank is Second Lieutenant (5000 - 10000 Reputation Level)netytan User rank is Second Lieutenant (5000 - 10000 Reputation Level)netytan User rank is Second Lieutenant (5000 - 10000 Reputation Level)netytan User rank is Second Lieutenant (5000 - 10000 Reputation Level)netytan User rank is Second Lieutenant (5000 - 10000 Reputation Level)netytan User rank is Second Lieutenant (5000 - 10000 Reputation Level)netytan User rank is Second Lieutenant (5000 - 10000 Reputation Level) 
Time spent in forums: 1 Week 2 Days 18 h 17 m 47 sec
Reputation Power: 68
Send a message via ICQ to netytan Send a message via AIM to netytan Send a message via MSN to netytan Send a message via Yahoo to netytan
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

Reply With Quote
  #5  
Old May 15th, 2003, 12:57 AM
manishbh manishbh is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2003
Posts: 5 manishbh User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via Yahoo to manishbh
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,

Reply With Quote
  #6  
Old May 16th, 2003, 11:52 AM
netytan's Avatar
netytan netytan is offline
Hello World :)
Dev Shed Frequenter (2500 - 2999 posts)
 
Join Date: Mar 2003
Location: Hull, UK
Posts: 2,537 netytan User rank is Second Lieutenant (5000 - 10000 Reputation Level)netytan User rank is Second Lieutenant (5000 - 10000 Reputation Level)netytan User rank is Second Lieutenant (5000 - 10000 Reputation Level)netytan User rank is Second Lieutenant (5000 - 10000 Reputation Level)netytan User rank is Second Lieutenant (5000 - 10000 Reputation Level)netytan User rank is Second Lieutenant (5000 - 10000 Reputation Level)netytan User rank is Second Lieutenant (5000 - 10000 Reputation Level) 
Time spent in forums: 1 Week 2 Days 18 h 17 m 47 sec
Reputation Power: 68
Send a message via ICQ to netytan Send a message via AIM to netytan Send a message via MSN to netytan Send a message via Yahoo to netytan
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

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming LanguagesPython Programming > running jython on apache

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap