Commit f8d27fcf authored by Matthieu FAURE's avatar Matthieu FAURE
Browse files

FEAT Configure a functional Apache config with PHP-FPM

parent 8f16b0c9
$my_hostname = 'nextcloud.example.org'
$my_docroot = '/var/www/html'
$fastcgi_socket = 'fcgi://127.0.0.1:9000'
$apache_hostname = 'nextcloud.example.org'
$apache_port = 80
$apache_docroot = '/var/www/html'
$apache_default_vhost = true
$php_version = '7.2'
$_my_custom_fragment = @(END)
<FilesMatch \.php$>
SetHandler "proxy:fcgi://127.0.0.1:9000"
</FilesMatch>
END
$_phpinfo = "${apache_docroot}/t.php"
class { 'apache':
default_vhost => false,
default_ssl_vhost => false,
}
class { 'apache::mod::proxy': }
class { 'apache::mod::proxy_fcgi': }
apache::vhost { $my_hostname:
docroot => $my_docroot,
port => 80,
apache::vhost { $apache_hostname:
docroot => $apache_docroot,
default_vhost => $apache_default_vhost,
port => $apache_port,
override => 'all',
default_vhost => true,
custom_fragment => "ProxyPassMatch ^/(.*\\.php)\$ ${fastcgi_socket}${my_docroot}\$1",
custom_fragment => $_my_custom_fragment,
}
class { 'php::globals':
php_version => '7.2',
include php
# class { 'php::globals':
# php_version => '7.2',
# }
# -> class { 'php':
# manage_repos => true,
# dev => true, # à tester
# extensions => {
# ctype => {},
# # curl => {},
# # dom => {},
# # gd => {},
# # iconv => {},
# # json => {},
# # libxml => {},
# # mbstring => {},
# # openssl => {},
# # posix => {},
# # session => {},
# # simplexml => {},
# # xmlreader => {},
# # xmlwriter => {},
# # zip => {},
# # zlib => {},
# },
# }
file { 't.php':
path => $_phpinfo,
ensure => file,
owner => 'www-data',
mode => '0644',
}
file_line { 'phpinfo':
path => $_phpinfo,
line => '<?php phpinfo(); ?>',
}
-> class { 'php':
# manage_repos => true,
dev => true, # à tester
extensions => {
ctype => {},
# curl => {},
# dom => {},
# gd => {},
# iconv => {},
# json => {},
# libxml => {},
# mbstring => {},
# openssl => {},
# posix => {},
# session => {},
# simplexml => {},
# xmlreader => {},
# xmlwriter => {},
# zip => {},
# zlib => {},
},
}
\ No newline at end of file
Supports Markdown
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