Commit 81520881 authored by Łukasz Nowak's avatar Łukasz Nowak

- fix KeyAuth apache configuration


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@44121 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent de04b523
...@@ -555,7 +555,7 @@ SSLRandomSeed connect builtin ...@@ -555,7 +555,7 @@ SSLRandomSeed connect builtin
])) ]))
return 'https://%(ip)s:%(port)s' % apache_conf return 'https://%(ip)s:%(port)s' % apache_conf
def installKeyAuthorisationApache(self, index): def installKeyAuthorisationApache(self, ip, port, backend):
ssl_template = """SSLEngine on ssl_template = """SSLEngine on
SSLVerifyClient require SSLVerifyClient require
RequestHeader set REMOTE_USER %%{SSL_CLIENT_S_DN_CN}s RequestHeader set REMOTE_USER %%{SSL_CLIENT_S_DN_CN}s
...@@ -563,21 +563,17 @@ SSLCertificateFile %(key_auth_certificate)s ...@@ -563,21 +563,17 @@ SSLCertificateFile %(key_auth_certificate)s
SSLCertificateKeyFile %(key_auth_key)s SSLCertificateKeyFile %(key_auth_key)s
SSLCACertificateFile %(ca_certificate)s SSLCACertificateFile %(ca_certificate)s
SSLCARevocationPath %(ca_crl)s""" SSLCARevocationPath %(ca_crl)s"""
apache_conf = self._getApacheConfigurationDict('key_auth_apache_%s' % \ apache_conf = self._getApacheConfigurationDict('key_auth_apache', ip, port)
index,
self.getLocalIPv4Address(),
CONFIG['key_auth_apache_port_base'] + index)
apache_conf['ssl_snippet'] = ssl_template % CONFIG apache_conf['ssl_snippet'] = ssl_template % CONFIG
prefix = 'ssl_key_auth_apache_%s' % index prefix = 'ssl_key_auth_apache'
rewrite_rule_template = \ rewrite_rule_template = \
"RewriteRule (.*) http://%(backend_ip)s:%(backend_port)s%(key_auth_path)s$1 [L,P]" "RewriteRule (.*) http://%(backend)s%(key_auth_path)s$1 [L,P]"
path_template = pkg_resources.resource_string(__name__, path_template = pkg_resources.resource_string(__name__,
'template/apache.zope.conf.path.in') 'template/apache.zope.conf.path.in')
path = path_template % dict(path='/') path = path_template % dict(path='/')
d = dict( d = dict(
path=path, path=path,
backend_ip=self.backend_ip, backend=backend,
backend_port=self.backend_port,
backend_path='/', backend_path='/',
port=apache_conf['port'], port=apache_conf['port'],
vhname=path.replace('/', ''), vhname=path.replace('/', ''),
...@@ -593,7 +589,7 @@ SSLCARevocationPath %(ca_crl)s""" ...@@ -593,7 +589,7 @@ SSLCARevocationPath %(ca_crl)s"""
'template/apache.zope.conf.in') % apache_conf) 'template/apache.zope.conf.in') % apache_conf)
self.path_list.append(apache_config_file) self.path_list.append(apache_config_file)
self.path_list.extend(zc.buildout.easy_install.scripts([( self.path_list.extend(zc.buildout.easy_install.scripts([(
'key_auth_apache_%s' % index, 'key_auth_apache',
__name__ + '.apache', 'runApache')], self.ws, __name__ + '.apache', 'runApache')], self.ws,
sys.executable, self.wrapper_directory, arguments=[ sys.executable, self.wrapper_directory, arguments=[
dict( dict(
...@@ -604,8 +600,7 @@ SSLCARevocationPath %(ca_crl)s""" ...@@ -604,8 +600,7 @@ SSLCARevocationPath %(ca_crl)s"""
config=apache_config_file config=apache_config_file
) )
])) ]))
self.connection_dict['key_auth_%s' % index] = \ return 'https://%(ip)s:%(port)s' % apache_conf
'%(ip)s:%(port)s' % apache_conf
def installMysqlServer(self): def installMysqlServer(self):
mysql_conf = dict( mysql_conf = dict(
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment