Zope, M2Crypto, and Gentoo

J

jsmilan

Hi, all;

I'm strictly an amateur developer who has dabbled in a half dozen
languages on eight or nine systems over 20 years or so. I have never
devoted the time or energy to thoroughly learn any one of them, so I have
become a true JOATAMON (Jack Of All Trades And Master Of None). I
apologize in advance for any truly newb sounding questions. I did Google
for this in several places first (Zope.org, Gentoo forums, and Google
UseNet search) and haven't found anything relevant.

I'm working on a Zope project that I hope to make as portable as
possible. Target platforms for sure are Linux and Windows. Other
desirable platforms would be Mac OS/X and *BSD. My development box is a
Gentoo installation. All software running came from Gentoo ebuilds.

One of the things that I'm striving for is the smallest footprint
possible to help reduce the number of platform specific issues. I want
to add HTTPS functionality to this project. I've run into what looks
like either a documentation issue, or possibly a Gentoo ebuild specific
issue. I have posted the same question to the Gentoo forums, but in case
it's a Zope or M2Crypto specific documentation issue I thought I'd repeat
it here.

I'm currently running Zope 2.7.2-r1, and I just grabbed M2Crypto 0.12-r1
(latest offered as a stable Gentoo ebuild) last night. I was reading
through the included ZServerSSL-HOWTO.html. This HOWTO was written for
M2Crypto 0.11 and Zope 2.6.*.

According to the HOWTO I need to, and I quote:

====================

"The ZServerSSL distribution is in $M2/demo/Zope. We shall refer to this
directory as $ZSSL.


Installation


Below, we refer to your Zope top-level directory as $ZOPE.


Copy $ZSSL/z2s.py into $ZOPE.

Depending on your operating system, modify $ZOPE/start or $ZOPE/start.bat
to invoke $ZOPE/z2s.py, instead of $ZOPE/z2.py. The files $ZSSL/starts
and $ZSSL/starts.bat serve as examples."

=====================

However, there IS no z2.py on my system. Instead, my
/etc/init.d/myzopeserver file calls zopectl, which in turn calls a
configuration file that resides underneath /var/lib/zope/myzopeserver.

Has anyone out there gotten this particular combination to work? Is
there an easy way to pull this off? Am I just being incredibly dense and
looking in the wrong place?

TIA
 
J

John Hunter

jsmilan> However, there IS no z2.py on my system. Instead, my
jsmilan> /etc/init.d/myzopeserver file calls zopectl, which in
jsmilan> turn calls a configuration file that resides underneath
jsmilan> /var/lib/zope/myzopeserver.

jsmilan> Has anyone out there gotten this particular combination
jsmilan> to work? Is there an easy way to pull this off? Am I
jsmilan> just being incredibly dense and looking in the wrong
jsmilan> place?

You're not being dense but you are looking in the wrong place. Check
out the demo/Zope27 sub-directory of the mycrypto src distro.

Here are my condensed install notes, which basically summarize the
instructions from the Zope27 directory

Install m2crypto

You'll need SWIG 1.3.21 :
http://aleron.dl.sourceforge.net/sourceforge/swig/swig-1.3.22.tar.gz):
./configure; make; sudo make install

Get the m2 src
http://sandbox.rulemaker.net/ngps/Dist/m2crypto-0.13.zip

I had to edit setup.py and add the following to the include_dirs
for posix systems (on or around line 75

include_dirs = [my_inc, '/usr/include', '/usr/kerberos/include/']
> python setup.py build
> sudo python setup.py install


Installing ZServer
cd /var/tmp/build/m2crypto-0.13/
cd demo/Zope27/
cp install_dir/lib/python/ZServer/HTTPS_Server.py /usr/local/Zope-2.7.2/lib/python/ZServer/
cp install_dir/lib/python/ZServer/medusa/https_server.py /usr/local/Zope-2.7.2/lib/python/ZServer/medusa/
less install_dir/lib/python/ZServer/__init__.py.patch
cd /usr/local/Zope-2.7.2/lib/python/ZServer/
mkdir /var/tmp/back

rm -rf /var/tmp/back
cp -a * /var/tmp/back/
patch -p0 < /var/tmp/build/m2crypto-0.13/demo/Zope27/install_dir/lib/python/ZServer/__init__.py.patch
patch -p0 < /var/tmp/build/m2crypto-0.13/demo/Zope27/install_dir/lib/python/ZServer/component.xml.patch
patch -p0 < /var/tmp/build/m2crypto-0.13/demo/Zope27/install_dir/lib/python/ZServer/datatypes.py.patch

# now patch instance home
cd /var/tmp/build/m2crypto-0.13/demo/Zope27/
mkdir /usr/local/Zope-2.7.2/zope_instance/ssl
cp instance_home/ssl/*.pem /usr/local/Zope-2.7.2/zope_instance/ssl/
cd /usr/local/Zope-2.7.2/zope_instance/
cp README.txt etc/zope.conf /var/tmp/back/
patch -p0 < /var/tmp/build/m2crypto-0.13/demo/Zope27/instance_home/README.txt.patch
cd etc/
patch -p0 < /var/tmp/build/m2crypto-0.13/demo/Zope27/instance_home/etc/zope.conf.patch

# symlink ssl
cd /usr/local/Zope-2.7.2/
ln -s zope_instance/ssl


JDH
 
J

jsmilan

I answered John by email before I saw his response here. (Thanks, John!)
Basically, I'm not opposed to taking that approach as a last resort.
However, doing so would mean giving up the automatic upate process for
Gentoo. Does anyone else have any ideas?



[snip]
 
J

Josef Meile

Hi Jim,

I answered John by email before I saw his response here. (Thanks, John!)
Basically, I'm not opposed to taking that approach as a last resort.
However, doing so would mean giving up the automatic upate process for
Gentoo. Does anyone else have any ideas?
I also like the emerge facility of Gentoo, but I think that things like
a webserver (and problably some dependencies) should be installed from
source. After all, you don't know what modules are included on the
python binary of gentoo. For example, it will be hard to add ldap
support for python/zope, since ldap may require some special flags that
aren't included on the binary installation.

The other problem is that with the binaries the files will be stored on
different locations. I personaly preffer to compile the software I use
on /usr/local/mySoftName. By doing this, you now where your binaries and
config files are.

Finally, I don't know if the python installed by gentoo, is the same one
as the one installed when emerging zope. This could be also an issue,
since you can have to different pythons on your system, but only one
will have m2crypto support.

The other thing is that I don't know if the m2crypto version that you
mentioned (0.13) have the latest ZServerssl for zope 2.7. That's other
reason why your install is failing: you are installing ZServerssl for
zope 2.6.

If you still want to proceed with the binaries, then you have to look
for the locations of your python, zope, and m2Crypto with the qpkg
command of gentoo (this command isn't normally installed with gentoo, I
don't remmember which ebuild you will have to install). ie:

% qpkg -l python | more

first I adviced you to watch the init script of zope and see which
python is used. Then call the python console and try to see if m2crypto
is installed there:

% /your/python/path/python
If you don't see any error, then you are lucky and it means that the
python used by your zope has M2Crypto installed. If you see an error,
then you will have to manually install m2crypto as indicated by John.

Unfortunatelly I think you will have to manually install ZServerssl for
zope 2.7 as indicated by John because m2crypto does not do this.

Regards,
Josef
 
J

jsmilan

Josef;

Thanks for your comments. Maybe I should elaborate a bit more.

This project that I'm doing is a very small one. One objective is to
teach myself object oriented programming in the simplest environment
possible. If I am successful, I hope to have a standalone application
that can be bundled up for Windows, Linux, and hopefully Mac OSX.
However, I'll be happy if I can just get everything to work. :)

The project itself is an admin tool for gameservers. Very simple
requirements; read in a text configuration file, provide a Web interface
to edit it line by line with some integrity checking on variable names,
and write the text file back out. Nothing exciting at all.

That means a very small number of users, only one user accessing a given
file at a time, etc. LDAP is really overkill, as is another Webserver.
Heck, I wouldn't even be looking at m2crypto if it weren't for the fact
I want this tool to manage remote servers.

As it stands now, I haven't tried anything with it. I think my next step
is to contact the guy who maintains m2crypto, describe my situation, and
ask him if he has any thoughts.

Thanks again.

Jim


Josef Meile said:
I also like the emerge facility of Gentoo, but I think that things like
a webserver (and problably some dependencies) should be installed from
source. After all, you don't know what modules are included on the
python binary of gentoo. For example, it will be hard to add ldap
support for python/zope, since ldap may require some special flags that
aren't included on the binary installation.
The other problem is that with the binaries the files will be stored on
different locations. I personaly preffer to compile the software I use
on /usr/local/mySoftName. By doing this, you now where your binaries and
config files are.
Finally, I don't know if the python installed by gentoo, is the same one
as the one installed when emerging zope. This could be also an issue,
since you can have to different pythons on your system, but only one
will have m2crypto support.
The other thing is that I don't know if the m2crypto version that you
mentioned (0.13) have the latest ZServerssl for zope 2.7. That's other
reason why your install is failing: you are installing ZServerssl for
zope 2.6.
If you still want to proceed with the binaries, then you have to look
for the locations of your python, zope, and m2Crypto with the qpkg
command of gentoo (this command isn't normally installed with gentoo, I
don't remmember which ebuild you will have to install). ie:
% qpkg -l python | more
first I adviced you to watch the init script of zope and see which
python is used. Then call the python console and try to see if m2crypto
is installed there:
% /your/python/path/python
If you don't see any error, then you are lucky and it means that the
python used by your zope has M2Crypto installed. If you see an error,
then you will have to manually install m2crypto as indicated by John.
 
J

Josef Meile

Hi Jim,
That means a very small number of users, only one user accessing a given
file at a time, etc. LDAP is really overkill, as is another Webserver.
Heck, I wouldn't even be looking at m2crypto if it weren't for the fact
I want this tool to manage remote servers.
LDAP was only an example. Some python modules require special building
settings, which usually aren't included on the binary distributions.
As it stands now, I haven't tried anything with it. I think my next step
is to contact the guy who maintains m2crypto, describe my situation, and
ask him if he has any thoughts.
Did you try finding the python used by zope and checked if it has
m2crypto installed? I think theoretically the installation should work
also with the binaries as well. You only need to know where your files
are and the rest shouldn't be difficult. Afterall, I think m2Crypto
isn't a complicated module and doesn't have special requirements.

Regards,
Josef
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,228
Members
46,818
Latest member
SapanaCarpetStudio

Latest Threads

Top