DaemonForums  

Go Back   DaemonForums > OpenBSD > OpenBSD General

OpenBSD General Other questions regarding OpenBSD which do not fit in any of the categories below.

Reply
 
Thread Tools Display Modes
  #1   (View Single Post)  
Old 18th October 2008
IIMarckus IIMarckus is offline
Port Guard
 
Join Date: Aug 2008
Posts: 13
Thanked 0 Times in 0 Posts
Default Python/Apache

Code:
$ man python
man: no entry for python in the manual.
$ man -k python
python (1) - an interpreted, interactive, object-oriented programming language
$ man python (1)
ksh: syntax error: `(' unexpected
$ man python \(1\)
man: no entry for python in the manual.
man: no entry for (1) in the manual.
$ man "python \(1\)"
man: no entry for python \(1\) in the manual.
$ man "python (1)"
man: no entry for python (1) in the manual.
$ locate python | grep 1
...
/usr/local/man/man1/python2.5.1
...
$ man python2.5.1
man: no entry for python2.5.1 in the manual.
$ man -M /usr/local/man/man1/ python2.5.1
man: no entry for python2.5.1 in the manual.
Am I missing something obvious here?

Last edited by IIMarckus; 18th October 2008 at 04:49 AM.
Reply With Quote
  #2   (View Single Post)  
Old 18th October 2008
ocicat ocicat is offline
Administrator
 
Join Date: Apr 2008
Posts: 2,880
Thanked 190 Times in 160 Posts
Default

$ man python2.5

The reason for attaching the Python version number (as I can tell...) is to make the manpages for differing versions available if they are installed. Recognize that there are significant differences in Python in these later versions, so being able to read their respective manpages may be necessary.

If you would rather the version number not be required in scripts (recall that the first line is typically "#!/usr/local/bin/python2.5"...)), since python2.5 lives in /usr/local/bin, it is not uncommon for the following link to be added to hide the version number:

# ln -sf /usr/local/bin/python2.5 /usr/local/bin/python

In other words, creating the above link simplifies the first line in scripts to be "#!/usr/local/bin/python".

If the version of Python installed is 2.5.1 (found with the following command...):

$ python --version

Note that in the manpage's pathname, /usr/local/man/man1/python2.5.1, the last digit is not meant to be associated to Python's version number. It is meant to represent the manpage section number.

Lastly, man(1) output seen in the following:
Quote:
Originally Posted by IIMarkus
$ man -k python
python (1) - an interpreted, interactive, object-oriented programming language
...means that the full command would be:

$ man 1 python2.5

For the details, study information about "sections" found in the man(1) manpage.

Last edited by ocicat; 18th October 2008 at 04:47 AM.
Reply With Quote
  #3   (View Single Post)  
Old 18th October 2008
IIMarckus IIMarckus is offline
Port Guard
 
Join Date: Aug 2008
Posts: 13
Thanked 0 Times in 0 Posts
Default

Thanks a lot for the detailed response!


Now I’m having problems while attempting to integrate Python with Apache. I downloaded mod_python-2.7.11 and ran DSO # ./configure --with-apxs=/usr/sbin/apxs (after creating a hardlink from python to python2.5), then make and make install, all with no problem.

After that I added "LoadModule python_module /usr/lib/apache/modules/mod_python.so" to httpd.conf and restarted Apache, or tried to.

Code:
# apachectl configtest
/usr/sbin/httpd:/usr/lib/apache/modules/mod_python.so: undefined symbol 'pthread_cond_signal'
/usr/sbin/httpd:/usr/lib/apache/modules/mod_python.so: undefined symbol 'pthread_attr_destroy'
/usr/sbin/httpd:/usr/lib/apache/modules/mod_python.so: undefined symbol 'pthread_create'
/usr/sbin/httpd:/usr/lib/apache/modules/mod_python.so: undefined symbol 'pthread_attr_init'
/usr/sbin/httpd:/usr/lib/apache/modules/mod_python.so: undefined symbol 'pthread_detach'
/usr/sbin/httpd:/usr/lib/apache/modules/mod_python.so: undefined symbol 'pthread_attr_setstacksize'
/usr/sbin/httpd:/usr/lib/apache/modules/mod_python.so: undefined symbol 'pthread_cond_init'
/usr/sbin/httpd:/usr/lib/apache/modules/mod_python.so: undefined symbol 'pthread_mutex_unlock'
/usr/sbin/httpd:/usr/lib/apache/modules/mod_python.so: undefined symbol 'pthread_self'
/usr/sbin/httpd:/usr/lib/apache/modules/mod_python.so: undefined symbol 'pthread_mutex_destroy'
/usr/sbin/httpd:/usr/lib/apache/modules/mod_python.so: undefined symbol 'pthread_mutex_lock'
/usr/sbin/httpd:/usr/lib/apache/modules/mod_python.so: undefined symbol 'pthread_cond_wait'
/usr/sbin/httpd:/usr/lib/apache/modules/mod_python.so: undefined symbol 'pthread_cond_destroy'
/usr/sbin/httpd:/usr/lib/apache/modules/mod_python.so: undefined symbol 'pthread_mutex_init'
Syntax error on line 215 of /var/www/conf/httpd.conf:
Cannot load /usr/lib/apache/modules/mod_python.so into server: Cannot load specified object
Looking again at the documentation reveals that this version of mod_python is meant for Python 2.1 and earlier. However, this is the newest version compatible with Apache 1.x on their web site.

What alternatives are there for using Python with Apache?

Last edited by IIMarckus; 18th October 2008 at 04:48 AM.
Reply With Quote
  #4   (View Single Post)  
Old 18th October 2008
ocicat ocicat is offline
Administrator
 
Join Date: Apr 2008
Posts: 2,880
Thanked 190 Times in 160 Posts
Default

Quote:
Originally Posted by IIMarckus View Post
What alternatives are there for using Python with Apache?
Here, you are on your own since the OpenBSD project does not have a version of mod_python in the packages/ports system at this time.

Having said this, I'm guessing that you downloaded source found on apache.org. Note that they are most likely going to be targeting Linux's filesystem layout which is different than that of OpenBSD (see hier(7) for more information...). Given that the errors cited indicate that the pthreads library is not being found, you will need to look into the Makefiles, etc. to see that the correct path & filename are being used. In OpenBSD, this library is /usr/lib/libpthread.so.10.0, or some similar version number. I suspect that the path found in source downloaded directly from Apache's Website will be different.

In general, the problem you describe is common when attempting to configure Linux-oriented applications on OpenBSD. Maybe resolving this pthreads library issue will be all you need to do, or maybe it is only the beginning of a myriad of thorns. Each & every application has its own level of difficulty in porting.

Frequently, the problems range from:
  • filesystem differences (as discussed above...)
  • library differences -- Linux uses different libraries which will need to be ported, or a shim created if identical functionality already exists in a different library or with a different function name.
Additional information may be found in studying Section 9.4 of the FAQ:

http://openbsd.org/faq/faq9.html#Interact

In particular, it would be good to study the compat_linux(8) manpage.

Because the knowledge needed to port applications is rather specific & detailed, we at this site generally take the same position as the project proper -- you are working in uncharted waters, so you are on your own if you choose to continue porting mod_python.

As for alternatives, mod_perl is already available in the packages/ports system:

http://openports.se/www/mod_perl

Last edited by ocicat; 18th October 2008 at 06:01 AM.
Reply With Quote
Reply

Thread Tools
Display Modes

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 On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
LCD Backlight Trouble zer0x OpenBSD General 3 24th July 2009 08:22 AM
Reading paging files. Mr-Biscuit Off-Topic 5 8th June 2009 07:22 PM
Intesting reading on recent X11 changes vermaden General software and network 4 14th May 2009 03:39 AM
Manpage colorization on the terminal JMJ_coder NetBSD General 2 17th February 2009 09:17 PM
dd+user=trouble graudeejs FreeBSD Security 4 26th September 2008 03:48 PM


All times are GMT. The time now is 05:34 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content copyright © 2007-2010, the authors
Daemon image copyright ©1988, Marshall Kirk McKusick