Ignore:
Timestamp:
Nov 9, 2015, 4:26:30 PM (7 years ago)
Author:
andersk
Message:
Configure reified vhosts through LDAP

Reduces duplication, allows the owners to configure these vhosts
through Pony again, and potentially simplifies future automation.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/server/fedora/config/etc/httpd/vhosts.d/reify-vhost.py

    r2684 r2731  
    3232           [host, host]))
    3333if len(r) != 0:
    34     user = pwd.getpwuid(int(r[0][1]['apacheSuexecUid'][0]))
    3534    serveralias = ""
    3635    if 'apacheServerAlias' in r[0][1]:
    3736        serveralias = "ServerAlias "+" ".join(r[0][1]['apacheServerAlias'])
    38     print """# do not trailing-slash DocumentRoot
    39 
    40 <VirtualHost *:80>
    41         ServerName %(servername)s
    42         %(serveralias)s
    43         DocumentRoot %(docroot)s
    44         Alias /~%(uname)s %(homedir)s/web_scripts
    45         SuExecUserGroup %(uname)s %(uname)s
    46         Include conf.d/vhosts-common.conf
    47 </VirtualHost>
    48 
     37    print """\
    4938<IfModule ssl_module>
    5039        <VirtualHost *:443>
    5140                ServerName %(servername)s
    5241                %(serveralias)s
    53                 DocumentRoot %(docroot)s
    54                 Alias /~%(uname)s %(homedir)s/web_scripts
    55                 SuExecUserGroup %(uname)s %(uname)s
     42                Include conf.d/vhost_ldap.conf
    5643                Include conf.d/vhosts-common-ssl.conf
    5744                SSLCertificateFile /etc/pki/tls/certs/%(hname)s.pem
     
    6148                ServerName %(servername)s
    6249                %(serveralias)s
    63                 DocumentRoot %(docroot)s
    64                 Alias /~%(uname)s %(homedir)s/web_scripts
    65                 SuExecUserGroup %(uname)s %(uname)s
     50                Include conf.d/vhost_ldap.conf
    6651                Include conf.d/vhosts-common-ssl.conf
    6752                Include conf.d/vhosts-common-ssl-cert.conf
     
    7257    'servername': r[0][1]['apacheServerName'][0],
    7358    'serveralias': serveralias,
    74     'docroot': r[0][1]['apacheDocumentRoot'][0],
    75     'uname': user[0],
    76     'homedir': user[5],
    7759    'hname': host
    7860}
Note: See TracChangeset for help on using the changeset viewer.