]> git.phdru.name Git - ansible.git/commitdiff
Feat(apache): Setup default host
authorOleg Broytman <phd@phdru.name>
Wed, 31 Jul 2019 16:14:47 +0000 (19:14 +0300)
committerOleg Broytman <phd@phdru.name>
Wed, 31 Jul 2019 16:33:58 +0000 (19:33 +0300)
playbooks/debian/roles/apache/files/_default_/favicon.ico [new file with mode: 0644]
playbooks/debian/roles/apache/files/_default_/index.html [new file with mode: 0644]
playbooks/debian/roles/apache/files/_default_/nothing.html [new file with mode: 0644]
playbooks/debian/roles/apache/files/_default_/robots.txt [new file with mode: 0644]
playbooks/debian/roles/apache/tasks/main.yml
playbooks/debian/roles/apache/templates/001-phd.conf

diff --git a/playbooks/debian/roles/apache/files/_default_/favicon.ico b/playbooks/debian/roles/apache/files/_default_/favicon.ico
new file mode 100644 (file)
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 (file)
index 0000000..2d1cc54
--- /dev/null
@@ -0,0 +1,13 @@
+<html>
+<head>
+   <title>Index</title>
+   <meta HTTP-Equiv="Refresh" content="0; URL=nothing.html">
+</head>
+<body>
+
+<p>
+   <a href="nothing.html">nothing</a>
+</p>
+
+</body>
+</html>
diff --git a/playbooks/debian/roles/apache/files/_default_/nothing.html b/playbooks/debian/roles/apache/files/_default_/nothing.html
new file mode 100644 (file)
index 0000000..f5c45e5
--- /dev/null
@@ -0,0 +1,10 @@
+<html>
+<head><title>Nothing here</title></head>
+<body>
+
+This page was intentionally left blank.
+
+<!-- There are no hidden messages on this page -->
+
+</body>
+</html>
diff --git a/playbooks/debian/roles/apache/files/_default_/robots.txt b/playbooks/debian/roles/apache/files/_default_/robots.txt
new file mode 100644 (file)
index 0000000..1b425ee
--- /dev/null
@@ -0,0 +1,2 @@
+User-agent: *
+Disallow: /cgi-bin/
index c05eb6f280fe6eb8d4cd2fb017349addea498664..ebe880cfb83628bfd429ea7fcee1627a1a4cddac 100644 (file)
         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
index a95b0397d7d1cb7003275cc485e4f72a9955491c..f4a91fb95b7f650b932565c320a53eb8f431fe66 100644 (file)
@@ -110,19 +110,19 @@ ErrorDocument 404 /~phd/Bookmarks/notfound.html
 
 <VirtualHost {{ ansible_facts.default_ipv4.address }}:80>
 ServerName unknown.invalid
-DocumentRoot /home/phd/Internet/WWW/htdocs/_default_/
+DocumentRoot /usr/local/apache2/_default_/
 ErrorDocument 404 /nothing.html
 
-<Directory /home/phd/Internet/WWW/htdocs/_default_/>
+<Directory /usr/local/apache2/_default_/>
 Require all granted
 </Directory>
 </VirtualHost>
 
 <VirtualHost _default_:*>
-DocumentRoot /home/phd/Internet/WWW/htdocs/_default_/
+DocumentRoot /usr/local/apache2/_default_/
 ErrorDocument 404 /nothing.html
 
-<Directory /home/phd/Internet/WWW/htdocs/_default_/>
+<Directory /usr/local/apache2/_default_/>
 Require all granted
 </Directory>
 </VirtualHost>