# limitations under the License.
#
-include_recipe "apache"
+include_recipe "apache::ssl"
package "awstats"
package "libgeo-ipfree-perl"
mode 0o644
end
+ssl_certificate "stats.openstreetmap.org" do
+ domains ["stats.openstreetmap.org", "stats.osm.org"]
+ fallback_certificate "openstreetmap"
+ notifies :reload, "service[apache2]"
+end
+
apache_site "stats.openstreetmap.org" do
template "apache.erb"
directory "/srv/stats.openstreetmap.org"
# DO NOT EDIT - This file is being maintained by Chef
-<VirtualHost *:80>
+<VirtualHost *:443>
ServerName stats.openstreetmap.org
ServerAlias stats.osm.org
ServerAdmin webmaster@openstreetmap.org
CustomLog /var/log/apache2/stats.openstreetmap.org-access.log combined
ErrorLog /var/log/apache2/stats.openstreetmap.org-error.log
+ SSLEngine on
+ SSLCertificateFile /etc/ssl/certs/stats.openstreetmap.org.pem
+ SSLCertificateKeyFile /etc/ssl/private/stats.openstreetmap.org.key
+
DocumentRoot <%= @directory %>
Alias /awstats-icon/ /usr/share/awstats/icon/
ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
</VirtualHost>
+<VirtualHost *:80>
+ ServerName stats.openstreetmap.org
+ ServerAlias stats.osm.org
+ ServerAdmin webmaster@openstreetmap.org
+
+ CustomLog /var/log/apache2/stats.openstreetmap.org-access.log combined
+ ErrorLog /var/log/apache2/stats.openstreetmap.org-error.log
+
+ RedirectPermanent /.well-known/acme-challenge/ http://acme.openstreetmap.org/.well-known/acme-challenge/
+ RedirectPermanent / https://stats.openstreetmap.org/
+</VirtualHost>
+
<Directory /var/lib/awstats>
Options None
AllowOverride None