Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
slapos
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
Łukasz Nowak
slapos
Commits
047b6737
Commit
047b6737
authored
Jan 11, 2013
by
Cédric de Saint Martin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add second custom configuration file that goes inside of the virtualhost confs
parent
8220afc4
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
4 deletions
+18
-4
slapos/recipe/apache_frontend/__init__.py
slapos/recipe/apache_frontend/__init__.py
+10
-4
slapos/recipe/apache_frontend/template/apache.conf.in
slapos/recipe/apache_frontend/template/apache.conf.in
+8
-0
No files found.
slapos/recipe/apache_frontend/__init__.py
View file @
047b6737
...
...
@@ -528,16 +528,21 @@ class Recipe(BaseSlapRecipe):
self
.
_createDirectory
(
cache_directory_location
)
self
.
_createDirectory
(
mod_ssl_cache_location
)
# Create "custom" apache configuration file if it does not exist.
# Note : Th
is file
won't be erased or changed when slapgrid is ran.
# Create "custom" apache configuration file
s
if it does not exist.
# Note : Th
ose files
won't be erased or changed when slapgrid is ran.
# It can be freely customized by node admin.
custom_apache_configuration_directory
=
os
.
path
.
join
(
self
.
data_root_directory
,
'apache-conf.d'
)
self
.
_createDirectory
(
custom_apache_configuration_directory
)
# First one is included in the end of the apache configuration file
custom_apache_configuration_file_location
=
os
.
path
.
join
(
custom_apache_configuration_directory
,
'apache_frontend.custom.conf'
)
f
=
open
(
custom_apache_configuration_file_location
,
'a'
)
f
.
close
()
open
(
custom_apache_configuration_file_location
,
'a'
)
# Second one is included in the virtualhost of apache configuration file
custom_apache_virtual_configuration_file_location
=
os
.
path
.
join
(
custom_apache_configuration_directory
,
'apache_frontend.virtualhost.custom.conf'
)
open
(
custom_apache_virtual_configuration_file_location
,
'a'
)
# Create backup of custom apache configuration
backup_path
=
self
.
createBackupDirectory
(
'custom_apache_conf_backup'
)
...
...
@@ -592,6 +597,7 @@ class Recipe(BaseSlapRecipe):
https_port
=
port
,
plain_http_port
=
plain_http_port
,
custom_apache_conf
=
custom_apache_configuration_file_location
,
custom_apache_virtualhost_conf
=
custom_apache_virtual_configuration_file_location
,
))
apache_conf_string
=
self
.
substituteTemplate
(
...
...
slapos/recipe/apache_frontend/template/apache.conf.in
View file @
047b6737
...
...
@@ -100,6 +100,10 @@ Header append Vary User-Agent
ProxyTimeout 600
RewriteEngine On
# Include configuration file not operated by slapos. This file won't be erased
# or changed when slapgrid is ran. It can be freely customized by node admin.
Include %(custom_apache_virtualhost_conf)s
# Define the two RewriteMaps (key -> value store): one for Zope, one generic
# containing: rewritten URL -> original URL (a.k.a VirtualHostBase in Zope)
RewriteMap apachemapzope txt:%(apachemapzope_path)s
...
...
@@ -128,6 +132,10 @@ Header append Vary User-Agent
RewriteEngine On
ProxyPreserveHost On
# Include configuration file not operated by slapos. This file won't be erased
# or changed when slapgrid is ran. It can be freely customized by node admin.
Include %(custom_apache_virtualhost_conf)s
# We accept generic (i.e not lamp) backends on http
RewriteMap apachemapgeneric txt:%(apachemap_path)s
RewriteCond ${apachemapgeneric:%%{SERVER_NAME}} >""
...
...
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