So what is wsgi? wsgi is short for web server gateway interface, in another way, it is not a library, not an API, nothing but an interface, i.e., a specification that you can find more detail from PEP3333.
I am planning to set up the environment properly on the VM that I installed. Since I have already installed Apache server, the next step is to install mod_wsgi. The interesting thing about the documentation is that it used to be hosted on Google Code but then the author Graham Dumpleton hosted on Github. To make sure I am using the most up to date mod_wsgi, I decided to build it from source and here are the two things you might need to pay attention:
- wget doesn’t comes with default on minimal install but curl is available. I had to do curl -LO to follow the redirect and meanwhile download the file locally instead of printing to standard output.
- configure, make won’t work out of the box and you have to “yum groupinstall ‘Development Tools'”.
- yum install httpd-devel will solve the apxs problem.
- yum install epel-release will add the epel
After all the effort, yum install -y mod_wsgi actually will do the work, some how pip install mod_wsgi and build from source failed me so bad.
Again, working with Python from a brand new CentOS is not as easy as you imagine, a few pitfalls that you might need to watch out. First, install zlib-devel zlib zlib-static if possible and then install Python2.7 from source, then install the corresponding pip version which is 2.7 by using the get-pip.py. Then install virtualenv…etc.