pga_vhost.j2 1.4 KB

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