Mod_python Installer For Windows
OverviewThe modwsgi package provides an Apache module that implements a WSGIcompliant interface for hosting Python based web applications on top of theApache web server.Installation of modwsgi from source code can be performed in one of twoways.The first way of installing modwsgi is the traditional way that has beenused by many software packages. This is where it is installed as a moduledirectly into your Apache installation using the commands configure,make and make install, a method sometimes referred to by theacronym CMMI. This method works with most UNIX type systems. Timeline 3d 3.5 serial. System RequirementsWith either installation method for modwsgi, you must have Apacheinstalled. This must be a complete Apache installation. It is not enough tohave only the runtime packages for Apache installed. Installation into ApacheFor installation directly into your Apache installation using the CMMImethod, see the full documentation at:.Alternatively, use the following instructions to install modwsgi into yourPython installation and then either copy the modwsgi module into yourApache installation, or configure Apache to use the modwsgi module fromthe Python installation.When using this approach, you will still need to manually configure Apacheto have modwsgi loaded into Apache, and for it to know about your WSGIapplication.
Non standard Apache installationsMany Linux distributions have a tendency to screw around with the standardApache Software Foundation layout for installation of Apache. Running modwsgi-express as rootThe primary intention of modwsgi-express is to make it easier forusers to run up Apache on non privileged ports, especially during thedevelopment of a Python web application. If you want to be able to runApache using modwsgi-express on a privileged port such as the standardport 80 used by HTTP servers, then you will need to runmodwsgi-express as root. In doing this, you will need to performadditional steps.The first thing you must do is supply the -user and -groupoptions to say what user and group your Python web application should runas.
Most Linux distributions will predefine a special user for Apache torun as, so you can use that. Using modwsgi-express with DjangoTo use modwsgi-express with Django, after having installed themodwsgi package into your Python installation, edit your Django settingsmodule and add modwsgi.server to the list of installed apps. Connecting into Apache installationIf you want to use modwsgi in combination with your system Apacheinstallation, the CMMI method for installing modwsgi would normally beused.If you are on MacOS X Sierra that is no longer possible.
Pip Install Mod_python
Even prior toMacOS X Sierra, the System Integrity Protection (SIP) system of MacOS X,prevented installing the modwsgi module into the Apache modules directory.If you are using Windows, the CMMI method was never supported as Windowsdoesn’t supply the required tools to make it work.The CMMI installation method also involves a bit more work as you need toseparately download the modwsgi source code, run the configure tooland then run make and make install.The alternative to using the CMMI installation method is to use the Apachemodwsgi module created by running pip install. This can be directlyreferenced from the Apache configuration, or copied into the Apache modulesdirectory.To use the Apache modwsgi module from where pip install placed it,run the command modwsgi-express module-config. This will outputsomething like: LoadModule wsgimodule /usr/local/lib/python2.7/site-packages/modwsgi/server/modwsgi-py27.soWSGIPythonHome /usr/local/libThese are the directives needed to configure Apache to load the modwsgimodule and tell modwsgi where the Python installation directory or virtualenvironment was located.This would be placed in the Apache httpd.conf file, or if using a Linuxdistribution which separates out module configuration into amods-available directory, in the wsgi.load file within themods-available directory. In the latter case where a mods-availabledirectory is used, the module would then be enabled by runninga2enmod wsgi as root. If necessary Apache can then be restarted toverify the module is loading correctly.
Python For Windows
You can then configure Apache asnecessary for your specific WSGI application.Note that because in this scenario the modwsgi module for Apache could belocated in a Python virtual environment, if you destroy the Python virtualenvironment the module will also be deleted. In that case you would need toensure you recreate the Python virtual environment and reinstall themodwsgi package using pip, or, take out the modwsgi configurationfrom Apache before restarting Apache, else it will fail to startup.Instead of referencing the modwsgi module from the Python installation,you can instead copy the modwsgi module into the Apache installation.
Todo that, run the modwsgi-express install-module command, running it asroot if necessary. This will output something like: LoadModule wsgimodule modules/modwsgi-py27.soWSGIPythonHome /usr/local/libThis is similar to above except that the modwsgi module was copied to theApache modules directory first and the LoadModule directive referencesit from that location. You should take these lines and configure Apache inthe same way as described above.Do note that copying the module like this will not work on recent versionsof MacOS X due to the SIP feature of MacOS X.