Browse Source

Make possible to bind IP/Port for PHPMyAdmin/PHPPgAdmin/PHPsysCheck virtual hosts

Emmanuel Bouthenot 9 years ago
parent
commit
dac32833c3

+ 6 - 0
roles/webserver/defaults/main.yml

@@ -25,6 +25,8 @@ with_php: False
 with_php_mysql_legacy: False
 
 phpsyscheck_vhostname: 'sys.localhost'
+phpsyscheck_vhostip: Null
+phpsyscheck_vhostport: 80
 
 php_config:
   date.timezone: 'Europe/Paris'
@@ -43,10 +45,14 @@ with_php_apc: False
 
 with_phpmyadmin: False
 phpmyadmin_vhostname: 'pma.localhost'
+phpmyadmin_vhostip: Null
+phpmyadmin_vhostport: 80
 http_auth_phpmyadmin: False
 
 with_phppgadmin: False
 phppgadmin_vhostname: 'pga.localhost'
+phppgadmin_vhostip: Null
+phppgadmin_vhostport: 80
 http_auth_phppgadmin: False
 
 http_auth_admin_password: Null

+ 1 - 1
roles/webserver/templates/apache2/pga_vhost.j2

@@ -4,7 +4,7 @@
 {% endif -%}
 # Apache vhost for phppgadmin
 
-<VirtualHost *:80>
+<VirtualHost {%if phppgadmin_vhostip %}{{ phppgadmin_vhostip }}{% else %}*{% endif %}:{{ phppgadmin_vhostport }}>
     ServerName {{ phppgadmin_vhostname }}
 
     DocumentRoot /usr/share/phppgadmin

+ 1 - 1
roles/webserver/templates/apache2/pma_vhost.j2

@@ -4,7 +4,7 @@
 {% endif -%}
 # Apache vhost for phpmyadmin
 
-<VirtualHost *:80>
+<VirtualHost {%if phpmyadmin_vhostip %}{{ phpmyadmin_vhostip }}{% else %}*{% endif %}:{{ phpmyadmin_vhostport }}>
     ServerName {{ phpmyadmin_vhostname }}
 
     DocumentRoot /usr/share/phpmyadmin

+ 1 - 1
roles/webserver/templates/apache2/sys_vhost.j2

@@ -4,7 +4,7 @@
 {% endif -%}
 # Apache vhost for PHP system checks
 
-<VirtualHost *:80>
+<VirtualHost {%if phpsyscheck_vhostip %}{{ phpsyscheck_vhostip }}{% else %}*{% endif %}:{{ phpsyscheck_vhostport }}>
     ServerName {{ phpsyscheck_vhostname }}
 
     DocumentRoot /etc/php5/syscheck.d

+ 2 - 0
roles/webserver/templates/nginx/pga_vhost.j2

@@ -5,6 +5,8 @@
 # Nginx vhost for phppgadmin
 
 server {
+    listen {%if phppgadmin_vhostip %}{{ phppgadmin_vhostip }}:{% endif %}{{ phppgadmin_vhostport }};
+
     server_name {{ phppgadmin_vhostname }};
 
     access_log  /var/log/nginx/pma.access.log;

+ 2 - 0
roles/webserver/templates/nginx/pma_vhost.j2

@@ -5,6 +5,8 @@
 # Nginx vhost for phpmyadmin
 
 server {
+    listen {%if phpmyadmin_vhostip %}{{ phpmyadmin_vhostip }}:{% endif %}{{ phpmyadmin_vhostport }};
+
     server_name {{ phpmyadmin_vhostname }};
 
     access_log  /var/log/nginx/pma.access.log;

+ 2 - 0
roles/webserver/templates/nginx/sys_vhost.j2

@@ -5,6 +5,8 @@
 # Nginx vhost for PHP system checks
 
 server {
+    listen {%if phpsyscheck_vhostip %}{{ phpsyscheck_vhostip }}:{% endif %}{{ phpsyscheck_vhostport }};
+
     server_name {{ phpsyscheck_vhostname }};
 
     access_log  /var/log/nginx/sys.access.log;