0
votes

I want to install mod_wsgi-4.4.11 so that I can use Django and apache for local web development but I am unsuccessful. These are the steps/commands that I have taken in my attempts to install mod_wsgi-4.4.11. I am using the Apple system python version. I downloaded mod_wsgi-4.4.11 according to the quick instructions from code.google.com/p/modwsgi/wiki/QuickInstallationGuide. The steps/commands that used were as follows:

1) Downloaded mod_wsgi as a zip, cd to the folder 2)./configure 3) make 4) sudo make install 4) added the line LoadModule wsgi_module /usr/libexec/apache2/mod_wsgi.so to the http.conf file, stopped and started apache server 5) httpd -t.

I receive the following error.

Syntax error on line 172 of /private/etc/apache2/httpd.conf: Cannot load /usr/libexec/apache2/mod_wsgi.so into server: dlopen(/usr/libexec/apache2/mod_wsgi.so, 10): Symbol not found: _PyBool_Type\n Referenced from: /usr/libexec/apache2/mod_wsgi.so\n Expected in: flat namespace\n in /usr/libexec/apache2/mod_wsgi.so

I cd to /usr/libexec/apache2 and I run otool -L mod_wsgi.so and the output is:

mod_wsgi.so: /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1213.0.0) /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation (compatibility version 150.0.0, current version 1153.18.0) Daniels-MacBook-Pro:apache2 Daniel$

Makefile when configure was run:

LDFLAGS = LDFLAGS = -L/Library/Frameworks/Python.framework/Versions/2.7/lib -L/Library/Frameworks/

LDLIBS = -lpython2.7 -ldl -framework CoreFoundation

It was suggested that I use pip to install mod_wsgi. I followed the instructions from https://pypi.python.org/pypi/mod_wsgi/4.4.11. The commands/actions I took were as follows: 1) Upgraded pip to 6.1.1 2) pip install mod_wsgi (installed successfully) 3) ran mod_wsgi-express start-server 4) Received error: ValueError: unknown locale: UTF-8

When I run the locale command the LANG variable is assigned to nothing it looks like this: LANG =

1
Are you using Apple system Python version or a version from brew or some other package system? What version of mod_wsgi are you using? Did you start with fresh mod_wsgi source code which had never been compiled in before? What actual commands did you use to compile/install mod_wsgi? - Graham Dumpleton
I am using the Apple system python version. I downloaded and attempted to install mod_wsgi-4.4.11 according to the quick instructions from code.google.com/p/modwsgi/wiki/QuickInstallationGuide. The steps/commands that used were as follows: Downloaded mod_wsgi as a zip, cd to the folder, ran ./configure, make, sudo make install, added the line LoadModule wsgi_module /usr/libexec/apache2/mod_wsgi.so to the http.conf file, stopped and restarted apache server, ran httpd -t....Thanks for any help that you may be able to provide. - Dan
Amend your question and add the output of running otool -L /usr/libexec/apache2/mod_wsgi.so. - Graham Dumpleton
To separately verify whether it should work, you can also try the 'pip' installable version of mod_wsgi. This will not touch your system Apache. See pypi.python.org/pypi/mod_wsgi - Graham Dumpleton
Thanks, I ammended the question. I will try with pip as you suggest. - Dan

1 Answers

0
votes

I restored the state of my system to a point before I installed IDLE, followed the installation instructions listed above and successfully installed and loaded the module. I then followed the instructions to configure the application (https://code.google.com/p/modwsgi/wiki/QuickConfigurationGuide) and successfully printed out hello world. Since the configuration guide was a bit confusing I used the google group (https://groups.google.com/forum/#!forum/modwsgi) which helped to answer my questions during this process. In case anyone has a similar problem.