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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boris Kocherov
slapos
Commits
5b1a87c6
Commit
5b1a87c6
authored
Jun 04, 2012
by
Cédric de Saint Martin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Lamp stack: reorder parts to be easily readable
parent
62264f48
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
121 additions
and
103 deletions
+121
-103
stack/lamp/instance-apache-php.cfg
stack/lamp/instance-apache-php.cfg
+121
-103
No files found.
stack/lamp/instance-apache-php.cfg
View file @
5b1a87c6
...
@@ -16,64 +16,36 @@ eggs-directory = ${buildout:eggs-directory}
...
@@ -16,64 +16,36 @@ eggs-directory = ${buildout:eggs-directory}
develop-eggs-directory = ${buildout:develop-eggs-directory}
develop-eggs-directory = ${buildout:develop-eggs-directory}
offline = true
offline = true
[promise]
recipe = slapos.cookbook:check_port_listening
path = $${basedirectory:promises}/apache
hostname = $${apache-php:ip}
port = $${apache-php:port}
[frontend-promise]
recipe = slapos.cookbook:check_url_available
path = $${basedirectory:promises}/frontend
url = $${request-frontend:connection-site_url}
dash_path = ${dash:location}/bin/dash
[publish-connection-informations]
recipe = slapos.cookbook:publish
backend_url = $${apache-php:url}
url = $${request-frontend:connection-site_url}
[mariadb-urlparse]
recipe = slapos.cookbook:urlparse
url = $${request-mariadb:connection-url}
[apache-php]
recipe = slapos.cookbook:apachephp
source = ${application:location}
template = ${application-template:location}/${application-template:filename}
configuration = ${application-configuration:location}
htdocs = $${rootdirectory:srv}/www/
pid-file = $${basedirectory:run}/apache.pid
lock-file = $${basedirectory:run}/apache.lock
ip = $${slap-network-information:global-ipv6}
port = 8080
url = http://[$${:ip}]:$${:port}/
error-log = $${directory:httpd-log}/error.log
access-log = $${directory:httpd-log}/access.log
php-ini-dir = $${directory:php-ini-dir}
tmp-dir = $${directory:tmp-php}
httpd-conf = $${rootdirectory:etc}/apache.conf
wrapper = $${basedirectory:services}/apache
httpd-binary = ${apache:location}/bin/httpd
# Creation of all needed directories
[rootdirectory]
recipe = slapos.cookbook:mkdirectory
etc = $${buildout:directory}/etc/
var = $${buildout:directory}/var/
srv = $${buildout:directory}/srv/
bin = $${buildout:directory}/bin/
tmp = $${buildout:directory}/tmp/
mysql-username = $${mariadb-urlparse:username}
[basedirectory]
mysql-password = $${mariadb-urlparse:password}
recipe = slapos.cookbook:mkdirectory
mysql-database = $${mariadb-urlparse:path}
log = $${rootdirectory:var}/log/
mysql-host = $${stunnel:local-host}
services = $${rootdirectory:etc}/run/
mysql-port = $${stunnel:local-port}
run = $${rootdirectory:var}/run/
backup = $${rootdirectory:srv}/backup/
promises = $${rootdirectory:etc}/promise/
[certificate-authority]
[directory]
recipe = slapos.cookbook:certificate_authority
recipe = slapos.cookbook:mkdirectory
openssl-binary = ${openssl:location}/bin/openssl
ca-dir = $${rootdirectory:srv}/ssl/
ca-dir = $${directory:ca-dir}
httpd-log = $${basedirectory:log}/apache/
requests-directory = $${cadirectory:requests}
php-ini-dir = $${rootdirectory:etc}/php/
wrapper = $${basedirectory:services}/ca
tmp-php = $${rootdirectory:tmp}/php/
ca-private = $${cadirectory:private}
logrotate-entries = $${rootdirectory:etc}/logrotate.d/
ca-certs = $${cadirectory:certs}
logrotate-backup = $${basedirectory:backup}/logrotate/
ca-newcerts = $${cadirectory:newcerts}
stunnel-conf = $${rootdirectory:etc}/stunnel/
ca-crl = $${cadirectory:crl}
cronstamps = $${rootdirectory:etc}/cronstamps/
cron-entries = $${rootdirectory:etc}/cron.d/
crontabs = $${rootdirectory:etc}/crontabs/
[cadirectory]
[cadirectory]
recipe = slapos.cookbook:mkdirectory
recipe = slapos.cookbook:mkdirectory
...
@@ -83,14 +55,8 @@ certs = $${directory:ca-dir}/certs/
...
@@ -83,14 +55,8 @@ certs = $${directory:ca-dir}/certs/
newcerts = $${directory:ca-dir}/newcerts/
newcerts = $${directory:ca-dir}/newcerts/
crl = $${directory:ca-dir}/crl/
crl = $${directory:ca-dir}/crl/
[ca-stunnel]
<= certificate-authority
recipe = slapos.cookbook:certificate_authority.request
executable = $${stunnel:wrapper}
wrapper = $${basedirectory:services}/stunnel
key-file = $${stunnel:key-file}
cert-file = $${stunnel:cert-file}
# Deploy stunnel
[stunnel]
[stunnel]
recipe = slapos.cookbook:stunnel
recipe = slapos.cookbook:stunnel
client = true
client = true
...
@@ -107,6 +73,29 @@ pid-file = $${basedirectory:run}/stunnel.pid
...
@@ -107,6 +73,29 @@ pid-file = $${basedirectory:run}/stunnel.pid
wrapper = $${rootdirectory:bin}/raw_stunnel
wrapper = $${rootdirectory:bin}/raw_stunnel
post-rotate-script = $${rootdirectory:bin}/stunnel_post_rotate
post-rotate-script = $${rootdirectory:bin}/stunnel_post_rotate
# Certificate stuffs
[certificate-authority]
recipe = slapos.cookbook:certificate_authority
openssl-binary = ${openssl:location}/bin/openssl
ca-dir = $${directory:ca-dir}
requests-directory = $${cadirectory:requests}
wrapper = $${basedirectory:services}/ca
ca-private = $${cadirectory:private}
ca-certs = $${cadirectory:certs}
ca-newcerts = $${cadirectory:newcerts}
ca-crl = $${cadirectory:crl}
[ca-stunnel]
<= certificate-authority
recipe = slapos.cookbook:certificate_authority.request
executable = $${stunnel:wrapper}
wrapper = $${basedirectory:services}/stunnel
key-file = $${stunnel:key-file}
cert-file = $${stunnel:cert-file}
# Request MariaDB instance and parse its URL
[request-mariadb]
[request-mariadb]
<= slap-connection
<= slap-connection
recipe = slapos.cookbook:request
recipe = slapos.cookbook:request
...
@@ -115,17 +104,41 @@ software-url = $${slap-connection:software-release-url}
...
@@ -115,17 +104,41 @@ software-url = $${slap-connection:software-release-url}
software-type = mariadb
software-type = mariadb
return = url
return = url
[request-frontend]
[mariadb-urlparse]
<= slap-connection
recipe = slapos.cookbook:urlparse
recipe = slapos.cookbook:request
url = $${request-mariadb:connection-url}
name = Frontend
# XXX We have hardcoded SR URL here.
software-url = http://git.erp5.org/gitweb/slapos.git/blob_plain/HEAD:/software/apache-frontend/software.cfg
# Deploy Apache + PHP application
slave = true
[apache-php]
config = url
recipe = slapos.cookbook:apachephp
config-url = http://[$${apache-php:ip}]:$${apache-php:port}/
source = ${application:location}
return = site_url
template = ${application-template:location}/${application-template:filename}
configuration = ${application-configuration:location}
htdocs = $${rootdirectory:srv}/www/
pid-file = $${basedirectory:run}/apache.pid
lock-file = $${basedirectory:run}/apache.lock
ip = $${slap-network-information:global-ipv6}
port = 8080
url = http://[$${:ip}]:$${:port}/
error-log = $${directory:httpd-log}/error.log
access-log = $${directory:httpd-log}/access.log
php-ini-dir = $${directory:php-ini-dir}
tmp-dir = $${directory:tmp-php}
httpd-conf = $${rootdirectory:etc}/apache.conf
wrapper = $${basedirectory:services}/apache
httpd-binary = ${apache:location}/bin/httpd
mysql-username = $${mariadb-urlparse:username}
mysql-password = $${mariadb-urlparse:password}
mysql-database = $${mariadb-urlparse:path}
mysql-host = $${stunnel:local-host}
mysql-port = $${stunnel:local-port}
# Deploy logrotate, cron, configure it
[logrotate]
[logrotate]
recipe = slapos.cookbook:logrotate
recipe = slapos.cookbook:logrotate
# Binaries
# Binaries
...
@@ -161,6 +174,11 @@ notifempty = true
...
@@ -161,6 +174,11 @@ notifempty = true
create = true
create = true
post = $${stunnel:post-rotate-script}
post = $${stunnel:post-rotate-script}
[cron-simplelogger]
recipe = slapos.cookbook:simplelogger
wrapper = $${rootdirectory:bin}/cron_simplelogger
log = $${basedirectory:log}/crond.log
[cron]
[cron]
recipe = slapos.cookbook:cron
recipe = slapos.cookbook:cron
dcrond-binary = ${dcron:location}/sbin/crond
dcrond-binary = ${dcron:location}/sbin/crond
...
@@ -170,11 +188,6 @@ cronstamps = $${directory:cronstamps}
...
@@ -170,11 +188,6 @@ cronstamps = $${directory:cronstamps}
catcher = $${cron-simplelogger:wrapper}
catcher = $${cron-simplelogger:wrapper}
binary = $${basedirectory:services}/crond
binary = $${basedirectory:services}/crond
[cron-simplelogger]
recipe = slapos.cookbook:simplelogger
wrapper = $${rootdirectory:bin}/cron_simplelogger
log = $${basedirectory:log}/crond.log
[cron-entry-logrotate]
[cron-entry-logrotate]
<= cron
<= cron
recipe = slapos.cookbook:cron.d
recipe = slapos.cookbook:cron.d
...
@@ -182,31 +195,36 @@ name = logrotate
...
@@ -182,31 +195,36 @@ name = logrotate
frequency = 0 0 * * *
frequency = 0 0 * * *
command = $${logrotate:wrapper}
command = $${logrotate:wrapper}
[rootdirectory]
recipe = slapos.cookbook:mkdirectory
etc = $${buildout:directory}/etc/
var = $${buildout:directory}/var/
srv = $${buildout:directory}/srv/
bin = $${buildout:directory}/bin/
tmp = $${buildout:directory}/tmp/
[basedirectory]
# Request frontend
recipe = slapos.cookbook:mkdirectory
[request-frontend]
log = $${rootdirectory:var}/log/
<= slap-connection
services = $${rootdirectory:etc}/run/
recipe = slapos.cookbook:request
run = $${rootdirectory:var}/run/
name = Frontend
backup = $${rootdirectory:srv}/backup/
# XXX We have hardcoded SR URL here.
promises = $${rootdirectory:etc}/promise/
software-url = http://git.erp5.org/gitweb/slapos.git/blob_plain/HEAD:/software/apache-frontend/software.cfg
slave = true
config = url
config-url = http://[$${apache-php:ip}]:$${apache-php:port}/
return = site_url
[directory]
recipe = slapos.cookbook:mkdirectory
# Publish all instance parameters (url of instance)
ca-dir = $${rootdirectory:srv}/ssl/
[publish-connection-informations]
httpd-log = $${basedirectory:log}/apache/
recipe = slapos.cookbook:publish
php-ini-dir = $${rootdirectory:etc}/php/
backend_url = $${apache-php:url}
tmp-php = $${rootdirectory:tmp}/php/
url = $${request-frontend:connection-site_url}
logrotate-entries = $${rootdirectory:etc}/logrotate.d/
logrotate-backup = $${basedirectory:backup}/logrotate/
stunnel-conf = $${rootdirectory:etc}/stunnel/
# Deploy promises scripts
cronstamps = $${rootdirectory:etc}/cronstamps/
[promise]
cron-entries = $${rootdirectory:etc}/cron.d/
recipe = slapos.cookbook:check_port_listening
crontabs = $${rootdirectory:etc}/crontabs/
path = $${basedirectory:promises}/apache
hostname = $${apache-php:ip}
port = $${apache-php:port}
[frontend-promise]
recipe = slapos.cookbook:check_url_available
path = $${basedirectory:promises}/frontend
url = $${request-frontend:connection-site_url}
dash_path = ${dash:location}/bin/dash
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