From: Oleg Broytman Date: Wed, 31 Jul 2019 16:14:47 +0000 (+0300) Subject: Feat(apache): Setup default host X-Git-Url: https://git.phdru.name/?a=commitdiff_plain;h=08d978858ba0f05bed0660126d5cccab33936b42;p=ansible.git Feat(apache): Setup default host --- diff --git a/playbooks/debian/roles/apache/files/_default_/favicon.ico b/playbooks/debian/roles/apache/files/_default_/favicon.ico new file mode 100644 index 0000000..eee667c Binary files /dev/null and b/playbooks/debian/roles/apache/files/_default_/favicon.ico differ diff --git a/playbooks/debian/roles/apache/files/_default_/index.html b/playbooks/debian/roles/apache/files/_default_/index.html new file mode 100644 index 0000000..2d1cc54 --- /dev/null +++ b/playbooks/debian/roles/apache/files/_default_/index.html @@ -0,0 +1,13 @@ + + + Index + + + + +

+ nothing +

+ + + diff --git a/playbooks/debian/roles/apache/files/_default_/nothing.html b/playbooks/debian/roles/apache/files/_default_/nothing.html new file mode 100644 index 0000000..f5c45e5 --- /dev/null +++ b/playbooks/debian/roles/apache/files/_default_/nothing.html @@ -0,0 +1,10 @@ + +Nothing here + + +This page was intentionally left blank. + + + + + diff --git a/playbooks/debian/roles/apache/files/_default_/robots.txt b/playbooks/debian/roles/apache/files/_default_/robots.txt new file mode 100644 index 0000000..1b425ee --- /dev/null +++ b/playbooks/debian/roles/apache/files/_default_/robots.txt @@ -0,0 +1,2 @@ +User-agent: * +Disallow: /cgi-bin/ diff --git a/playbooks/debian/roles/apache/tasks/main.yml b/playbooks/debian/roles/apache/tasks/main.yml index c05eb6f..ebe880c 100644 --- a/playbooks/debian/roles/apache/tasks/main.yml +++ b/playbooks/debian/roles/apache/tasks/main.yml @@ -35,6 +35,15 @@ mode: '0640' force: no + - name: Setup default host + become: true + copy: + src: _default_ + dest: /usr/local/apache2 + owner: root + group: www-data + mode: '0644' + - name: Enable config become: true command: a2enconf 001-phd diff --git a/playbooks/debian/roles/apache/templates/001-phd.conf b/playbooks/debian/roles/apache/templates/001-phd.conf index a95b039..f4a91fb 100644 --- a/playbooks/debian/roles/apache/templates/001-phd.conf +++ b/playbooks/debian/roles/apache/templates/001-phd.conf @@ -110,19 +110,19 @@ ErrorDocument 404 /~phd/Bookmarks/notfound.html ServerName unknown.invalid -DocumentRoot /home/phd/Internet/WWW/htdocs/_default_/ +DocumentRoot /usr/local/apache2/_default_/ ErrorDocument 404 /nothing.html - + Require all granted -DocumentRoot /home/phd/Internet/WWW/htdocs/_default_/ +DocumentRoot /usr/local/apache2/_default_/ ErrorDocument 404 /nothing.html - + Require all granted