Ignore:
Timestamp:
Jan 26, 2010, 7:04:42 PM (15 years ago)
Author:
quentin
Message:
Handle vhosts that don't have any defined aliases
File:
1 edited

Legend:

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

    r978 r1445  
    3333if len(r) != 0:
    3434    user = pwd.getpwuid(int(r[0][1]['apacheSuexecUid'][0]))
     35    serveralias = ""
     36    if 'apacheServerAlias' in r[0][1]:
     37        serveralias = "ServerAlias "+r[0][1]['apacheServerAlias'][0]
    3538    print """# do not trailing-slash DocumentRoot
    3639
     
    4750        <VirtualHost *:443>
    4851                ServerName %(servername)s
    49                 ServerAlias %(serveralias)s
     52                %(serveralias)s
    5053                DocumentRoot %(docroot)s
    5154                Alias /~%(uname)s %(homedir)s/web_scripts
     
    5659        <VirtualHost *:444>
    5760                ServerName %(servername)s
    58                 ServerAlias %(serveralias)s
     61                %(serveralias)s
    5962                DocumentRoot %(docroot)s
    6063                Alias /~%(uname)s %(homedir)s/web_scripts
     
    6669</IfModule>""" % {
    6770    'servername': r[0][1]['apacheServerName'][0],
    68     'serveralias': r[0][1]['apacheServerAlias'][0],
     71    'serveralias': serveralias,
    6972    'docroot': r[0][1]['apacheDocumentRoot'][0],
    7073    'uname': user[0],
Note: See TracChangeset for help on using the changeset viewer.