Problems running cgi python scripts with no admin rights
Alain TESIO
alain at onesite.org
Wed Aug 23 17:40:57 EDT 2000
Hello,
The source of my problem is that I have no admin
sites on the machine and the sysadmins aren't willing
to do anything.
I installed Python 1.5.2 locally, with the MySQL
module. It's working fine, but I have to define
LD_LIBRARY_PATH=/home/onesite/src/mysql_lib/
to find libmysqlclient.so.6 (there is only
libmysqlclient.a in the standard path and I don't
if it can be useful)
When it's not interactive, for example from
procmail I can pipe a message to such a script :
==========
#!/bin/sh
TMPPYTHON="/home/onesite/masterpy/tmpmail"
cat > $TMPPYTHON
export LD_LIBRARY_PATH="/home/onesite/src/mysql_lib/"
/home/onesite/masterpy/receivemail.py2 $TMPPYTHON
==========
Without an access to the Apache configuration files
to link .py files to a parser, I can take advantage
of "miva" in cgi-bin which parses .mv files.
I had a similar problem to upgrade locally php
to the version 4.
For example, if miva is this script :
===========
#!/bin/sh
export LD_LIBRARY_PATH=/home/onesite/src/mysql_lib/
/www/onesite/cgi-bin/newphp
===========
Any file ending with .mv will be parsed correctly
by php (I've replaced cgi-bin/php by it so PHP 4
parses any .php3 file)
I can't manage to do something similar with python.
If miva is this file :
==========
#!/bin/sh
export LD_LIBRARY_PATH=/home/onesite/src/mysql_lib/
/home/onesite/bin/python
==========
and toto.mv this file :
==========
print "Content-type: text/html"
print "<HTML>"
print "<Body>"
print "Hello Python"
print "</Body>"
print "</HTML>"
==========
it returns a 500 error, and I can't look at the Apache
error log.
I think I've missed something as having this in miva
doesn't work (requesting a .mv file or cgi-bin/miva itself)
==========
#!/bin/sh
echo "Content-type: text/html"
echo "<HTML>"
echo "<Body>"
echo "I am sh"
echo "</Body>"
echo "</HTML>"
==========
PHP scripts are running with my user login, not nobody.
Any idea ? I could probably execute python scripts
from a system call inside php but I hope there is
a better solution !
Thanks for any hint
Alain
More information about the Python-list
mailing list