From 1d43db174d252ba0bdddf82a13557b686028eabe Mon Sep 17 00:00:00 2001 From: br0tkasten Date: Mon, 27 Apr 2020 08:20:24 +0200 Subject: [PATCH] update template --- tasks/main.yml | 25 +++++++++++++++++++++++++ templates/lighttpd.conf.j2 | 24 ++++++++++++++++++++++++ 2 files changed, 49 insertions(+) create mode 100644 tasks/main.yml create mode 100644 templates/lighttpd.conf.j2 diff --git a/tasks/main.yml b/tasks/main.yml new file mode 100644 index 0000000..d3c24b8 --- /dev/null +++ b/tasks/main.yml @@ -0,0 +1,25 @@ +--- +- name: update apk cache + apk: update_cache=yes + +- name: install lighttpd + apk: name=lighttpd state=present + +- name: install perl-cgi + apk: name=perl-cgi state=present + +- name: deploy lighttpd.conf + template: + src: lighttpd.conf.j2 + dest: /etc/lighttpd/lighttpd.conf + owner: root + group: root + mode: 0644 + force: yes + +- name: enable lighttpd on boot + command: rc-update add lighttpd default + +- name: start lighttpd + command: rc-service lighttpd start + diff --git a/templates/lighttpd.conf.j2 b/templates/lighttpd.conf.j2 new file mode 100644 index 0000000..dbbd894 --- /dev/null +++ b/templates/lighttpd.conf.j2 @@ -0,0 +1,24 @@ +var.basedir = "/var/www/localhost" +var.logdir = "/var/log/lighttpd" +var.statedir = "/var/lib/lighttpd" + +server.pid-file = "/run/lighttpd.pid" +server.document-root = var.basedir + "/htdocs" +server.errorlog = var.logdir + "/error.log" + +server.username = "lighttpd" +server.groupname = "lighttpd" + +server.modules = ( + "mod_access", +) + +include "mime-types.conf" + +server.indexfiles = ("index.php", "index.html", + "index.htm", "default.htm") + +server.follow-symlink = "enable" +static-file.exclude-extensions = (".php", ".pl", ".cgi", ".fcgi") + +url.access-deny = ("~", ".inc")