Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I get mod_wsgi working on Mac?

I have been trying to install the latest version of mod_wsgi (3.3) since hours on my Mac. I'm on Snow Leopard and I have the versions of Apache (Apache/2.2.15) and Python 2.6.1 (r261:67515) that come with the system.

  1. I downloaded mod_wsgi-3.3.tar.gz from http://code.google.com/p/modwsgi/downloads/detail?name=mod_wsgi-3.3.tar.gz

  2. Extracted the file and executed the following through terminal:

    ./configure make sudo make install

  3. I added LoadModule wsgi_module modules/mod_wsgi.so to my httpd.conf.

  4. Restarted Apache by disabling and enabling Web Sharing from the control panel.

  5. localhost stops working until I remove the line I added httpd.conf :(

Please help. Thanks in advance.

like image 889
emurad Avatar asked Dec 03 '10 01:12

emurad


2 Answers

I use the homebrew installed version of mod_wsgi. That gives me a universal version of mod_wsgi that works with the vanilla apache.

➔  file `brew list mod_wsgi`
/usr/local/Cellar/mod_wsgi/3.2/libexec/mod_wsgi.so: Mach-O universal binary with 2 architectures
/usr/local/Cellar/mod_wsgi/3.2/libexec/mod_wsgi.so (for architecture x86_64):   Mach-O 64-bit bundle x86_64
/usr/local/Cellar/mod_wsgi/3.2/libexec/mod_wsgi.so (for architecture i386): Mach-O bundle i386
like image 69
Matthew Schinckel Avatar answered Oct 01 '22 06:10

Matthew Schinckel


The problem you had was the path to mod_wsgi.so. On OS X the appropriate line is

LoadModule wsgi_module        libexec/apache2/mod_wsgi.so
like image 24
Paul Whitehurst Avatar answered Oct 01 '22 05:10

Paul Whitehurst