How can I get mod_wsgi working on Mac?

2020-06-03 06:12发布

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.

9条回答
我只想做你的唯一
2楼-- · 2020-06-03 07:12

With the latest Mac OS and most recent HomeBrew, the package isn't available on HomeBrew.

However, if you have Python3 and Pip3 installed and configured on your Mac, you can load the package using:

pip3 install mod_wsgi
查看更多
beautiful°
3楼-- · 2020-06-03 07:14

I had to first run the below command to get mod_wsgi installed

brew tap homebrew/apache

And then run

brew install mod_wsgi
查看更多
一纸荒年 Trace。
4楼-- · 2020-06-03 07:18

I wrote two tutorials about how to install Apache + MySQL + Python in Mac OS and Windows. Maybe you can take a look.

[Tutorial] install Apache + MySQL + Python on Mac OS
http://fstoke.me/blog/?p=3583

[Tutorial] install Apache + MySQL + Python on Windows
http://fstoke.me/blog/?p=3600

查看更多
登录 后发表回答