LinuxQuestions.org
LinuxAnswers - the LQ Linux tutorial section.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices

Reply
 
LinkBack Search this Thread
Old 08-11-2008, 08:52 AM   #1
michux
Member
 
Registered: Nov 2004
Location: Warsaw, Poland
Distribution: Ubuntu
Posts: 76

Rep: Reputation: 15
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...)?
 
Old 08-11-2008, 04:50 PM   #2
michux
Member
 
Registered: Nov 2004
Location: Warsaw, Poland
Distribution: Ubuntu
Posts: 76

Original Poster
Rep: Reputation: 15
Temporarily 'solved' the problem by compiling just mod_python against python2.5-dev. Not the greatest solution but it works.
 
Old 09-09-2008, 11:30 AM   #3
lefty.crupps
Member
 
Registered: Apr 2005
Location: Minneap USA
Distribution: Debian, Mepis, Sidux
Posts: 470

Rep: Reputation: 32
Question

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?
 
Old 09-10-2008, 10:21 AM   #4
lefty.crupps
Member
 
Registered: Apr 2005
Location: Minneap USA
Distribution: Debian, Mepis, Sidux
Posts: 470

Rep: Reputation: 32
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

Last edited by lefty.crupps; 09-10-2008 at 01:04 PM. Reason: saying it was a failed attempt
 
  


Reply

Tags
python


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Apache2 on Debian Etch not working finferflu Linux - Server 28 02-24-2011 05:03 AM
LXer: Embedding Python In Apache2 With mod_python (Debian Etch) LXer Syndicated Linux News 0 06-22-2008 08:20 AM
Apache2 and CGI problem on Debian Etch jwaters504 Linux - Server 2 09-19-2007 08:28 PM
LXer: Using Ruby On Rails With Apache2 On Debian Etch LXer Syndicated Linux News 1 06-29-2007 03:51 AM
apache2 on debian etch: SSL not working t0bias Linux - Server 1 06-01-2007 06:46 AM


All times are GMT -5. The time now is 08:36 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration