Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
erp5
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Carlos Ramos Carreño
erp5
Commits
696e48f2
Commit
696e48f2
authored
Jul 14, 2011
by
Gabriel Monnerat
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
clean up the code to don't consider a different protocol, for now is considered only https
parent
11a9a920
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
10 deletions
+7
-10
slapos/recipe/apache/__init__.py
slapos/recipe/apache/__init__.py
+6
-9
slapos/recipe/apache/template/apache.vhost.conf.in
slapos/recipe/apache/template/apache.vhost.conf.in
+1
-1
No files found.
slapos/recipe/apache/__init__.py
View file @
696e48f2
...
...
@@ -57,7 +57,7 @@ class Recipe(BaseSlapRecipe):
# This should come from parameter.
frontend_domain_name
=
self
.
parameter_dict
.
get
(
"domain"
,
"h
ttp://h
ost.vifib.net"
)
"host.vifib.net"
)
site_url
=
self
.
installFrontendApache
(
ip
=
self
.
getGlobalIPv6Address
(),
...
...
@@ -212,18 +212,15 @@ class Recipe(BaseSlapRecipe):
name
,
access_control_string
=
None
):
rewrite_rule_include_path
=
self
.
createDataDirectory
(
'apachevhost'
)
slave_instance_list
=
self
.
parameter_dict
.
get
(
"slave_instance_list"
,
[])
clean_name
=
name
.
replace
(
"http://"
,
""
).
replace
(
"https://"
,
""
)
print
self
.
parameter_dict
for
slave_instance
in
slave_instance_list
:
id
=
self
.
generateNewId
()
protocol
=
name
.
split
(
":"
)[
0
]
url
=
slave_instance
.
get
(
"url"
)
rewrite_rule_content
=
self
.
substituteTemplate
(
self
.
getTemplateFilename
(
'apache.vhost.conf.in'
),
dict
(
id
=
id
,
ip
=
ip
,
port
=
port
,
domain
=
clean_name
,
url
=
url
,
protocol
=
protoco
l
))
dict
(
id
=
id
,
ip
=
ip
,
port
=
port
,
domain
=
name
,
url
=
ur
l
))
self
.
_writeFile
(
os
.
path
.
join
(
rewrite_rule_include_path
,
id
),
rewrite_rule_content
)
apache_conf
=
self
.
_getApacheConfigurationDict
(
clean_
name
,
ip
,
port
)
apache_conf
=
self
.
_getApacheConfigurationDict
(
name
,
ip
,
port
)
apache_conf
[
'ssl_snippet'
]
=
self
.
substituteTemplate
(
self
.
getTemplateFilename
(
'apache.ssl-snippet.conf.in'
),
dict
(
login_certificate
=
certificate
,
login_key
=
key
))
...
...
@@ -240,16 +237,16 @@ class Recipe(BaseSlapRecipe):
apache_conf_string
=
self
.
substituteTemplate
(
self
.
getTemplateFilename
(
'apache.conf.in'
),
apache_conf
)
apache_config_file
=
self
.
createConfigurationFile
(
clean_
name
+
'.conf'
,
apache_config_file
=
self
.
createConfigurationFile
(
name
+
'.conf'
,
apache_conf_string
)
self
.
path_list
.
append
(
apache_config_file
)
self
.
path_list
.
extend
(
zc
.
buildout
.
easy_install
.
scripts
([(
clean_
name
,
'slapos.recipe.erp5.apache'
,
'runApache'
)],
self
.
ws
,
name
,
'slapos.recipe.erp5.apache'
,
'runApache'
)],
self
.
ws
,
sys
.
executable
,
self
.
wrapper_directory
,
arguments
=
[
dict
(
required_path_list
=
[
key
,
certificate
],
binary
=
self
.
options
[
'httpd_binary'
],
config
=
apache_config_file
)
]))
return
"%s:%s/"
%
(
name
,
port
)
return
"
https://
%s:%s/"
%
(
name
,
port
)
slapos/recipe/apache/template/apache.vhost.conf.in
View file @
696e48f2
RewriteRule ^/%(id)s($|/.*) %(url)s/VirtualHostBase/
%(protocol)
s/%(domain)s:%(port)s/VirtualHostRoot/_vh_%(id)s$1 [L,P]
RewriteRule ^/%(id)s($|/.*) %(url)s/VirtualHostBase/
http
s/%(domain)s:%(port)s/VirtualHostRoot/_vh_%(id)s$1 [L,P]
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment