Python - How to integrate?

SupermanInNY

Verified User
Joined
Sep 28, 2004
Messages
419
Hi All,

I need to have python running on my server.

I have CentOS4.4 (final) i386 version.
I'm running apache 1.3.37, PHP 4.4.4.

I tried to follow on the instructios found in teh how-to for debian, on how to compile and install Python, but it didn't work for me :(.

I need much more complete instructions on how to do this. If someone is willing to pick up this subject, this would be great.

I need step-by-step such

wget http://..... exact location
chmod 755.....
then ./configure.... blah blah && make&& make install

Then I understand there is another mod_python (or something like that) that also needs the

wget http://..... chmod.. etc.

Can someone please assist me with this?

Thanks,

-Alon.
 
It should work:
Code:
cd /usr/local/src
wget http://www.apache.lt/httpd/modpython/mod_python-3.3.1.tgz
tar xzf mod_python-3.3.1.tgz
cd mod_python-3.3.1
./configure
make
make install

Make sure you have:
Code:
LoadModule python_module /usr/lib/apache/mod_python.so

In /etc/httpd/conf/httpd.conf file.
 
Last edited:
Code:
checking Apache version... 1.3.37
configure: error: This version of mod_python only works with Apache 2. The one you have seems to be 1.3.37.
 
For apache 1.3.37
Code:
yum install python python-devel
mkdir /usr/local/src (if needed)
cd /usr/local/src
wget [url]http://www.apache.lt/httpd/modpython/mod_python-2.7.11.tgz[/url]
tar xzf mod_python-2.7.11.tgz
cd mod_python-2.7.11
./configure --with-apxs=/usr/sbin/apxs
make dso
make install
 
Cannot manually install mod_python

I also try to install mod_python on a directadmin environment. Would like to do this with Yum, but that is not possible because Yum doesn't recognize the directadmins httpd.

So I followed the instructions above but then I get the following error:

[root@vms mod_python-3.3.1]# make
make[1]: Entering directory `/temp/mod_python-3.3.1/src'

Compiling for DSO.

/usr/sbin/apxs -I/temp/mod_python-3.3.1/src/include -I/usr/include/apache -I/usr/include/python2.4 -c mod_python.c _apachemodule.c requestobject.c tableobject.c util.c serverobject.c connobject.c filterobject.c hlist.c hlistobject.c finfoobject.c -L/usr/lib64/python2.4/config -Xlinker -export-dynamic -L/usr/kerberos/lib64 -lm -lpython2.4 -lpthread -ldl -lutil -lm
/var/www/build/libtool --silent --mode=compile gcc -prefer-pic -DLINUX=2 -D_REENTRANT -D_GNU_SOURCE -g -O2 -pthread -I/usr/local/include -I/usr/include/apache -I/usr/include/apache -I/usr/include/apache -I/temp/mod_python-3.3.1/src/include -I/usr/include/apache -I/usr/include/python2.4 -c -o mod_python.lo mod_python.c && touch mod_python.slo
mod_python.c: In function âpython_initâ:
mod_python.c:826: warning: initialization from incompatible pointer type
/var/www/build/libtool --silent --mode=compile gcc -prefer-pic -DLINUX=2 -D_REENTRANT -D_GNU_SOURCE -g -O2 -pthread -I/usr/local/include -I/usr/include/apache -I/usr/include/apache -I/usr/include/apache -I/temp/mod_python-3.3.1/src/include -I/usr/include/apache -I/usr/include/python2.4 -c -o _apachemodule.lo _apachemodule.c && touch _apachemodule.slo
/var/www/build/libtool --silent --mode=compile gcc -prefer-pic -DLINUX=2 -D_REENTRANT -D_GNU_SOURCE -g -O2 -pthread -I/usr/local/include -I/usr/include/apache -I/usr/include/apache -I/usr/include/apache -I/temp/mod_python-3.3.1/src/include -I/usr/include/apache -I/usr/include/python2.4 -c -o requestobject.lo requestobject.c && touch requestobject.slo
/var/www/build/libtool --silent --mode=compile gcc -prefer-pic -DLINUX=2 -D_REENTRANT -D_GNU_SOURCE -g -O2 -pthread -I/usr/local/include -I/usr/include/apache -I/usr/include/apache -I/usr/include/apache -I/temp/mod_python-3.3.1/src/include -I/usr/include/apache -I/usr/include/python2.4 -c -o tableobject.lo tableobject.c && touch tableobject.slo
tableobject.c:1092: warning: initialization from incompatible pointer type
/var/www/build/libtool --silent --mode=compile gcc -prefer-pic -DLINUX=2 -D_REENTRANT -D_GNU_SOURCE -g -O2 -pthread -I/usr/local/include -I/usr/include/apache -I/usr/include/apache -I/usr/include/apache -I/temp/mod_python-3.3.1/src/include -I/usr/include/apache -I/usr/include/python2.4 -c -o util.lo util.c && touch util.slo
/var/www/build/libtool --silent --mode=compile gcc -prefer-pic -DLINUX=2 -D_REENTRANT -D_GNU_SOURCE -g -O2 -pthread -I/usr/local/include -I/usr/include/apache -I/usr/include/apache -I/usr/include/apache -I/temp/mod_python-3.3.1/src/include -I/usr/include/apache -I/usr/include/python2.4 -c -o serverobject.lo serverobject.c && touch serverobject.slo
serverobject.c:387: warning: initialization from incompatible pointer type
/var/www/build/libtool --silent --mode=compile gcc -prefer-pic -DLINUX=2 -D_REENTRANT -D_GNU_SOURCE -g -O2 -pthread -I/usr/local/include -I/usr/include/apache -I/usr/include/apache -I/usr/include/apache -I/temp/mod_python-3.3.1/src/include -I/usr/include/apache -I/usr/include/python2.4 -c -o connobject.lo connobject.c && touch connobject.slo
connobject.c: In function â_conn_readâ:
connobject.c:142: error: request for member ânextâ in something not a structure or union
apxs:Error: Command failed with rc=65536
.
make[1]: *** [mod_python.so] Error 1
make[1]: Leaving directory `/temp/mod_python-3.3.1/src'
make: *** [do_dso] Error 2


I hope that you can help me!!

Best,
Nicolaas
 
How do i apply that patch?

i tried to copy its contents to a file and run it.


diff: unrecognized option `---'
diff: Try `diff --help' for more information.
./test.pl: line 2: mod_python-3.3.1/src/connobject.c: No such file or directory
./test.pl: line 3: mod_python-3.3.1-atomix/src/connobject.c: No such file or directory
./test.pl: line 4: bytes_read: command not found
./test.pl: line 6: syntax error near unexpected token `('
./test.pl: line 6: ` while ((bytes_read < len || len == 0) && - !(b == APR_BRIGADE_SENTINEL(b) || + !(b == '
[
 
i did it manualy, altered the code in the file.

But there is really a patch command?

like

patch file patchfile.pl
 
Back
Top