pma_vhost.j2 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. {% if ansible_prolog -%}
  2. {% from 'templates/ansible/prolog.j2' import prolog with context %}
  3. {{ prolog() }}
  4. {% endif -%}
  5. # Apache vhost for phpmyadmin
  6. <VirtualHost {%if phpmyadmin_vhostip %}{{ phpmyadmin_vhostip }}{% else %}*{% endif %}:{%if phpmyadmin_vhostport %}{{ phpmyadmin_vhostport }}{% else %}80{% endif %}>
  7. ServerName {{ phpmyadmin_vhostname }}
  8. Include conf-available/letsencrypt.conf
  9. {% if phpmyadmin_ssl and ssl_certs_auto_installed.stdout_lines is defined and phpmyadmin_vhostname in ssl_certs_auto_installed.stdout_lines %}
  10. RedirectMatch 301 ^(?!/\.well-known/acme-challenge/).* https://{{ phpmyadmin_vhostname }}$0
  11. {% else %}
  12. DocumentRoot /usr/share/phpmyadmin
  13. DirectoryIndex index.php
  14. {% if http_auth_phpmyadmin %}
  15. <Location />
  16. AuthType basic
  17. AuthName "Restricted Access"
  18. AuthUserFile /etc/apache2/auth_admin
  19. Require valid-user
  20. </Location>
  21. {% endif %}
  22. Include /etc/phpmyadmin/apache.conf
  23. <Directory /usr/share/phpmyadmin>
  24. <IfModule mod_php5.c>
  25. php_admin_value max_execution_time 240
  26. php_admin_value upload_max_filesize 128M
  27. php_admin_value post_max_size 128M
  28. php_admin_value max_input_vars 10000
  29. </IfModule>
  30. <IfModule php7_module>
  31. php_admin_value max_execution_time 240
  32. php_admin_value upload_max_filesize 128M
  33. php_admin_value post_max_size 128M
  34. php_admin_value max_input_vars 10000
  35. </IfModule>
  36. </Directory>
  37. {% if with_fpm|bool %}
  38. Include conf-available/fpm-pool.conf
  39. {% endif %}
  40. LogLevel warn
  41. CustomLog ${APACHE_LOG_DIR}/pma.access.log combined
  42. ErrorLog ${APACHE_LOG_DIR}/pma.error.log
  43. {% endif %}
  44. </VirtualHost>
  45. {% if phpmyadmin_ssl and ssl_certs_auto_installed.stdout_lines is defined and phpmyadmin_vhostname in ssl_certs_auto_installed.stdout_lines %}
  46. <VirtualHost {%if phpmyadmin_vhostip %}{{ phpmyadmin_vhostip }}{% else %}*{% endif %}:{%if phpmyadmin_vhostport %}{{ phpmyadmin_vhostport }}{% else %}443{% endif %}>
  47. ServerName {{ phpmyadmin_vhostname }}
  48. <IfModule http2_module>
  49. Protocols h2 http/1.1
  50. </IfModule>
  51. Include vhost_ssl_auto-{{ phpmyadmin_vhostname }}.conf
  52. DocumentRoot /usr/share/phpmyadmin
  53. DirectoryIndex index.php
  54. {% if http_auth_phpmyadmin %}
  55. <Location />
  56. AuthType basic
  57. AuthName "Restricted Access"
  58. AuthUserFile /etc/apache2/auth_admin
  59. Require valid-user
  60. </Location>
  61. {% endif %}
  62. Include /etc/phpmyadmin/apache.conf
  63. <Directory /usr/share/phpmyadmin>
  64. <IfModule mod_php5.c>
  65. php_admin_value max_execution_time 240
  66. php_admin_value upload_max_filesize 128M
  67. php_admin_value post_max_size 128M
  68. php_admin_value max_input_vars 10000
  69. </IfModule>
  70. <IfModule php7_module>
  71. php_admin_value max_execution_time 240
  72. php_admin_value upload_max_filesize 128M
  73. php_admin_value post_max_size 128M
  74. php_admin_value max_input_vars 10000
  75. </IfModule>
  76. </Directory>
  77. {% if with_fpm|bool %}
  78. Include conf-available/fpm-pool.conf
  79. {% endif %}
  80. LogLevel warn
  81. CustomLog ${APACHE_LOG_DIR}/pma.access.log combined
  82. ErrorLog ${APACHE_LOG_DIR}/pma.error.log
  83. </VirtualHost>
  84. {% endif %}