GrahamDumpleton / mod_wsgi-httpd

Installer for Apache httpd web server.
Apache License 2.0
6 stars 1 forks source link

Failing to install on FreeBsd 12 with python 3.7 #4

Open Teva opened 4 years ago

Teva commented 4 years ago

Hello,

I have been following the instruction given here.

An error occurred when I ran pip install "mod_wsgi-standalone". I will try today with an earlier version of the os (FreeBsd 11).

` tmp/pip-install-pricwws/mod-wsgi-httpd/build/httpd-2.4.41/modules/md -I/tmp/pip-install-pricwws/mod-wsgi- httpd/build/httpd-2.4.41/modules/arch/unix -I/tmp/pip-install-pricwws/mod-wsgi-httpd/build/httpd-2.4.41/modules/dav/main -I/tmp/pip-install-pricwws/mod-wsgi-httpd/build/httpd-2.4.41/modules/generators -I/tmp/pip-install-pricwws_/mod-wsgi- httpd/build/httpd-2.4.41/modules/mappers -prefer-non-pic -static -c passwd_common.c && touch passwdcommon.lo /tmp/pip-install-pricwws/mod-wsgi-httpd/build/httpd/build-1/libtool --silent --mode=link cc -g -O2 -L/usr/local/lib - o htpasswd htpasswd.lo passwdcommon.lo /tmp/pip-install-pricwws/mod-wsgi-httpd/build/httpd/lib/libaprutil-1.la - lexpat /tmp/pip-install-pricwws/mod-wsgi-httpd/build/httpd/lib/libapr-1.la -lcrypt -lpthread -lcrypt ld: error: /tmp/pip-install-pricwws/mod-wsgi-httpd/build/httpd/lib/libaprutil-1.so: undefined reference to libiconv ld: error: /tmp/pip-install-pricwws_/mod-wsgi-httpd/build/httpd/lib/libaprutil-1.so: undefined reference to libiconvclose ld: error: /tmp/pip-install-pricwws/mod-wsgi-httpd/build/httpd/lib/libaprutil-1.so: undefined reference to libiconv_open cc: error: linker command failed with exit code 1 (use -v to see invocation) *** Error code 1

  Stop.
  make[2]: stopped in /tmp/pip-install-pricwws_/mod-wsgi-httpd/build/httpd-2.4.41/support
  *** Error code 1

  Stop.
  make[1]: stopped in /tmp/pip-install-pricwws_/mod-wsgi-httpd/build/httpd-2.4.41/support
  *** Error code 1

  Stop.
  make: stopped in /tmp/pip-install-pricwws_/mod-wsgi-httpd/build/httpd-2.4.41
  Downloading https://archive.apache.org/dist/httpd/httpd-2.4.41.tar.gz
  Traceback (most recent call last):
    File "<string>", line 1, in <module>
    File "/tmp/pip-install-pricwws_/mod-wsgi-httpd/setup.py", line 110, in <module>
      raise RuntimeError('Failed to build HTTPD.')
  **RuntimeError: Failed to build HTTPD**.
  ----------------------------------------

ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.

ERROR: Command errored out with exit status 1: /usr/local/bin/python3 /usr/local/lib/python3.7/site-packages/pip install --    ignore-installed --no-user --prefix /tmp/pip-build-env-6m1r94oj/overlay --no-warn-script-location --no-binary :none: --only-    binary :none: -i https://pypi.org/simple -- 'setuptools>=40.8.0' wheel mod_wsgi-httpd==2.4.41.1 Check the logs for full     command output. `
Teva commented 4 years ago

I do have the same issue with FreeBsd 11 (64 bit) :

  *** Error code 1

  Stop.
  make[2]: stopped in /tmp/pip-install-udyv4abu/mod-wsgi-httpd/build/httpd-2.4.41/support
  *** Error code 1

  Stop.
  make[1]: stopped in /tmp/pip-install-udyv4abu/mod-wsgi-httpd/build/httpd-2.4.41/support
  *** Error code 1

  Stop.
  make: stopped in /tmp/pip-install-udyv4abu/mod-wsgi-httpd/build/httpd-2.4.41
  Downloading https://archive.apache.org/dist/httpd/httpd-2.4.41.tar.gz
  Traceback (most recent call last):
    File "<string>", line 1, in <module>
    File "/tmp/pip-install-udyv4abu/mod-wsgi-httpd/setup.py", line 110, in <module>
      raise RuntimeError('Failed to build HTTPD.')
  RuntimeError: Failed to build HTTPD.
  ----------------------------------------

ERROR: Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-install-udyv4abu/mod-wsgi-httpd/

GrahamDumpleton commented 4 years ago

I presume (hope) you mean Fedora 32, and not Fedora 12.

Do you have libiconv package installed?

For FreeBSD, would need to see actual underlying errors when you use -v option to pip install.

Teva commented 4 years ago

Hello,

I meant FreeBsd 12 sorry for the confusion, the post is updated.

libiconv is already installed, I am under the impression that the installation process doesn't know where is stored libiconv under FreeBsd.

Here is the Gist with the underlying errors : https://gist.githubusercontent.com/Teva/8b2b245dbc31aa9d44d27981b3db385f/raw/621c5182815e500a6e2d09d352fa00d0a44155b8/log

GrahamDumpleton commented 4 years ago

What do you get when you run:

ldconfig -r | grep iconv
Teva commented 4 years ago

Here is the result on FreeBsd 12 :

:~ # ldconfig -r | grep iconv 47:-lkiconv.4 => /lib/libkiconv.so.4 167:-liconv.2 => /usr/local/lib/libiconv.so.2

GrahamDumpleton commented 4 years ago

You might try to install it using:

LDFLAGS="-L/usr/local/lib" LDLIBS="-liconv" pip install mod_wsgi-standalone

The configure script for Apache is supposed to honour those environment variables for supplying extra linker flags.

Teva commented 4 years ago

I am getting the following output

:~ # LDFLAGS="-L/usr/local/lib" LDLIBS="-liconv" pip install mod_wsgi-standalone LDFLAGS=-L/usr/local/lib: Command not found.

And when placing it at the end I have :

pip install mod_wsgi-standalone LDFLAGS="-L/usr/local/lib" LDLIBS="-liconv" ERROR: Invalid requirement: 'LDFLAGS=-L/usr/local/lib' Hint: It looks like a path. File 'LDFLAGS=-L/usr/local/lib' does not exist.

GrahamDumpleton commented 4 years ago

Then you aren't using a Bourne style shell (sh, bash etc).

Use possibly instead:

setenv LDFLAGS "-L/usr/local/lib"
setenv LDLIBS "-liconv"
pip install mod_wsgi-standalone

In other words, set and export those two environment variables and then run the command.

Teva commented 4 years ago

The setenv worked.

However I am still running on the same issue.

tmp/pip-install-mfmh0zrh/mod-wsgi-httpd/build/httpd/build-1/libtool --silent --mode=compile cc -g -O2 -I. -I/tmp/pip-install-mfmh0zrh/mod-wsgi-httpd/build/httpd-2.4.41/os/unix -I/tmp/pip-install-mfmh0zrh/mod-wsgi-httpd/build/httpd-2.4.41/include -I/tmp/pip-install-mfmh0zrh/mod-wsgi-httpd/build/httpd/include/apr-1 -I/usr/local/include -I/tmp/pip-install-mfmh0zrh/mod-wsgi-httpd/build/httpd/include -I/tmp/pip-install-mfmh0zrh/mod-wsgi-httpd/build/httpd-2.4.41/modules/aaa -I/tmp/pip-install-mfmh0zrh/mod-wsgi-httpd/build/httpd-2.4.41/modules/cache -I/tmp/pip-install-mfmh0zrh/mod-wsgi-httpd/build/httpd-2.4.41/modules/core -I/tmp/pip-install-mfmh0zrh/mod-wsgi-httpd/build/httpd-2.4.41/modules/database -I/tmp/pip-install-mfmh0zrh/mod-wsgi-httpd/build/httpd-2.4.41/modules/filters -I/tmp/pip-install-mfmh0zrh/mod-wsgi-httpd/build/httpd-2.4.41/modules/ldap -I/tmp/pip-install-mfmh0zrh/mod-wsgi-httpd/build/httpd-2.4.41/modules/loggers -I/tmp/pip-install-mfmh0zrh/mod-wsgi-httpd/build/httpd-2.4.41/modules/lua -I/tmp/pip-install-mfmh0zrh/mod-wsgi-httpd/build/httpd-2.4.41/modules/proxy -I/tmp/pip-install-mfmh0zrh/mod-wsgi-httpd/build/httpd-2.4.41/modules/http2 -I/tmp/pip-install-mfmh0zrh/mod-wsgi-httpd/build/httpd-2.4.41/modules/session -I/tmp/pip-install-mfmh0zrh/mod-wsgi-httpd/build/httpd-2.4.41/modules/ssl -I/tmp/pip-install-mfmh0zrh/mod-wsgi-httpd/build/httpd-2.4.41/modules/test -I/tmp/pip-install-mfmh0zrh/mod-wsgi-httpd/build/httpd-2.4.41/server -I/tmp/pip-install-mfmh0zrh/mod-wsgi-httpd/build/httpd-2.4.41/modules/md -I/tmp/pip-install-mfmh0zrh/mod-wsgi-httpd/build/httpd-2.4.41/modules/arch/unix -I/tmp/pip-install-mfmh0zrh/mod-wsgi-httpd/build/httpd-2.4.41/modules/dav/main -I/tmp/pip-install-mfmh0zrh/mod-wsgi-httpd/build/httpd-2.4.41/modules/generators -I/tmp/pip-install-mfmh0zrh/mod-wsgi-httpd/build/httpd-2.4.41/modules/mappers -prefer-non-pic -static -c htpasswd.c && touch htpasswd.lo /tmp/pip-install-mfmh0zrh/mod-wsgi-httpd/build/httpd/build-1/libtool --silent --mode=compile cc -g -O2 -I. -I/tmp/pip-install-mfmh0zrh/mod-wsgi-httpd/build/httpd-2.4.41/os/unix -I/tmp/pip-install-mfmh0zrh/mod-wsgi-httpd/build/httpd-2.4.41/include -I/tmp/pip-install-mfmh0zrh/mod-wsgi-httpd/build/httpd/include/apr-1 -I/usr/local/include -I/tmp/pip-install-mfmh0zrh/mod-wsgi-httpd/build/httpd/include -I/tmp/pip-install-mfmh0zrh/mod-wsgi-httpd/build/httpd-2.4.41/modules/aaa -I/tmp/pip-install-mfmh0zrh/mod-wsgi-httpd/build/httpd-2.4.41/modules/cache -I/tmp/pip-install-mfmh0zrh/mod-wsgi-httpd/build/httpd-2.4.41/modules/core -I/tmp/pip-install-mfmh0zrh/mod-wsgi-httpd/build/httpd-2.4.41/modules/database -I/tmp/pip-install-mfmh0zrh/mod-wsgi-httpd/build/httpd-2.4.41/modules/filters -I/tmp/pip-install-mfmh0zrh/mod-wsgi-httpd/build/httpd-2.4.41/modules/ldap -I/tmp/pip-install-mfmh0zrh/mod-wsgi-httpd/build/httpd-2.4.41/modules/loggers -I/tmp/pip-install-mfmh0zrh/mod-wsgi-httpd/build/httpd-2.4.41/modules/lua -I/tmp/pip-install-mfmh0zrh/mod-wsgi-httpd/build/httpd-2.4.41/modules/proxy -I/tmp/pip-install-mfmh0zrh/mod-wsgi-httpd/build/httpd-2.4.41/modules/http2 -I/tmp/pip-install-mfmh0zrh/mod-wsgi-httpd/build/httpd-2.4.41/modules/session -I/tmp/pip-install-mfmh0zrh/mod-wsgi-httpd/build/httpd-2.4.41/modules/ssl -I/tmp/pip-install-mfmh0zrh/mod-wsgi-httpd/build/httpd-2.4.41/modules/test -I/tmp/pip-install-mfmh0zrh/mod-wsgi-httpd/build/httpd-2.4.41/server -I/tmp/pip-install-mfmh0zrh/mod-wsgi-httpd/build/httpd-2.4.41/modules/md -I/tmp/pip-install-mfmh0zrh/mod-wsgi-httpd/build/httpd-2.4.41/modules/arch/unix -I/tmp/pip-install-mfmh0zrh/mod-wsgi-httpd/build/httpd-2.4.41/modules/dav/main -I/tmp/pip-install-mfmh0zrh/mod-wsgi-httpd/build/httpd-2.4.41/modules/generators -I/tmp/pip-install-mfmh0zrh/mod-wsgi-httpd/build/httpd-2.4.41/modules/mappers -prefer-non-pic -static -c passwd_common.c && touch passwd_common.lo /tmp/pip-install-mfmh0zrh/mod-wsgi-httpd/build/httpd/build-1/libtool --silent --mode=link cc -g -O2 -L/usr/local/lib -o htpasswd htpasswd.lo passwd_common.lo /tmp/pip-install-mfmh0zrh/mod-wsgi-httpd/build/httpd/lib/libaprutil-1.la -lexpat /tmp/pip-install-mfmh0zrh/mod-wsgi-httpd/build/httpd/lib/libapr-1.la -lcrypt -lpthread -lcrypt ld: error: /tmp/pip-install-mfmh0zrh/mod-wsgi-httpd/build/httpd/lib/libaprutil-1.so: undefined reference to libiconv ld: error: /tmp/pip-install-mfmh0zrh/mod-wsgi-httpd/build/httpd/lib/libaprutil-1.so: undefined reference to libiconv_close ld: error: /tmp/pip-install-mfmh0zrh/mod-wsgi-httpd/build/httpd/lib/libaprutil-1.so: undefined reference to libiconv_open cc: error: linker command failed with exit code 1 (use -v to see invocation) *** Error code 1

  Stop.
  make[2]: stopped in /tmp/pip-install-mfmh0zrh/mod-wsgi-httpd/build/httpd-2.4.41/support
  *** Error code 1

  Stop.
  make[1]: stopped in /tmp/pip-install-mfmh0zrh/mod-wsgi-httpd/build/httpd-2.4.41/support
  *** Error code 1

  Stop.
  make: stopped in /tmp/pip-install-mfmh0zrh/mod-wsgi-httpd/build/httpd-2.4.41
  Downloading https://archive.apache.org/dist/httpd/httpd-2.4.41.tar.gz
  Traceback (most recent call last):
    File "<string>", line 1, in <module>
    File "/tmp/pip-install-mfmh0zrh/mod-wsgi-httpd/setup.py", line 110, in <module>
      raise RuntimeError('Failed to build HTTPD.')
  RuntimeError: Failed to build HTTPD.
  ----------------------------------------

ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.

ERROR: Command errored out with exit status 1: /usr/local/bin/python3.7 /usr/local/lib/python3.7/site-packages/pip install --ignore-installed --no-user --prefix /tmp/pip-build-env-s6qdfzeh/overlay --no-warn-script-location --no-binary :none: --only-binary :none: -i https://pypi.org/simple -- 'setuptools>=40.8.0' wheel mod_wsgi-httpd==2.4.41.1 Check the logs for full command output.

GrahamDumpleton commented 4 years ago

It may be the case that pip is stripping those environment variables before invoking build of Apache, so not getting through.

Is there a reason you aren't just using the Apache httpd package for FreeBSD and installing it on the system, but not enabling the service so it doesn't run? It is preferable to rely on the system one rather than use mod_wsgi-standalone.

Teva commented 4 years ago

"Is there a reason you aren't " I am charge of creating a script to build a web app on different servers (dev,test,prod) and thought it would be easier to just try wsgi_standalone to handle the hassle of setting up Apache with Wsgi.

I was not aware that I could install Apache from pkg, then not use it and let wsgi-standalone handle the startup process.

I will give it a try. Thank you

GrahamDumpleton commented 4 years ago

The steps are actually install system Apache, including any Apache dev package if they are split, so you have apxs or apxs2 command available. Then run pip install mod_wsgi. You can then run mod_wsgi-express. See:

That is the normal way of doing it.

The mod_wsgi-standalone package would be used only if you had no other choice because you didn't have admin access to the box to install the operating system package for Apache, and you didn't want to muck around with trying to install Apache from source code yourself.

Note that with this method and when using mod_wsgi-express, it doesn't interfere with the system package. It generates separate Apache configuration and leaves original alone.

Teva commented 4 years ago

Ok, I will do that, thank you very much.

W11T commented 3 years ago

The same on RHEL 7.9. Would be helpful to get the orirginal error message to get a clue what's missing.