Changeset - 85baacecc198
[Not reviewed]
0 1 0
Lance Edgar - 5 years ago 2019-09-25 14:17:44
lance@edbob.org
Add `apache.install_wsgi()` convenience function

although you really shouldn't use it
1 file changed with 18 insertions and 0 deletions:
0 comments (0 inline, 0 general) First comment
rattail_fabric2/apache.py
Show inline comments
 
@@ -38,6 +38,24 @@ def install(c):
 
    apt.install(c, 'apache2')
 

	
 

	
 
def install_wsgi(c, python_home=None, python3=True):
 
    """
 
    Install the mod_wsgi Apache module, with optional ``WSGIPythonHome`` value.
 

	
 
    NOTE: you probably should not use this!  reverse proxy seems more robust
 
    """
 
    if python3:
 
        apt.install(c, 'libapache2-mod-wsgi-py3')
 
    else:
 
        apt.install(c, 'libapache2-mod-wsgi')
 
    if python_home:
 
        if get_version(c) == 2.2:
 
            c.sudo("bash -c 'echo WSGIPythonHome {} > /etc/apache2/conf.d/wsgi'".format(python_home))
 
        else: # assuming 2.4
 
            c.sudo("bash -c 'echo WSGIPythonHome {} > /etc/apache2/conf-available/wsgi.conf'".format(python_home))
 
            enable_conf(c, 'wsgi')
 

	
 

	
 
def get_version(c):
 
    """
 
    Fetch the version of Apache running on the target system
0 comments (0 inline, 0 general) First comment
You need to be logged in to comment. Login now