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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Valentin Benozillo
slapos
Commits
f05d5828
Commit
f05d5828
authored
May 22, 2013
by
Cédric Le Ninivin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
apache-frontend: introduce default virtualhost with notfound message, add per slave logging
parent
cadd97e9
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
66 additions
and
1 deletion
+66
-1
software/apache-frontend/000.conf.in
software/apache-frontend/000.conf.in
+24
-0
software/apache-frontend/apache-slave-list.cfg.in
software/apache-frontend/apache-slave-list.cfg.in
+2
-0
software/apache-frontend/common.cfg
software/apache-frontend/common.cfg
+11
-0
software/apache-frontend/instance.cfg
software/apache-frontend/instance.cfg
+20
-1
software/apache-frontend/notfound.html
software/apache-frontend/notfound.html
+9
-0
No files found.
software/apache-frontend/000.conf.in
0 → 100644
View file @
f05d5828
<VirtualHost *:{{ https_port }}>
ServerName www.example.org
SSLEngine on
SSLProxyEngine on
SSLProtocol -ALL +SSLv3 +TLSv1
SSLHonorCipherOrder On
SSLCipherSuite RC4-SHA:HIGH:!ADH
# Rewrite part
ProxyVia On
ProxyPreserveHost On
ProxyTimeout 600
RewriteEngine On
ErrorDocument 404 /notfound.html
</VirtualHost>
<VirtualHost *:{{ http_port }}>
ServerName www.example.org
ErrorDocument 404 /notfound.html
</VirtualHost>
\ No newline at end of file
software/apache-frontend/apache-slave-list.cfg.in
View file @
f05d5828
...
@@ -15,6 +15,8 @@ context =
...
@@ -15,6 +15,8 @@ context =
{% set slave_section_title = 'dynamic-template-slave-instance-%s' % slave_reference -%}
{% set slave_section_title = 'dynamic-template-slave-instance-%s' % slave_reference -%}
{% set slave_parameter_dict = generic_instance_parameter_dict.copy() -%}
{% set slave_parameter_dict = generic_instance_parameter_dict.copy() -%}
{% do part_list.append(slave_section_title) -%}
{% do part_list.append(slave_section_title) -%}
{% do slave_parameter_dict.__setitem__('access_log', '/'.join([apache_log_directory, '%s_access_log' % slave_reference])) -%}
{% do slave_parameter_dict.__setitem__('error_log', '/'.join([apache_log_directory, '%s_error_log' % slave_reference])) -%}
[{{ slave_section_title }}]
[{{ slave_section_title }}]
< = jinja2-template-base
< = jinja2-template-base
template = {{ template_slave_configuration }}
template = {{ template_slave_configuration }}
...
...
software/apache-frontend/common.cfg
View file @
f05d5828
...
@@ -104,6 +104,17 @@ recipe = slapos.recipe.build:download
...
@@ -104,6 +104,17 @@ recipe = slapos.recipe.build:download
url = ${:_profile_base_location_}/apache-yakari.cfg.in
url = ${:_profile_base_location_}/apache-yakari.cfg.in
mode = 640
mode = 640
[template-not-found-html]
recipe = slapos.recipe.build:download
url = ${:_profile_base_location_}/notfound.html
filename = notfound.html
mode = 640
[template-default-virtualhost]
recipe = slapos.recipe.build:download
url = ${:_profile_base_location_}/000.conf.in
mode = 640
[template-empty]
[template-empty]
recipe = slapos.recipe.build:download
recipe = slapos.recipe.build:download
url = ${:_profile_base_location_}/empty.in
url = ${:_profile_base_location_}/empty.in
...
...
software/apache-frontend/instance.cfg
View file @
f05d5828
...
@@ -17,6 +17,8 @@ parts =
...
@@ -17,6 +17,8 @@ parts =
frontend-apache-graceful
frontend-apache-graceful
cached-apache-graceful
cached-apache-graceful
squid-reload
squid-reload
dynamic-template-default-vh
not-found-html
promise-apache-frontend-v4-https
promise-apache-frontend-v4-https
promise-apache-frontend-v4-http
promise-apache-frontend-v4-http
promise-apache-frontend-v6-https
promise-apache-frontend-v6-https
...
@@ -89,6 +91,15 @@ context =
...
@@ -89,6 +91,15 @@ context =
key slapparameter_dict instance-parameter:configuration
key slapparameter_dict instance-parameter:configuration
$${:extra-context}
$${:extra-context}
[dynamic-template-default-vh]
< = jinja2-template-base
template = ${template-default-virtualhost:target}
rendered = $${apache-directory:slave-configuration}/000.conf
extensions = jinja2.ext.do
extra-context =
key http_port instance-parameter:configuration.plain_http_port
key https_port instance-parameter:configuration.port
[dynamic-template-slave-list]
[dynamic-template-slave-list]
< = jinja2-template-base
< = jinja2-template-base
template = ${template-slave-list:target}
template = ${template-slave-list:target}
...
@@ -101,6 +112,7 @@ extra-context =
...
@@ -101,6 +112,7 @@ extra-context =
key slave_instance_list instance-parameter:slave-instance-list
key slave_instance_list instance-parameter:slave-instance-list
key rewrite_cached_configuration apache-configuration:cached-rewrite-file
key rewrite_cached_configuration apache-configuration:cached-rewrite-file
key custom_ssl_directory apache-directory:vh-ssl
key custom_ssl_directory apache-directory:vh-ssl
key apache_log_directory apache-directory:slave-log
raw empty_template ${template-empty:target}
raw empty_template ${template-empty:target}
raw cache_access http://$${instance-parameter:ipv4-random}:$${apache-configuration:cache-port}
raw cache_access http://$${instance-parameter:ipv4-random}:$${apache-configuration:cache-port}
raw template_slave_configuration ${template-slave-configuration:target}
raw template_slave_configuration ${template-slave-configuration:target}
...
@@ -203,6 +215,12 @@ wait-for-files =
...
@@ -203,6 +215,12 @@ wait-for-files =
$${ca-frontend:cert-file}
$${ca-frontend:cert-file}
$${ca-frontend:key-file}
$${ca-frontend:key-file}
[not-found-html]
recipe = slapos.cookbook:symbolic.link
target-directory = $${apache-directory:document-root}
link-binary =
${template-not-found-html:target}
[apache-directory]
[apache-directory]
recipe = slapos.cookbook:mkdirectory
recipe = slapos.cookbook:mkdirectory
document-root = $${directory:srv}/htdocs
document-root = $${directory:srv}/htdocs
...
@@ -210,6 +228,7 @@ slave-configuration = $${directory:srv}/apache-slave-conf.d/
...
@@ -210,6 +228,7 @@ slave-configuration = $${directory:srv}/apache-slave-conf.d/
cache = $${directory:var}/cache
cache = $${directory:var}/cache
mod-ssl = $${:cache}/httpd_mod_ssl
mod-ssl = $${:cache}/httpd_mod_ssl
vh-ssl = $${:slave-configuration}/ssl
vh-ssl = $${:slave-configuration}/ssl
slave-log = $${directory:log}/httpd
[apache-configuration]
[apache-configuration]
frontend-configuration = $${directory:etc}/apache_frontend.conf
frontend-configuration = $${directory:etc}/apache_frontend.conf
...
@@ -305,7 +324,7 @@ state-file = $${directory:srv}/logrotate.status
...
@@ -305,7 +324,7 @@ state-file = $${directory:srv}/logrotate.status
<= logrotate
<= logrotate
recipe = slapos.cookbook:logrotate.d
recipe = slapos.cookbook:logrotate.d
name = apache
name = apache
log = $${apache-configuration:error-log} $${apache-configuration:access-log}
log = $${apache-
directory:slave-log}/*_log $${apache-
configuration:error-log} $${apache-configuration:access-log}
frequency = daily
frequency = daily
rotatep-num = 30
rotatep-num = 30
post = ${buildout:bin-directory}/killpidfromfile $${apache-configuration:pid-file} SIGUSR1
post = ${buildout:bin-directory}/killpidfromfile $${apache-configuration:pid-file} SIGUSR1
...
...
software/apache-frontend/notfound.html
0 → 100644
View file @
f05d5828
<html>
<head>
<title>
Instance not found
</title>
</head>
<body>
<h1>
This instance has not been found.
</h1>
<p>
If this error persists, please check your instance URL and status on SlapOS Master.
</p>
</body>
</html>
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