summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGraham Dumpleton <Graham.Dumpleton@gmail.com>2014-06-09 20:50:41 +1000
committerGraham Dumpleton <Graham.Dumpleton@gmail.com>2014-06-09 20:50:41 +1000
commit25f9682a1292dbfbbb6d237b669fcb61d19f3df0 (patch)
tree2eaff4d8e1cc853dc298a2b4ef8b7990c92017a7
parentc2914efa88c38626d5cba8e0cc65850adccc13de (diff)
parente717873e67aefbadbb8c0b0a69d9795bf1e1d194 (diff)
downloadmod_wsgi-4.2.1.tar.gz
Merge branch 'release/4.2.1'4.2.1
-rw-r--r--README.rst97
-rw-r--r--docs/release-notes/index.rst1
-rw-r--r--docs/release-notes/version-4.2.1.rst22
-rw-r--r--src/server/__init__.py25
-rw-r--r--src/server/wsgi_version.h4
5 files changed, 147 insertions, 2 deletions
diff --git a/README.rst b/README.rst
index 99f21c2..2111387 100644
--- a/README.rst
+++ b/README.rst
@@ -129,6 +129,103 @@ For a complete list of options you can run::
Further information on using the mod_wsgi express version see the main
mod_wsgi documentation.
+Non standard Apache installations
+---------------------------------
+
+Many Linux distributions have a tendency to screw around with the standard
+Apache Software Foundation layout for installation of Apache. This can
+include renaming the Apache ``httpd`` executable to something else, and in
+addition to potentially renaming it, replacing the original binary with a
+shell script which performs additional actions which can only be performed
+as the ``root`` user.
+
+In the case of the ``httpd`` executable simply being renamed, the
+executable will obviously not be found and mod_wsgi express will fail to
+start at all.
+
+In this case you should work out what the ``httpd`` executable was renamed
+to and use the ``--httpd-executable`` option to specify its real location.
+
+For example, if ``httpd`` was renamed to ``apache2``, you might need to use::
+
+ mod_wsgi-express start-server wsgi.py --httpd-executable=/usr/sbin/apache2
+
+In the case of the ``httpd`` executable being replaced with a shell script
+which performs additional actions before then executing the original
+``httpd`` executable, and the shell script is failing in some way, you will
+need to use the location of the original ``httpd`` executable the shell
+script is in turn executing.
+
+Running mod_wsgi express as root
+--------------------------------
+
+The primary intention of mod_wsgi express is to make it easier for users
+to run up Apache on non privileged ports, especially during the development
+of a Python web application. If you want to be able to run Apache using
+mod_wsgi express on a privileged port such as the standard port 80 used by
+HTTP servers, then you will need to run ``mod_wsgi-express`` as root. In
+doing this, you will need to perform additional steps.
+
+The first thing you must do is supply the ``--user`` and ``--group``
+options to say what user and group your Python web application should run
+as. Most Linux distrbutions will pre define a special user for Apache to
+run as, so you can use that. Alternatively you can use any other special
+user account you have created for running the Python web application::
+
+ mod_wsgi-express start-server wsgi.py --port=80 \
+ --user www-data --group www-data
+
+This approach to running ``mod_wsgi-express`` will be fine so long as you
+are using a process supervisor which expects the started process to remain
+in the foreground and not daemonize.
+
+If however you are directly integrating into the system init scripts where
+separate start and stop commands are expected, with the executing process
+expected to be daemonized, then a different process is required to setup
+mod_wsgi express.
+
+In this case, instead of simply using the ``start-server`` command to
+``mod_wsgi-express`` you should use ``setup-server``::
+
+ mod_wsgi-express start-server wsgi.py --port=80 \
+ --user www-data --group www-data \
+ --server-root=/etc/mod_wsgi-express-80
+
+In running this command, it will not actually startup Apache. All it will do
+is create the set of configuration files and startup script to be run.
+
+So that these are not created in the default location of a directory under
+``/tmp``, you should use the ``--server-root`` option to specify where they
+should be placed.
+
+Having created the configuration and startup script, to start the Apache
+instance you can now run::
+
+ /etc/mod_wsgi-express-80/apachectl start
+
+To subsequently stop the Apache instance you can run::
+
+ /etc/mod_wsgi-express-80/apachectl stop
+
+You can also restart the Apache instance as necessary using::
+
+ /etc/mod_wsgi-express-80/apachectl restart
+
+Using this approach, the original options you supplied to ``setup-server``
+will effectively be cached with the resulting configuration used each time.
+If you need to update the set of options, run ``setup-server`` again with
+the new set of options.
+
+Note that even taking all these steps, it is possible that running up
+Apache as ``root`` using mod_wsgi express may fail on systems where SELinux
+extensions are enabled. This is because the SELinux profile may not match
+what is being expected for the way that Apache is being started, or
+alternatively, the locations that Apache has been specified as being
+allowed to access, don't match where the directory specified using the
+``--server-root`` directory was placed. You may therefore need to configure
+SELinux or move the directory used with ``--server-root`` to an allowed
+location.
+
Using mod_wsgi express with Django
----------------------------------
diff --git a/docs/release-notes/index.rst b/docs/release-notes/index.rst
index 45ff52d..8db3b21 100644
--- a/docs/release-notes/index.rst
+++ b/docs/release-notes/index.rst
@@ -5,6 +5,7 @@ Release Notes
.. toctree::
:maxdepth: 2
+ version-4.2.1.rst
version-4.2.0.rst
version-4.1.3.rst
diff --git a/docs/release-notes/version-4.2.1.rst b/docs/release-notes/version-4.2.1.rst
new file mode 100644
index 0000000..d412988
--- /dev/null
+++ b/docs/release-notes/version-4.2.1.rst
@@ -0,0 +1,22 @@
+=============
+Version 4.2.1
+=============
+
+Version 4.2.1 of mod_wsgi can be obtained from:
+
+ https://github.com/GrahamDumpleton/mod_wsgi/archive/4.2.1.tar.gz
+
+Known Issues
+------------
+
+1. The makefiles for building mod_wsgi on Windows are currently broken and
+need updating. As most new changes relate to mod_wsgi daemon mode, which is
+not supported under Windows, you should keep using the last available
+binary for version 3.X on Windows instead.
+
+Bugs Fixed
+----------
+
+1. The auto generated configuration would not work with an Apache
+installation where core Apache modules were statically compiled into Apache
+rather than being dynamically loaded.
diff --git a/src/server/__init__.py b/src/server/__init__.py
index c64ef4f..5bfa791 100644
--- a/src/server/__init__.py
+++ b/src/server/__init__.py
@@ -68,7 +68,9 @@ def find_mimetypes():
return name
APACHE_GENERAL_CONFIG = """
+<IfModule !version_module>
LoadModule version_module '%(modules_directory)s/mod_version.so'
+</IfModule>
ServerName %(host)s
ServerRoot '%(server_root)s'
@@ -113,21 +115,42 @@ LoadModule mpm_prefork_module '%(modules_directory)s/mod_mpm_prefork.so'
</IfVersion>
<IfVersion >= 2.4>
+<IfModule !access_compat_module>
LoadModule access_compat_module '%(modules_directory)s/mod_access_compat.so'
+</IfModule>
+<IfModule !unixd_module>
LoadModule unixd_module '%(modules_directory)s/mod_unixd.so'
+</IfModule>
+<IfModule !authn_core_module>
LoadModule authn_core_module '%(modules_directory)s/mod_authn_core.so'
+</IfModule>
+<IfModule !authz_core_module>
LoadModule authz_core_module '%(modules_directory)s/mod_authz_core.so'
+</IfModule>
</IfVersion>
+<IfModule !authz_host_module>
LoadModule authz_host_module '%(modules_directory)s/mod_authz_host.so'
+</IfModule>
+<IfModule !mime_module>
LoadModule mime_module '%(modules_directory)s/mod_mime.so'
+</IfModule>
+<IfModule !rewrite_module>
LoadModule rewrite_module '%(modules_directory)s/mod_rewrite.so'
+</IfModule>
+<IfModule !alias_module>
LoadModule alias_module '%(modules_directory)s/mod_alias.so'
+</IfModule>
+<IfModule !dir_module>
LoadModule dir_module '%(modules_directory)s/mod_dir.so'
+</IfModule>
+
LoadModule wsgi_module '%(mod_wsgi_so)s'
<IfDefine WSGI_SERVER_METRICS>
+<IfModule !status_module>
LoadModule status_module '%(modules_directory)s/mod_status.so'
+</IfModule>
</IfDefine>
<IfVersion < 2.4>
@@ -227,7 +250,9 @@ ErrorLog '%(error_log)s'
LogLevel %(log_level)s
<IfDefine WSGI_ACCESS_LOG>
+<IfModule !log_config_module>
LoadModule log_config_module %(modules_directory)s/mod_log_config.so
+</IfModule>
LogFormat "%%h %%l %%u %%t \\"%%r\\" %%>s %%b" common
CustomLog "%(log_directory)s/access_log" common
</IfDefine>
diff --git a/src/server/wsgi_version.h b/src/server/wsgi_version.h
index a97c590..d145c30 100644
--- a/src/server/wsgi_version.h
+++ b/src/server/wsgi_version.h
@@ -25,8 +25,8 @@
#define MOD_WSGI_MAJORVERSION_NUMBER 4
#define MOD_WSGI_MINORVERSION_NUMBER 2
-#define MOD_WSGI_MICROVERSION_NUMBER 0
-#define MOD_WSGI_VERSION_STRING "4.2.0"
+#define MOD_WSGI_MICROVERSION_NUMBER 1
+#define MOD_WSGI_VERSION_STRING "4.2.1"
/* ------------------------------------------------------------------------- */