Loading Module Into Apache – mod_wsgi

apache-2.2djangohttpd.confmod-wsgishell

Loading Module Into Apache

Once the Apache module has been installed into your Apache installation's module directory, it is still necessary to configure Apache to actually load the module.

Exactly how this is done and in which of the main Apache configuration files it should be placed, is dependent on which version of Apache you are using and may also be influenced by how your operating system's Apache distribution has organised the Apache configuration files. You may therefore need to check with any documentation for your operating system to see in what way the procedure may need to be modified.

In the simplest case, all that is required is to add a line of the form:

LoadModule wsgi_module modules/mod_wsgi.so
into the main Apache "httpd.conf" configuration file at the same point that other Apache modules are being loaded. The last option to the directive should either be an absolute path to where the mod_wsgi module file is located, or a path expressed relative to the root of your Apache installation. If you used "make" to install the package, see where it copied the file to work out what to set this value to.

  • Where do I add the LoadModule line inside the httpd.conf file?
  • I don't understand these directions:

The last option to the directive should either be an absolute path to where the mod_wsgi module file is located, or a path expressed relative to the root of your Apache installation. If you used "make" to install the package, see where it copied the file to work out what to set this value to.

Best Answer

If you look at the httpd.conf you will notice that there are a large number of rows that have LoadModule on them, you can add LoadModule wsgi_module modules/mod_wsgi.so to the bottom of them, but check first to see if that is not there already.

The absolute path part they are talking about is the modules/mod_wsgi.so part. If you used the default configure when running make on the library, then you should be able to use the same as above or what you have currently in your httpd.conf file for the other LoadModule entries.