From 996b0ce4ee023816dde2f9736af1efb982a9ade9 Mon Sep 17 00:00:00 2001 From: Petar Cubela Date: Wed, 4 Dec 2024 11:14:09 +0100 Subject: [PATCH] added apache virtual host template file --- roles/lamp/defaults/main.yml | 1 + roles/lamp/templates/example.com.conf.j2 | 17 +++++++++++++++++ 2 files changed, 18 insertions(+) diff --git a/roles/lamp/defaults/main.yml b/roles/lamp/defaults/main.yml index 53ae23e..1641f00 100644 --- a/roles/lamp/defaults/main.yml +++ b/roles/lamp/defaults/main.yml @@ -2,3 +2,4 @@ site_conf: example.com.conf php_verison: "8.4" mysql_db_name: mysql mysql_db_user: mysql +web_root: "/var/www/{{ hostname }}" diff --git a/roles/lamp/templates/example.com.conf.j2 b/roles/lamp/templates/example.com.conf.j2 index e69de29..62957b2 100644 --- a/roles/lamp/templates/example.com.conf.j2 +++ b/roles/lamp/templates/example.com.conf.j2 @@ -0,0 +1,17 @@ + +ServerName {{ hostname }} +DirectoryIndex index.php index.html +DocumentRoot {{ web_root }} + + Options +FollowSymlinks -Indexes + AllowOverride All + Require all granted + + + Dav off + + + SetEnv HOME {{ web_root }} + SetEnv HTTP_HOME {{ web_root }} + +