Commit fcba8ac7 authored by HongzheWang's avatar HongzheWang

stack/lamp:add some default parameters/cfg files

parent 3474cec6
<VirtualHost *:{{ parameter_dict['port'] }}>
ServerAdmin admin@example.com
DocumentRoot {{ parameter_dict['document-root'] }}/matomo
SetEnvIf Origin "^http(s)?://(.+\.)?(app\.officejs\.com)$" ORIGIN_DOMAIN=$0
Header always set Access-Control-Allow-Origin "%{ORIGIN_DOMAIN}e" env=ORIGIN_DOMAIN
Header always set Access-Control-Allow-Credentials "true" env=ORIGIN_DOMAIN
Header always set Access-Control-Allow-Methods "PROPFIND, PROPPATCH, COPY, MOVE, DELETE, MKCOL, LOCK, UNLOCK, PUT, GETLIB, VERSION-CONTROL, CHECKIN, CHECKOUT, UNCHECKOUT, REPORT, UPDATE, CANCELUPLOAD, HEAD, OPTIONS, GET, POST" env=ORIGIN_DOMAIN
Header always set Access-Control-Allow-Headers "Overwrite, Destination, Content-Type, Depth, User-Agent, X-File-Size, X-Requested-With, If-Modified-Since, X-File-Name, Cache-Control, Authorization" env=ORIGIN_DOMAIN
Header always set Strict-Transport-Security "max-age=15552000; includeSubDomains"
<Directory {{ parameter_dict['document-root'] }}>
Options +FollowSymlinks
AllowOverride All
Require all granted
SetEnv HOME {{ parameter_dict['document-root'] }}
SetEnv HTTP_HOME {{ parameter_dict['document-root'] }}
Dav off
</Directory>
ErrorLog "{{ parameter_dict['log-dir'] }}/matomo-error.log"
CustomLog "{{ parameter_dict['log-dir'] }}/matomo-access.log" combined
</VirtualHost>
......@@ -107,6 +107,7 @@ context =
key db_name custom-application-deployment:db-name
key db_user custom-application-deployment:db-user
key db_password custom-application-deployment:db-password
key lamp_apache_httpd template-apache-httpd:target
[instance-apache-php]
<= template-download-base
......@@ -120,6 +121,10 @@ context =
[template-php.ini]
<= template-download-base
# download apache-httpd.conf.in
[template-apache-httpd]
<= template-download-base
[erp5]
# lamp stack reuses erp5 stack to have mariadb, but we don't need to checkout erp5 here.
recipe =
......
......@@ -14,15 +14,15 @@
# not need these here).
[instance]
filename = instance.cfg.in
md5sum = a5a630377bfb0421d6993c9c2c411a23
md5sum = b87556b0e5651bc8217c1bccbdd6b4d7
[instance-apache-php]
filename = instance-apache-php.cfg.in
md5sum = 0952ef9f6cb5e259ad5519d2975d2f37
md5sum = 8506f245087dfdc02561e8739a567bd6
[instance-lamp]
filename = instance-lamp.cfg.jinja2.in
md5sum = b3d68a13d7a7ffcac774f51f02a68359
md5sum = 79343539dff96f2d4592a4358d469201
[template-apache.conf]
filename = apache.conf.in
......@@ -30,4 +30,8 @@ md5sum = 04080510698732d84122b464fdb08c6a
[template-php.ini]
filename = php.ini.in
md5sum = 599358f7df4c1e0de86270f5992ef904
md5sum = 980f603c34fcb008ce73a9dde2dbceb3
[template-apache-httpd]
filename = apache-httpd.conf.in
md5sum = 9940e05d5e624a7884f4e6e062355798
......@@ -13,6 +13,7 @@ parts =
php.ini-conf
apache-php-service
publish-connection-information
lamp-apache-httpd
{{ parameter_dict['application-part-list'] }}
......@@ -133,10 +134,17 @@ cert-file = ${ca-directory:certs}/httpd.crt
key-file = ${ca-directory:certs}/httpd.key
apache-config-dir = ${directory:apache.d}
[lamp-apache-httpd]
recipe = slapos.recipe.template:jinja2
url = {{ lamp_apache_httpd }}
output = ${directory:apache.d}/lamp.conf
context =
section parameter_dict apache-php-configuration
[apache-php-conf]
recipe = slapos.recipe.template:jinja2
url = {{ parameter_dict['template-apache-conf'] }}
output = ${directory:etc}/apache.conf
output = ${directory:etc}/apache.confgraceful
context =
section parameter_dict apache-php-configuration
extensions = jinja2.ext.do
......@@ -188,6 +196,24 @@ backend-url = ${apache-php-configuration:url}
php-bin = {{ parameter_dict['apache-php-location'] }}/bin/php
php-ini = ${php.ini-conf:output}
#Defaut php.ini parameters
#They have been set in file php.ini.in
#I reserve them here just for an example
#You can reset them like this in your own software
php.memory_limit = 512M
php.date.timezone = Europe/Paris
php.upload_max_filesize = 10240M
php.post_max_size = 10240M
php.session.cookie_secure = True
php.max_execution_time = 1800
php.max_input_time = 3600
php.output_buffering = 'Off'
php.max_file_uploads = 100
[php-bin]
recipe = slapos.cookbook:wrapper
wrapper-path = ${directory:bin}/php
command-line = ${instance-parameter:php-bin} -c ${php.ini-conf:output}
#----------------
#--
......
......@@ -37,8 +37,7 @@ return =
{% do publish_dict.__setitem__('backend-url', '${request-apache:connection-backend-url}') -%}
{% do monitor_base_url_dict.__setitem__('apache', '${request-apache:connection-monitor-base-url}') -%}
{% do mariadb_dict.__setitem__('database-list', [{'name': db_name, 'user': db_user, 'password': db_password}]) -%}
{% do mariadb_dict.__setitem__('database-list', [{'name': db_name, 'user': db_user, 'password': db_password }]) -%}
{% do mariadb_dict.__setitem__('test-database-amount', 0) -%}
{% do mariadb_dict.__setitem__('tcpv4-port', 2099) -%}
{% do mariadb_dict.__setitem__('max-slowqueries-threshold', 1000) -%}
......
......@@ -72,6 +72,7 @@ filename = template-apache-php.cfg
extra-context =
key custom_application_template application-parameters:custom-application-template
section parameter_dict dynamic-template-apache-php-parameters
raw lamp_apache_httpd {{ lamp_apache_httpd }}
[dynamic-template-mariadb-parameters]
bash = {{ bash_location }}
......
......@@ -13,15 +13,15 @@ session.save_path = "{{ parameter_dict['tmp-dir'] }}"
session.auto_start = 0
date.timezone = {{ instance_dict.get('php.date.timezone', 'Europe/Paris') }}
file_uploads = On
upload_max_filesize = {{ instance_dict.get('php.upload_max_filesize', '8M') }}
post_max_size = {{ instance_dict.get('php.post_max_size', '8M') }}
upload_max_filesize = {{ instance_dict.get('php.upload_max_filesize', '10240M') }}
post_max_size = {{ instance_dict.get('php.post_max_size', '10240M') }}
magic_quotes_gpc=Off
memory_limit = {{ instance_dict.get('php.memory_limit', '128M') }}
memory_limit = {{ instance_dict.get('php.memory_limit', '512M') }}
session.cookie_secure = True
max_execution_time = {{ instance_dict.get('php.max_execution_time', 60) }}
max_input_time = {{ instance_dict.get('php.max_input_time', 60) }}
max_execution_time = {{ instance_dict.get('php.max_execution_time', 1800) }}
max_input_time = {{ instance_dict.get('php.max_input_time', 3600) }}
output_buffering = {{ instance_dict.get('php.output_buffering', 4096) }}
max_file_uploads = {{ instance_dict.get('php.max_file_uploads', 20) }}
max_file_uploads = {{ instance_dict.get('php.max_file_uploads', 100) }}
#extension_dir="./"#
sys_temp_dir="{{ parameter_dict['tmp-dir'] }}"
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment