Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
slapos-mynij-dev
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
Mynij
slapos-mynij-dev
Commits
723e9dbb
Commit
723e9dbb
authored
Apr 19, 2013
by
Kazuhiko Shiozaki
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' into erp5-component
parents
e4981ef8
1e343058
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
195 additions
and
97 deletions
+195
-97
CHANGES.txt
CHANGES.txt
+13
-0
setup.py
setup.py
+1
-1
slapos/recipe/apache_frontend/__init__.py
slapos/recipe/apache_frontend/__init__.py
+45
-58
slapos/recipe/apache_frontend/template/apache.conf.in
slapos/recipe/apache_frontend/template/apache.conf.in
+20
-6
software/apache-frontend/README.apache_frontend.txt
software/apache-frontend/README.apache_frontend.txt
+7
-0
software/apache-frontend/common.cfg
software/apache-frontend/common.cfg
+5
-3
software/apache-frontend/instance.cfg
software/apache-frontend/instance.cfg
+47
-6
software/apache-frontend/software.cfg
software/apache-frontend/software.cfg
+57
-23
No files found.
CHANGES.txt
View file @
723e9dbb
Changes
Changes
=======
=======
0.77.1 (2013-04-18)
-------------------
* Re-release of 0.77.0.
0.77.0 (2013-04-18)
-------------------
* Allow to pass extra parameters when creating simple wrapper. [Sebastien Robin]
* Apache frontend: Append all rewrite module options to http as well. [Cedric de Saint Martin]
* Apache frontend: Add https-only support. [Cedric de Saint Martin]
* Apache frontend: make logrotate work by using "generic" component. [Cedric de Saint Martin]
0.76.0 (2013-04-03)
0.76.0 (2013-04-03)
-------------------
-------------------
...
...
setup.py
View file @
723e9dbb
...
@@ -28,7 +28,7 @@ from setuptools import setup, find_packages
...
@@ -28,7 +28,7 @@ from setuptools import setup, find_packages
import
glob
import
glob
import
os
import
os
version
=
'0.7
6.1
.dev'
version
=
'0.7
7.2
.dev'
name
=
'slapos.cookbook'
name
=
'slapos.cookbook'
long_description
=
open
(
"README.txt"
).
read
()
+
"
\
n
"
+
\
long_description
=
open
(
"README.txt"
).
read
()
+
"
\
n
"
+
\
open
(
"CHANGES.txt"
).
read
()
+
"
\
n
"
open
(
"CHANGES.txt"
).
read
()
+
"
\
n
"
...
...
slapos/recipe/apache_frontend/__init__.py
View file @
723e9dbb
...
@@ -36,6 +36,7 @@ import ConfigParser
...
@@ -36,6 +36,7 @@ import ConfigParser
import
re
import
re
import
traceback
import
traceback
TRUE_VALUES
=
[
'y'
,
'yes'
,
'1'
,
'true'
]
class
Recipe
(
BaseSlapRecipe
):
class
Recipe
(
BaseSlapRecipe
):
...
@@ -65,13 +66,13 @@ class Recipe(BaseSlapRecipe):
...
@@ -65,13 +66,13 @@ class Recipe(BaseSlapRecipe):
# self.cron_d is a directory, where cron jobs can be registered
# self.cron_d is a directory, where cron jobs can be registered
self
.
cron_d
=
self
.
installCrond
()
self
.
cron_d
=
self
.
installCrond
()
self
.
logrotate_d
,
self
.
logrotate_backup
=
self
.
installLogrotate
()
self
.
killpidfromfile
=
zc
.
buildout
.
easy_install
.
scripts
(
self
.
killpidfromfile
=
zc
.
buildout
.
easy_install
.
scripts
(
[(
'killpidfromfile'
,
'slapos.
recipe.erp5
.killpidfromfile'
,
[(
'killpidfromfile'
,
'slapos.
toolbox
.killpidfromfile'
,
'killpidfromfile'
)],
self
.
ws
,
sys
.
executable
,
self
.
bin_directory
)[
0
]
'killpidfromfile'
)],
self
.
ws
,
sys
.
executable
,
self
.
bin_directory
)[
0
]
self
.
path_list
.
append
(
self
.
killpidfromfile
)
self
.
path_list
.
append
(
self
.
killpidfromfile
)
rewrite_rule_list
=
[]
rewrite_rule_list
=
[]
rewrite_rule_https_only_list
=
[]
rewrite_rule_zope_list
=
[]
rewrite_rule_zope_list
=
[]
rewrite_rule_zope_path_list
=
[]
rewrite_rule_zope_path_list
=
[]
slave_dict
=
{}
slave_dict
=
{}
...
@@ -88,20 +89,16 @@ class Recipe(BaseSlapRecipe):
...
@@ -88,20 +89,16 @@ class Recipe(BaseSlapRecipe):
# Sanitize inputs
# Sanitize inputs
backend_url
=
slave_instance
.
get
(
"url"
,
None
)
backend_url
=
slave_instance
.
get
(
"url"
,
None
)
reference
=
slave_instance
.
get
(
"slave_reference"
)
reference
=
slave_instance
.
get
(
"slave_reference"
)
enable_cache
=
slave_instance
.
get
(
'enable_cache'
,
''
).
lower
()
in
TRUE_VALUES
slave_type
=
slave_instance
.
get
(
'type'
,
''
).
lower
()
or
None
if
slave_instance
.
haskey
(
"enable_cache"
):
https_only
=
slave_instance
.
get
(
'https-only'
,
''
).
lower
()
in
TRUE_VALUES
enable_cache
=
slave_instance
.
get
(
"enable_cache"
,
""
).
upper
()
in
(
'1'
,
'TRUE'
)
else
:
enable_cache
=
False
if
slave_instance
.
haskey
(
"type"
):
slave_type
=
slave_instance
.
get
(
"type"
,
""
).
lower
()
else
:
slave_type
=
None
# Set scheme (http? https?)
# Set scheme (http? https?)
# Future work may allow to choose between http and https (or both?)
if
https_only
:
scheme
=
'http://'
scheme
=
'https://'
else
:
scheme
=
'http://'
self
.
logger
.
info
(
'Processing slave instance: %s'
%
reference
)
self
.
logger
.
info
(
'Processing slave instance: %s'
%
reference
)
...
@@ -143,6 +140,10 @@ class Recipe(BaseSlapRecipe):
...
@@ -143,6 +140,10 @@ class Recipe(BaseSlapRecipe):
rewrite_rule
=
"%s %s"
%
(
domain
,
backend_url
)
rewrite_rule
=
"%s %s"
%
(
domain
,
backend_url
)
# Finally, if successful, we add the rewrite rule to our list of rules
# Finally, if successful, we add the rewrite rule to our list of rules
# We have 4 RewriteMaps:
# - One for generic (non-zope) websites, accepting both HTTP and HTTPS
# - One for generic websites that only accept HTTPS
# - Two for Zope-based websites
if
rewrite_rule
:
if
rewrite_rule
:
# We check if we have a zope slave. It requires different rewrite
# We check if we have a zope slave. It requires different rewrite
# rule structure.
# rule structure.
...
@@ -154,7 +155,10 @@ class Recipe(BaseSlapRecipe):
...
@@ -154,7 +155,10 @@ class Recipe(BaseSlapRecipe):
rewrite_rule_path
=
"%s %s"
%
(
domain
,
slave_instance
.
get
(
'path'
,
''
))
rewrite_rule_path
=
"%s %s"
%
(
domain
,
slave_instance
.
get
(
'path'
,
''
))
rewrite_rule_zope_path_list
.
append
(
rewrite_rule_path
)
rewrite_rule_zope_path_list
.
append
(
rewrite_rule_path
)
else
:
else
:
rewrite_rule_list
.
append
(
rewrite_rule
)
if
https_only
:
rewrite_rule_https_only_list
.
append
(
rewrite_rule
)
else
:
rewrite_rule_list
.
append
(
rewrite_rule
)
# Certificate stuff
# Certificate stuff
valid_certificate_str
=
self
.
parameter_dict
.
get
(
"domain_ssl_ca_cert"
)
valid_certificate_str
=
self
.
parameter_dict
.
get
(
"domain_ssl_ca_cert"
)
...
@@ -186,6 +190,7 @@ class Recipe(BaseSlapRecipe):
...
@@ -186,6 +190,7 @@ class Recipe(BaseSlapRecipe):
plain_http_port
=
frontend_plain_http_port_number
,
plain_http_port
=
frontend_plain_http_port_number
,
name
=
frontend_domain_name
,
name
=
frontend_domain_name
,
rewrite_rule_list
=
rewrite_rule_list
,
rewrite_rule_list
=
rewrite_rule_list
,
rewrite_rule_https_only_list
=
rewrite_rule_https_only_list
,
rewrite_rule_zope_list
=
rewrite_rule_zope_list
,
rewrite_rule_zope_list
=
rewrite_rule_zope_list
,
rewrite_rule_zope_path_list
=
rewrite_rule_zope_path_list
,
rewrite_rule_zope_path_list
=
rewrite_rule_zope_path_list
,
key
=
key
,
certificate
=
certificate
)
key
=
key
,
certificate
=
certificate
)
...
@@ -279,29 +284,6 @@ class Recipe(BaseSlapRecipe):
...
@@ -279,29 +284,6 @@ class Recipe(BaseSlapRecipe):
return
"%s http://%s:%s"
%
\
return
"%s http://%s:%s"
%
\
(
domain
,
varnish_ip
,
base_varnish_port
)
(
domain
,
varnish_ip
,
base_varnish_port
)
def
installLogrotate
(
self
):
"""Installs logortate main configuration file and registers its to cron"""
logrotate_d
=
os
.
path
.
abspath
(
os
.
path
.
join
(
self
.
etc_directory
,
'logrotate.d'
))
self
.
_createDirectory
(
logrotate_d
)
logrotate_backup
=
self
.
createBackupDirectory
(
'logrotate'
)
logrotate_conf
=
self
.
createConfigurationFile
(
"logrotate.conf"
,
"include %s"
%
logrotate_d
)
logrotate_cron
=
os
.
path
.
join
(
self
.
cron_d
,
'logrotate'
)
state_file
=
os
.
path
.
join
(
self
.
data_root_directory
,
'logrotate.status'
)
open
(
logrotate_cron
,
'w'
).
write
(
'0 0 * * * %s -s %s %s'
%
(
self
.
options
[
'logrotate_binary'
],
state_file
,
logrotate_conf
))
self
.
path_list
.
extend
([
logrotate_d
,
logrotate_conf
,
logrotate_cron
])
return
logrotate_d
,
logrotate_backup
def
registerLogRotation
(
self
,
name
,
log_file_list
,
postrotate_script
):
"""Register new log rotation requirement"""
open
(
os
.
path
.
join
(
self
.
logrotate_d
,
name
),
'w'
).
write
(
self
.
substituteTemplate
(
self
.
getTemplateFilename
(
'logrotate_entry.in'
),
dict
(
file_list
=
' '
.
join
([
'"'
+
q
+
'"'
for
q
in
log_file_list
]),
postrotate
=
postrotate_script
,
olddir
=
self
.
logrotate_backup
)))
def
requestCertificate
(
self
,
name
):
def
requestCertificate
(
self
,
name
):
hash
=
hashlib
.
sha512
(
name
).
hexdigest
()
hash
=
hashlib
.
sha512
(
name
).
hexdigest
()
key
=
os
.
path
.
join
(
self
.
ca_private
,
hash
+
self
.
ca_key_ext
)
key
=
os
.
path
.
join
(
self
.
ca_private
,
hash
+
self
.
ca_key_ext
)
...
@@ -418,8 +400,7 @@ class Recipe(BaseSlapRecipe):
...
@@ -418,8 +400,7 @@ class Recipe(BaseSlapRecipe):
def
_getApacheConfigurationDict
(
self
,
name
,
ip_list
,
port
):
def
_getApacheConfigurationDict
(
self
,
name
,
ip_list
,
port
):
apache_conf
=
dict
()
apache_conf
=
dict
()
apache_conf
[
'server_name'
]
=
name
apache_conf
[
'server_name'
]
=
name
apache_conf
[
'pid_file'
]
=
os
.
path
.
join
(
self
.
run_directory
,
apache_conf
[
'pid_file'
]
=
self
.
options
[
'pid-file'
]
name
+
'.pid'
)
apache_conf
[
'lock_file'
]
=
os
.
path
.
join
(
self
.
run_directory
,
apache_conf
[
'lock_file'
]
=
os
.
path
.
join
(
self
.
run_directory
,
name
+
'.lock'
)
name
+
'.lock'
)
apache_conf
[
'document_root'
]
=
os
.
path
.
join
(
self
.
data_root_directory
,
apache_conf
[
'document_root'
]
=
os
.
path
.
join
(
self
.
data_root_directory
,
...
@@ -429,13 +410,8 @@ class Recipe(BaseSlapRecipe):
...
@@ -429,13 +410,8 @@ class Recipe(BaseSlapRecipe):
apache_conf
[
'ip_list'
]
=
ip_list
apache_conf
[
'ip_list'
]
=
ip_list
apache_conf
[
'port'
]
=
port
apache_conf
[
'port'
]
=
port
apache_conf
[
'server_admin'
]
=
'admin@'
apache_conf
[
'server_admin'
]
=
'admin@'
apache_conf
[
'error_log'
]
=
os
.
path
.
join
(
self
.
log_directory
,
apache_conf
[
'error_log'
]
=
self
.
options
[
'error-log'
]
'frontend-apache-error.log'
)
apache_conf
[
'access_log'
]
=
self
.
options
[
'access-log'
]
apache_conf
[
'access_log'
]
=
os
.
path
.
join
(
self
.
log_directory
,
'frontend-apache-access.log'
)
self
.
registerLogRotation
(
name
,
[
apache_conf
[
'error_log'
],
apache_conf
[
'access_log'
]],
self
.
killpidfromfile
+
' '
+
apache_conf
[
'pid_file'
]
+
' SIGUSR1'
)
return
apache_conf
return
apache_conf
def
installVarnishCache
(
self
,
name
,
ip
,
port
,
control_port
,
backend_host
,
def
installVarnishCache
(
self
,
name
,
ip
,
port
,
control_port
,
backend_host
,
...
@@ -517,10 +493,13 @@ class Recipe(BaseSlapRecipe):
...
@@ -517,10 +493,13 @@ class Recipe(BaseSlapRecipe):
port
=
4443
,
plain_http_port
=
8080
,
port
=
4443
,
plain_http_port
=
8080
,
rewrite_rule_list
=
None
,
rewrite_rule_list
=
None
,
rewrite_rule_zope_list
=
None
,
rewrite_rule_zope_list
=
None
,
rewrite_rule_https_only_list
=
None
,
rewrite_rule_zope_path_list
=
None
,
rewrite_rule_zope_path_list
=
None
,
access_control_string
=
None
):
access_control_string
=
None
):
if
rewrite_rule_list
is
None
:
if
rewrite_rule_list
is
None
:
rewrite_rule_list
=
[]
rewrite_rule_list
=
[]
if
rewrite_rule_https_only_list
is
None
:
rewrite_rule_zope_path_list
=
[]
if
rewrite_rule_zope_list
is
None
:
if
rewrite_rule_zope_list
is
None
:
rewrite_rule_zope_list
=
[]
rewrite_rule_zope_list
=
[]
if
rewrite_rule_zope_path_list
is
None
:
if
rewrite_rule_zope_path_list
is
None
:
...
@@ -571,15 +550,22 @@ class Recipe(BaseSlapRecipe):
...
@@ -571,15 +550,22 @@ class Recipe(BaseSlapRecipe):
self
.
path_list
.
append
(
backup_cron
)
self
.
path_list
.
append
(
backup_cron
)
# Create configuration file and rewritemaps
# Create configuration file and rewritemaps
apachemap_name
=
"apachemap.txt"
apachemap_path
=
self
.
createConfigurationFile
(
apachemapzope_name
=
"apachemapzope.txt"
"apache_rewritemap_generic.txt"
,
apachemapzopepath_name
=
"apachemapzopepath.txt"
"
\
n
"
.
join
(
rewrite_rule_list
)
)
self
.
createConfigurationFile
(
apachemap_name
,
"
\
n
"
.
join
(
rewrite_rule_list
))
apachemap_httpsonly_path
=
self
.
createConfigurationFile
(
self
.
createConfigurationFile
(
apachemapzope_name
,
"apache_rewritemap_httpsonly.txt"
,
"
\
n
"
.
join
(
rewrite_rule_zope_list
))
"
\
n
"
.
join
(
rewrite_rule_https_only_list
)
self
.
createConfigurationFile
(
apachemapzopepath_name
,
)
"
\
n
"
.
join
(
rewrite_rule_zope_path_list
))
apachemap_zope_path
=
self
.
createConfigurationFile
(
"apache_rewritemap_zope.txt"
,
"
\
n
"
.
join
(
rewrite_rule_zope_list
)
)
apachemap_zopepath_path
=
self
.
createConfigurationFile
(
"apache_rewritemap_zopepath.txt"
,
"
\
n
"
.
join
(
rewrite_rule_zope_path_list
)
)
apache_conf
=
self
.
_getApacheConfigurationDict
(
name
,
ip_list
,
port
)
apache_conf
=
self
.
_getApacheConfigurationDict
(
name
,
ip_list
,
port
)
apache_conf
[
'ssl_snippet'
]
=
self
.
substituteTemplate
(
apache_conf
[
'ssl_snippet'
]
=
self
.
substituteTemplate
(
...
@@ -606,9 +592,10 @@ class Recipe(BaseSlapRecipe):
...
@@ -606,9 +592,10 @@ class Recipe(BaseSlapRecipe):
apache_conf
.
update
(
**
dict
(
apache_conf
.
update
(
**
dict
(
path_enable
=
path
,
path_enable
=
path
,
apachemap_path
=
os
.
path
.
join
(
self
.
etc_directory
,
apachemap_name
),
apachemap_path
=
apachemap_path
,
apachemapzope_path
=
os
.
path
.
join
(
self
.
etc_directory
,
apachemapzope_name
),
apachemap_httpsonly_path
=
apachemap_httpsonly_path
,
apachemapzopepath_path
=
os
.
path
.
join
(
self
.
etc_directory
,
apachemapzopepath_name
),
apachemapzope_path
=
apachemap_zope_path
,
apachemapzopepath_path
=
apachemap_zopepath_path
,
apache_domain
=
name
,
apache_domain
=
name
,
https_port
=
port
,
https_port
=
port
,
plain_http_port
=
plain_http_port
,
plain_http_port
=
plain_http_port
,
...
...
slapos/recipe/apache_frontend/template/apache.conf.in
View file @
723e9dbb
...
@@ -60,8 +60,8 @@ BrowserMatch "RealPlayer 4\.0" force-response-1.0
...
@@ -60,8 +60,8 @@ BrowserMatch "RealPlayer 4\.0" force-response-1.0
BrowserMatch "Java/1\.0" force-response-1.0
BrowserMatch "Java/1\.0" force-response-1.0
BrowserMatch "JDK/1\.0" force-response-1.0
BrowserMatch "JDK/1\.0" force-response-1.0
# The following directive disables redirects on non-GET requests for
# The following directive disables redirects on non-GET requests for
# a directory that does not include the trailing slash. This fixes a
# a directory that does not include the trailing slash. This fixes a
# problem with Microsoft WebFolders which does not appropriately handle
# problem with Microsoft WebFolders which does not appropriately handle
# redirects for folders with DAV methods.
# redirects for folders with DAV methods.
# Same deal with Apple's DAV filesystem and Gnome VFS support for DAV.
# Same deal with Apple's DAV filesystem and Gnome VFS support for DAV.
BrowserMatch "Microsoft Data Access Internet Publishing Provider" redirect-carefully
BrowserMatch "Microsoft Data Access Internet Publishing Provider" redirect-carefully
...
@@ -84,7 +84,7 @@ MCacheRemovalAlgorithm LRU
...
@@ -84,7 +84,7 @@ MCacheRemovalAlgorithm LRU
AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css text/javascript application/x-javascript application/javascript
AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css text/javascript application/x-javascript application/javascript
BrowserMatch ^Mozilla/4 gzip-only-text/html
BrowserMatch ^Mozilla/4 gzip-only-text/html
BrowserMatch ^Mozilla/4\.0[678] no-gzip
BrowserMatch ^Mozilla/4\.0[678] no-gzip
BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
# Make sure proxies don't deliver the wrong content
# Make sure proxies don't deliver the wrong content
Header append Vary User-Agent
Header append Vary User-Agent
...
@@ -104,10 +104,12 @@ Header append Vary User-Agent
...
@@ -104,10 +104,12 @@ Header append Vary User-Agent
# or changed when slapgrid is ran. It can be freely customized by node admin.
# or changed when slapgrid is ran. It can be freely customized by node admin.
Include %(custom_apache_virtualhost_conf)s
Include %(custom_apache_virtualhost_conf)s
# Define the two RewriteMaps (key -> value store): one for Zope, one generic
# Define the 3 RewriteMaps (key -> value store): one for Zope, one generic,
# one generic https only,
# containing: rewritten URL -> original URL (a.k.a VirtualHostBase in Zope)
# containing: rewritten URL -> original URL (a.k.a VirtualHostBase in Zope)
RewriteMap apachemapzope txt:%(apachemapzope_path)s
RewriteMap apachemapzope txt:%(apachemapzope_path)s
RewriteMap apachemapgeneric txt:%(apachemap_path)s
RewriteMap apachemapgeneric txt:%(apachemap_path)s
RewriteMap apachemapgenerichttpsonly txt:%(apachemap_httpsonly_path)s
# Define another RewriteMap for Zope, containing:
# Define another RewriteMap for Zope, containing:
# rewritten URL -> VirtualHostRoot
# rewritten URL -> VirtualHostRoot
...
@@ -123,21 +125,32 @@ Header append Vary User-Agent
...
@@ -123,21 +125,32 @@ Header append Vary User-Agent
RewriteCond ${apachemapgeneric:%%{SERVER_NAME}} >""
RewriteCond ${apachemapgeneric:%%{SERVER_NAME}} >""
# We suppose that Apache listens to 443 (even indirectly thanks to things like iptables)
# We suppose that Apache listens to 443 (even indirectly thanks to things like iptables)
RewriteRule ^/(.*)$ ${apachemapgeneric:%%{SERVER_NAME}}/$1 [L,P]
RewriteRule ^/(.*)$ ${apachemapgeneric:%%{SERVER_NAME}}/$1 [L,P]
# Same for https only server
RewriteCond ${apachemapgenerichttpsonly:%%{SERVER_NAME}} >""
# We suppose that Apache listens to 443 (even indirectly thanks to things like iptables)
RewriteRule ^/(.*)$ ${apachemapgenerichttpsonly:%%{SERVER_NAME}}/$1 [L,P]
# If nothing exist : put a nice error
# If nothing exist : put a nice error
ErrorDocument 404 /notfound.html
ErrorDocument 404 /notfound.html
</VirtualHost>
</VirtualHost>
# Only accept generic (i.e not Zope) backends on http
<VirtualHost *:%(plain_http_port)s>
<VirtualHost *:%(plain_http_port)s>
RewriteEngine On
SSLProxyEngine on
SSLProxyEngine on
# Rewrite part
ProxyVia On
ProxyPreserveHost On
ProxyPreserveHost On
ProxyTimeout 600
RewriteEngine On
# Remove "Secure" from cookies, as backend may be https
Header edit Set-Cookie "(?i)^(.+);secure$" "$1"
# Include configuration file not operated by slapos. This file won't be erased
# 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.
# or changed when slapgrid is ran. It can be freely customized by node admin.
Include %(custom_apache_virtualhost_conf)s
Include %(custom_apache_virtualhost_conf)s
# We accept generic (i.e not lamp) backends on http
RewriteMap apachemapgeneric txt:%(apachemap_path)s
RewriteMap apachemapgeneric txt:%(apachemap_path)s
RewriteCond ${apachemapgeneric:%%{SERVER_NAME}} >""
RewriteCond ${apachemapgeneric:%%{SERVER_NAME}} >""
RewriteRule ^/(.*)$ ${apachemapgeneric:%%{SERVER_NAME}}/$1 [L,P]
RewriteRule ^/(.*)$ ${apachemapgeneric:%%{SERVER_NAME}}/$1 [L,P]
...
@@ -148,6 +161,7 @@ Header append Vary User-Agent
...
@@ -148,6 +161,7 @@ Header append Vary User-Agent
RewriteRule ^/(.*)$ https://%%{SERVER_NAME}%%{REQUEST_URI}
RewriteRule ^/(.*)$ https://%%{SERVER_NAME}%%{REQUEST_URI}
</VirtualHost>
</VirtualHost>
# Include configuration file not operated by slapos. This file won't be erased
# 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.
# or changed when slapgrid is ran. It can be freely customized by node admin.
Include %(custom_apache_conf)s
Include %(custom_apache_conf)s
software/apache-frontend/README.apache_frontend.txt
View file @
723e9dbb
...
@@ -118,6 +118,13 @@ Domain name to use as frontend. The frontend will be accessible from this domain
...
@@ -118,6 +118,13 @@ Domain name to use as frontend. The frontend will be accessible from this domain
[instancereference].[masterdomain].
[instancereference].[masterdomain].
Example: www.mycustomdomain.com
Example: www.mycustomdomain.com
https-only
~~~~~~~~~~
Specify if website should be accessed using https only. If so, the frontend
will redirect the user to https if accessed from http.
Possible values: "true", "false".
This is an optional parameter. Defaults to false.
path
path
~~~~
~~~~
Only used if type is "zope".
Only used if type is "zope".
...
...
software/apache-frontend/common.cfg
View file @
723e9dbb
...
@@ -3,6 +3,7 @@ extends =
...
@@ -3,6 +3,7 @@ extends =
../../component/binutils/buildout.cfg
../../component/binutils/buildout.cfg
../../component/lxml-python/buildout.cfg
../../component/lxml-python/buildout.cfg
../../component/apache/buildout.cfg
../../component/apache/buildout.cfg
../../component/gzip/buildout.cfg
../../component/stunnel/buildout.cfg
../../component/stunnel/buildout.cfg
../../component/varnish/buildout.cfg
../../component/varnish/buildout.cfg
../../component/dcron/buildout.cfg
../../component/dcron/buildout.cfg
...
@@ -38,14 +39,15 @@ recipe = zc.recipe.egg
...
@@ -38,14 +39,15 @@ recipe = zc.recipe.egg
eggs = ${instance-recipe:egg}
eggs = ${instance-recipe:egg}
[eggs]
[eggs]
recipe = z
c.recipe.egg
recipe = z
3c.recipe.scripts
eggs =
eggs =
${lxml-python:egg}
${lxml-python:egg}
slapos.toolbox
[template]
[template]
# Default template for apache instance.
# Default template for apache instance.
recipe = slapos.recipe.template
recipe = slapos.recipe.template
url = ${:_profile_base_location_}/instance.cfg
url = ${:_profile_base_location_}/instance.cfg
md5sum =
fea902a2b9dbf8c80ff201bcf73f9396
md5sum =
e7b9f57da7eb1450fc15789e239388d4
output = ${buildout:directory}/template.cfg
output = ${buildout:directory}/template.cfg
mode = 0644
mode = 0644
\ No newline at end of file
software/apache-frontend/instance.cfg
View file @
723e9dbb
[buildout]
[buildout]
parts =
parts =
directory
directory
instanc
e
apach
e
configtest
configtest
logrotate
logrotate-entry-apache
eggs-directory = ${buildout:eggs-directory}
eggs-directory = ${buildout:eggs-directory}
develop-eggs-directory = ${buildout:develop-eggs-directory}
develop-eggs-directory = ${buildout:develop-eggs-directory}
...
@@ -10,15 +12,23 @@ develop-eggs-directory = ${buildout:develop-eggs-directory}
...
@@ -10,15 +12,23 @@ develop-eggs-directory = ${buildout:develop-eggs-directory}
# Create all needed directories
# Create all needed directories
[directory]
[directory]
recipe = slapos.cookbook:mkdirectory
recipe = slapos.cookbook:mkdirectory
bin = $${buildout:directory}/bin/
etc = $${buildout:directory}/etc/
etc = $${buildout:directory}/etc/
var = $${buildout:directory}/var/
srv = $${buildout:directory}/srv/
srv = $${buildout:directory}/srv/
bin = $${buildout:directory}/bin/
var = $${buildout:directory}/var/
backup = $${:srv}/backup
log = $${:var}/log
run = $${:var}/run
service = $${:etc}/service
service = $${:etc}/service
logrotate-backup = $${:backup}/logrotate
logrotate-entries = $${:etc}/logrotate.d
# Deploy Apache (old way, with monolithic recipe)
# Deploy Apache (old way, with monolithic recipe)
[
instanc
e]
[
apach
e]
recipe = ${instance-recipe:egg}:${instance-recipe:module}
recipe = ${instance-recipe:egg}:${instance-recipe:module}
httpd_home = ${apache-2.2:location}
httpd_home = ${apache-2.2:location}
httpd_binary = ${apache-2.2:location}/bin/httpd
httpd_binary = ${apache-2.2:location}/bin/httpd
...
@@ -31,9 +41,40 @@ rdiff_backup_binary = ${buildout:bin-directory}/rdiff-backup
...
@@ -31,9 +41,40 @@ rdiff_backup_binary = ${buildout:bin-directory}/rdiff-backup
gcc_binary = gcc
gcc_binary = gcc
binutils_directory = ${binutils:location}/bin/
binutils_directory = ${binutils:location}/bin/
access-log = $${directory:log}/frontend-apache-access.log
error-log = $${directory:log}/frontend-apache-error.log
pid-file = $${directory:run}/httpd.pid
# Create wrapper for "apachectl conftest" in bin
# Create wrapper for "apachectl conftest" in bin
[configtest]
[configtest]
recipe = slapos.cookbook:wrapper
recipe = slapos.cookbook:wrapper
command-line = $${instance:httpd_binary} -f $${directory:etc}/apache_frontend.conf -t
command-line = $${apache:httpd_binary} -f $${directory:etc}/apache_frontend.conf -t
output = $${directory:bin}/apache-configtest
wrapper-path = $${directory:bin}/apache-configtest
# Deploy Logrotate
[logrotate]
recipe = slapos.cookbook:logrotate
# Binaries
logrotate-binary = ${logrotate:location}/usr/sbin/logrotate
gzip-binary = ${gzip:location}/bin/gzip
gunzip-binary = ${gzip:location}/bin/gunzip
# Directories
wrapper = $${directory:bin}/logrotate
conf = $${directory:etc}/logrotate.conf
logrotate-entries = $${directory:logrotate-entries}
backup = $${directory:logrotate-backup}
state-file = $${directory:srv}/logrotate.status
[logrotate-entry-apache]
<= logrotate
recipe = slapos.cookbook:logrotate.d
name = apache
log = $${apache:error-log} $${apache:access-log}
frequency = daily
rotate-num = 30
post = ${buildout:bin-directory}/killpidfromfile $${apache:pid-file} SIGUSR1
sharedscripts = true
notifempty = true
create = true
software/apache-frontend/software.cfg
View file @
723e9dbb
...
@@ -4,67 +4,101 @@ extends = common.cfg
...
@@ -4,67 +4,101 @@ extends = common.cfg
[versions]
[versions]
Jinja2 = 2.6
Jinja2 = 2.6
Werkzeug = 0.8.3
Werkzeug = 0.8.3
apache-libcloud = 0.12.3
async = 0.6.1
buildout-versions = 1.7
buildout-versions = 1.7
hexagonit.recipe.cmmi = 1.6
gitdb = 0.5.4
hexagonit.recipe.cmmi = 2.0
meld3 = 0.6.10
meld3 = 0.6.10
pycrypto = 2.6
rdiff-backup = 1.0.5
rdiff-backup = 1.0.5
slapos.
cookbook = 0.71.1
slapos.
recipe.build = 0.11.6
slapos.recipe.
build = 0.11.5
slapos.recipe.
cmmi = 0.1
slapos.recipe.template = 2.4.2
slapos.recipe.template = 2.4.2
slapos.toolbox = 0.34.0
smmap = 0.8.2
z3c.recipe.scripts = 1.0.1
# Required by:
# Required by:
# slapos.core==0.33.1
# slapos.core==0.35.1
# slapos.toolbox==0.34.0
Flask = 0.9
Flask = 0.9
# Required by:
# Required by:
#
hexagonit.recipe.cmmi==1.6
#
slapos.toolbox==0.34.0
hexagonit.recipe.download = 1.6nxd002
GitPython = 0.3.2.RC1
# Required by:
# Required by:
# slapos.cookbook==0.71.1
# slapos.toolbox==0.34.0
atomize = 0.1.1
# Required by:
# slapos.toolbox==0.34.0
feedparser = 5.1.3
# Required by:
# slapos.cookbook==0.77.1
inotifyx = 0.2.0
inotifyx = 0.2.0
# Required by:
# Required by:
# slapos.cookbook==0.7
1
.1
# slapos.cookbook==0.7
7
.1
# slapos.core==0.3
3
.1
# slapos.core==0.3
5
.1
# xml-marshaller==0.9.7
# xml-marshaller==0.9.7
lxml = 3.
0
.2
lxml = 3.
1
.2
# Required by:
# Required by:
# slapos.cookbook==0.7
1
.1
# slapos.cookbook==0.7
7
.1
netaddr = 0.7.10
netaddr = 0.7.10
# Required by:
# Required by:
# slapos.core==0.3
3
.1
# slapos.core==0.3
5
.1
netifaces = 0.8
netifaces = 0.8
# Required by:
# Required by:
# slapos.
cookbook==0.71.1
# slapos.
toolbox==0.34.0
p
ytz = 2012j
p
aramiko = 1.10.1
# Required by:
# Required by:
# slapos.cookbook==0.71.1
# slapos.toolbox==0.34.0
# slapos.core==0.33.1
psutil = 0.7.0
# Required by:
# slapos.core==0.35.1
pyflakes = 0.7
# Required by:
# slapos.cookbook==0.77.1
pytz = 2013b
# Required by:
# slapos.cookbook==0.77.1
# slapos.core==0.35.1
# slapos.toolbox==0.34.0
# zc.buildout==1.6.0-dev-SlapOS-010
# zc.buildout==1.6.0-dev-SlapOS-010
# zc.recipe.egg==1.3.2
# zc.recipe.egg==1.3.2
setuptools = 0.6c12dev-r88846
setuptools = 0.6c12dev-r88846
# Required by:
# Required by:
# slapos.cookbook==0.71.1
# slapos.cookbook==0.77.1
slapos.core = 0.33.1
# slapos.toolbox==0.34.0
slapos.core = 0.35.1
# Required by:
# Required by:
# slapos.core==0.3
3
.1
# slapos.core==0.3
5
.1
supervisor = 3.0b1
supervisor = 3.0b1
# Required by:
# Required by:
# slapos.co
okbook==0.71
.1
# slapos.co
re==0.35
.1
xml-marshaller = 0.9.7
unittest2 = 0.5.1
# Required by:
# Required by:
# slapos.core==0.33.1
# slapos.cookbook==0.77.1
zope.interface = 4.0.3
# slapos.toolbox==0.34.0
xml-marshaller = 0.9.7
# Required by:
# slapos.core==0.35.1
zope.interface = 4.0.5
[networkcache]
[networkcache]
# signature certificates of the following uploaders.
# signature certificates of the following uploaders.
...
...
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