Я пытаюсь установить Python 3.2 и mod_wsgi на свой веб-сервер, но мне не очень везет.
Я загрузил исходные файлы Python и скомпилировал с помощью этой команды:
./configure --enable-shared --prefix=/opt/python-3-2 LDFLAGS="-Wl,-rpath /opt/python-3-2/lib"
Я также изменил свою переменную пути, чтобы включить /opt/python-3-2/bin
и создал символическую ссылку на python3
двоичный из /opt/python-3-2/bin/python
. Теперь, если я убегу python
из командной строки я получаю соответствующее приглашение.
> python
Python 3.2.2 (default, Jan 20 2012, 18:14:20)
[GCC 4.1.2 20080704 (Red Hat 4.1.2-51)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>>
Я использую следующие настройки для компиляции последней версии mod_wsgi
./configure --with-apxs=/usr/sbin/apxs --with-python=/opt/python-3-2/bin/python3
Это вызывает следующие ошибки
mod_wsgi.c:8937: warning: suggest parentheses around assignment used as truth value
mod_wsgi.c:8939: warning: suggest parentheses around assignment used as truth value
mod_wsgi.c:8941: warning: suggest parentheses around assignment used as truth value
mod_wsgi.c:8945: warning: suggest parentheses around assignment used as truth value
mod_wsgi.c:8965: warning: suggest parentheses around assignment used as truth value
mod_wsgi.c:8967: warning: suggest parentheses around assignment used as truth value
mod_wsgi.c:8970: warning: suggest parentheses around assignment used as truth value
mod_wsgi.c: In function 'wsgi_daemon_worker':
mod_wsgi.c:10279: warning: unused variable 'duration'
mod_wsgi.c:10278: warning: unused variable 'start'
mod_wsgi.c: In function 'wsgi_hook_daemon_handler':
mod_wsgi.c:12499: warning: unused variable 'i'
mod_wsgi.c:12497: warning: unused variable 'elts'
mod_wsgi.c:12496: warning: unused variable 'head'
mod_wsgi.c: In function 'Auth_environ':
mod_wsgi.c:13375: warning: assignment makes pointer from integer without a cast
mod_wsgi.c: At top level:
mod_wsgi.c:7154: warning: 'wsgi_set_py3k_warning_flag' defined but not used
mod_wsgi.c:7856: warning: 'wsgi_set_user_authoritative' defined but not used
mod_wsgi.c:14414: warning: 'wsgi_hook_check_user_id' defined but not used
/usr/lib/apr-1/build/libtool --silent --mode=link gcc -o mod_wsgi.la -rpath /usr/lib/httpd/modules -module -avoid-version mod_wsgi.lo -L/opt/python-3-2/lib -L/opt/python-3-2/lib/python3.2/config -lpython3.2 -lpthread -ldl -lutil -lm
/usr/bin/ld: cannot find -lpython3.2
collect2: ld returned 1 exit status
apxs:Error: Command failed with rc=65536
Я попытался создать символическую ссылку из /opt/python-3-2/lib/python3.2/config -> /opt/python-3-2/lib/libpython3.so
но это не помогло.
В настоящее время вы должны использовать исходный код mod_wsgi из репозитория исходного кода для Python 3.2, вы не можете использовать исходный код mod_wsgi 3.3.