pga_vhost.j2 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. {% if ansible_controlled is defined and ansible_controlled != "" %}
  2. #
  3. # {{ ansible_controlled }}
  4. #
  5. {% endif %}
  6. # Apache vhost for phppgadmin
  7. <VirtualHost {%if phppgadmin_vhostip %}{{ phppgadmin_vhostip }}{% else %}*{% endif %}:{{ phppgadmin_vhostport }}>
  8. ServerName {{ phppgadmin_vhostname }}
  9. DocumentRoot /usr/share/phppgadmin
  10. DirectoryIndex index.php
  11. {% if phppgadmin_http_auth %}
  12. <Location />
  13. AuthType basic
  14. AuthName "Restricted Access"
  15. AuthUserFile /etc/apache2/auth_admin
  16. <RequireAny>
  17. {% if phppgadmin_http_whitelist_ip|length > 0 %}
  18. Require ip {{ phppgadmin_http_whitelist_ip | join(' ') }}
  19. {% endif %}
  20. Require valid-user
  21. </RequireAny>
  22. </Location>
  23. {% endif %}
  24. <Directory /usr/share/phppgadmin>
  25. Require all granted
  26. </Directory>
  27. <IfModule mod_php5.c>
  28. php_admin_value max_execution_time 240
  29. php_admin_value upload_max_filesize 128M
  30. php_admin_value post_max_size 128M
  31. </IfModule>
  32. <IfModule php7_module>
  33. php_admin_value max_execution_time 240
  34. php_admin_value upload_max_filesize 128M
  35. php_admin_value post_max_size 128M
  36. </IfModule>
  37. {% if with_fpm|bool %}
  38. Include conf-available/fpm-pool.conf
  39. {% endif %}
  40. LogLevel warn
  41. CustomLog ${APACHE_LOG_DIR}/pga.access.log combined
  42. ErrorLog ${APACHE_LOG_DIR}/pga.error.log
  43. </VirtualHost>