From f6459e1141a956a24c56baa9ab35b74748490afc Mon Sep 17 00:00:00 2001 From: Ivan Grynenko Date: Wed, 6 Jul 2016 20:20:07 +1000 Subject: [PATCH] Trying 2 vhosts --- group_vars/all.yml | 28 +++++++++++++++++++++------- 1 file changed, 21 insertions(+), 7 deletions(-) diff --git a/group_vars/all.yml b/group_vars/all.yml index 4860e6e..a27a526 100644 --- a/group_vars/all.yml +++ b/group_vars/all.yml @@ -82,19 +82,33 @@ apache_mods_disabled: - php7 apache_vhosts_ssl: [] apache_vhosts: - - servername: "www.{{ item }}" - with_items: "{{ vhost_domains }}" - serveralias: "{{ item }}" - documentroot: "/var/www/html/{{ item }}" + - servername: "www.{{ server_hostname }}" + serveralias: "{{ server_hostname }}" + documentroot: "/var/www/html/{{ server_hostname }}" extra_parameters: | RewriteCond %{HTTP_HOST} !^www\. [NC] RewriteRule ^(.*)$ http://www.%{HTTP_HOST}%{REQUEST_URI} [R=301,L] - ErrorLog "/var/log/httpd/{{ item }}_error.log" + ErrorLog "/var/log/httpd/{{ server_hostname }}_error.log" ServerSignature Off ProxyTimeout 600 - ProxyPassMatch ^/(.*\.php(/.*)?)$ "fcgi://127.0.0.1:9000/var/www/html/{{ item }}/$1" + ProxyPassMatch ^/(.*\.php(/.*)?)$ "fcgi://127.0.0.1:9000/var/www/html/{{ server_hostname }}/$1" LogFormat "%a %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combinedlog - CustomLog "/var/log/httpd/{{ item }}_access.log" combinedlog + CustomLog "/var/log/httpd/{{ server_hostname }}_access.log" combinedlog + + ProxySet timeout=600 + + - servername: "www.2{{ server_hostname }}" + serveralias: "2{{ server_hostname }}" + documentroot: "/var/www/html/2{{ server_hostname }}" + extra_parameters: | + RewriteCond %{HTTP_HOST} !^www\. [NC] + RewriteRule ^(.*)$ http://www.%{HTTP_HOST}%{REQUEST_URI} [R=301,L] + ErrorLog "/var/log/httpd/2{{ server_hostname }}_error.log" + ServerSignature Off + ProxyTimeout 600 + ProxyPassMatch ^/(.*\.php(/.*)?)$ "fcgi://127.0.0.1:9000/var/www/html/2{{ server_hostname }}/$1" + LogFormat "%a %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combinedlog + CustomLog "/var/log/httpd/2{{ server_hostname }}_access.log" combinedlog ProxySet timeout=600