Commit e11cb385 authored by Stefan Galinski's avatar Stefan Galinski 🎮
Browse files

[TASK] Switch from the apache cookbook to native shell code

parent ae51a017
......@@ -11,7 +11,5 @@ source_url 'https://gitlab.sgalinski.de/chef-cookbooks/webgrind'
recipe 'webgrind::default', 'Installs Webgrind'
recipe 'webgrind::webgrind', 'Webgrind'
depends :apache2
depends :database
depends :git
depends :hostsfile
\ No newline at end of file
......@@ -65,25 +65,19 @@ end
##########################
# ssl certificate needed (requires that typo3_site (or a kind of) was executed before this script)
web_app webgrind_hostname do
server_name webgrind_hostname
apache node['apache']
docroot node['webgrind']['install_path'] + '/'
end
template '/etc/apache2/sites-available/' + webgrind_hostname + '.conf' do
source 'web_app.conf.erb'
mode '0644'
variables(
:params => {
:install_path => node['webgrind']['install_path'],
:hostname => webgrind_hostname,
:base_hostname => base_hostname
}
:install_path => node['webgrind']['install_path'],
:hostname => webgrind_hostname,
:base_hostname => base_hostname
)
action :create
end
execute "a2ensite #{webgrind_hostname}.conf"
service 'apache2' do
action :restart
end
\ No newline at end of file
<VirtualHost _default_:443>
ServerAdmin webmaster@localhost
ServerName <%= @params[:hostname] %>
ServerName <%= @hostname %>
# Enable HTTP/2
Protocols h2 http/1.1
DocumentRoot <%= @params[:install_path] %>
<Directory <%= @params[:install_path] %>>
DocumentRoot <%= @install_path %>
<Directory <%= @install_path %>>
Options FollowSymLinks MultiViews
AllowOverride All
Require all granted
......@@ -19,8 +19,8 @@
#LogLevel info ssl:warn
LogLevel warn
ErrorLog /var/log/apache2/<%= @params[:hostname] %>-error.log
CustomLog /var/log/apache2/<%= @params[:hostname] %>-access.log combined
ErrorLog /var/log/apache2/<%= @hostname %>-error.log
CustomLog /var/log/apache2/<%= @hostname %>-access.log combined
# For most configuration files from conf-available/, which are
# enabled or disabled at a global level, it is possible to
......@@ -40,7 +40,7 @@
# SSLCertificateFile directive is needed.
#SSLCertificateFile /etc/ssl/certs/ssl-cert-snakeoil.pem
#SSLCertificateKeyFile /etc/ssl/private/ssl-cert-snakeoil.key
SSLCertificateFile /etc/apache2/ssl/<%= @params[:base_hostname] %>.crt
SSLCertificateFile /etc/apache2/ssl/<%= @base_hostname %>.crt
SSLCertificateKeyFile /etc/apache2/ssl/device.key
# HSTS (mod_headers is required) (15768000 seconds = 6 months)
......@@ -161,16 +161,16 @@ SSLStaplingCache shmcb:/var/run/ocsp(128000)
<VirtualHost *:80>
ServerAdmin webmaster@localhost
ServerName <%= @params[:hostname] %>
ServerName <%= @hostname %>
DocumentRoot <%= @params[:install_path] %>
<Directory <%= @params[:install_path] %>>
DocumentRoot <%= @install_path %>
<Directory <%= @install_path %>>
Options FollowSymLinks MultiViews
AllowOverride All
Require all granted
</Directory>
LogLevel warn
ErrorLog /var/log/apache2/<%= @params[:hostname] %>-error.log
CustomLog /var/log/apache2/<%= @params[:hostname] %>-access.log combined
ErrorLog /var/log/apache2/<%= @hostname %>-error.log
CustomLog /var/log/apache2/<%= @hostname %>-access.log combined
</VirtualHost>
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