LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   Setting up Python 2.5 on Apache2 in Debian Etch (https://www.linuxquestions.org/questions/linux-server-73/setting-up-python-2-5-on-apache2-in-debian-etch-661995/)

michux 08-11-2008 08:52 AM

Setting up Python 2.5 on Apache2 in Debian Etch
 
I'm trying to deploy SVN django on Debian Etch with my little project. It requires Python 2.5, so I tried installing it together with the Apache2 module (libapache2-mod-python). Unfortunately the version in Debian Etch is linked with Python 2.4, so after installing and configuring all works except for Python 2.5-specific stuff. Obviously this is not what I want.

I tried installing libapache2-mod-python from testing:

Code:

# apt-get -t testing install libapache2-mod-python
Reading package lists... Done
Building dependency tree... Done
The following extra packages will be installed:
  python python-central python2.4
Suggested packages:
  libapache2-mod-python-doc python-tk python-profiler python2.4-doc
The following NEW packages will be installed:
  libapache2-mod-python python python-central python2.4
0 upgraded, 4 newly installed, 0 to remove and 0 not upgraded.
Need to get 0B/3121kB of archives.
After unpacking 11.3MB of additional disk space will be used.
Do you want to continue [Y/n]?

Obviously not what I wanted.

Do you have any ideas how to solve this, except for compiling all from source (nightmare to maintain...)?

michux 08-11-2008 04:50 PM

Temporarily 'solved' the problem by compiling just mod_python against python2.5-dev. Not the greatest solution but it works.

lefty.crupps 09-09-2008 11:30 AM

I have tried the recompile on Etch but it is failing, any suggestions out there?


Code:

cd /opt/
mkdir mod_python2.5
cd mod_python2.5/
apt-get source libapache2-mod-python
cd libapache2-mod-python-3.2.10/
./configure --with-python /usr/bin/python2.5
...
...
...
checking for Apache libexec directory... /usr/lib/apache2/modules
checking for Apache include directory... -I/usr/include/apache2
checking for --with-python... yes
checking Python version... yes: invalid option -- c
Try `yes --help' for more information.
yes: invalid option -- c
Try `yes --help' for more information.

configure: error: This version of mod_python only works with Python major version 2. The one you have seems to be .

What is going on that Python cannot tell us/gcc its version?

lefty.crupps 09-10-2008 10:21 AM

mod_python compiled against Python2.5
 
EDIT: Although this all seemed to go down fine and installed OK, the errors still happened on the website that it was looking for Python2.4... with help from 'wols' in the #debian IRC channel on Freenode I was able to get the sources and recompile the package officially, which still gave these errors. Currently I am just dist-upgrading this minimal server to Lenny and hoping it will work there once all is done... I left this howto (below) for reference anyways.

Original Post:
In my last post I had an error in my ./configure line; this post is to correct that and say how I finished this, for any future readers.

The configure line should have looked not like this:
Code:

./configure --with-python /usr/bin/python2.5
but like this (with an = sign):
Code:

./configure --with-python=/usr/bin/python2.5
and I also made sure to compile against Apache2 more fully, like this:
Code:

./configure --with-apxs=/usr/bin/apxs2 --with-python=/usr/bin/python2.5
Then I wanted to install it with checkinstall to make a pseudo-debian package, but checkinstall isn't available in Etch, so I had to get its sources from Lenny:
Code:

vim /etc/apt/sources.list
add these lines:
Code:

deb http://ftp.debian.org/debian/ lenny main contrib
deb-src http://ftp.debian.org/debian/ lenny main contrib

update the system and get the sources packages into /opt/checkinstall:
Code:

mkdir /opt/checkinstall
cd /opt/checkinstall
apt-get update
apt-get source checkinstall
cd checkinstall-1.6.1/
less INSTALL

According to the INSTALL file I need to run 'make, make install, checkinstall' but that failed until I installed Ruby 1.8 for Etch...

I first removed the two new lines for Lenny sources in /etc/apt/sources.list that I had put there for the checkinstall sources:
Code:

vim /etc/apt/sources.list
Comment out these lines by adding a # in front:
Code:

# deb http://ftp.debian.org/debian/ lenny main contrib
# deb-src http://ftp.debian.org/debian/ lenny main contrib

Then, I build and installed checkinstall:
Code:

apt-get update
apt-get install libgettext-ruby1.8 libgettext-ruby-util
make
make install
checkinstall

then, I built and installed the .deb for mod_python:
Code:

cd /opt/mod_python2.5/libapache2-mod-python-3.2.10/
./configure --with-apxs=/usr/bin/apxs2 --with-python=/usr/bin/python2.5
make
checkinstall

Finally, I restarted Apache2:
Code:

apache2ctl -t
apache2ctl -k graceful
ps auwx |grep apache



All times are GMT -5. The time now is 01:26 PM.