From 5994b255c76505e5b2beb1ce5695af7c45f17db9 Mon Sep 17 00:00:00 2001 From: 3wc <3wc@doesthisthing.work> Date: Tue, 8 Oct 2024 23:54:54 -0400 Subject: [PATCH] Optional HTTPD support --- abra.sh | 2 ++ compose.httpd.yml | 28 ++++++++++++++++++---------- compose.yml | 1 + entrypoint.httpd.sh | 10 ++++++++++ httpd-vhosts.conf | 17 +++++++++++++++++ release/next | 3 +++ 6 files changed, 51 insertions(+), 10 deletions(-) create mode 100644 entrypoint.httpd.sh create mode 100644 httpd-vhosts.conf create mode 100644 release/next diff --git a/abra.sh b/abra.sh index 7763e93..630ce3b 100644 --- a/abra.sh +++ b/abra.sh @@ -3,6 +3,8 @@ export NGINX_DEFAULT_CONF_VERSION=v7 export PHP_UPLOADS_CONF_VERSION=v4 export ENTRYPOINT_CONF_VERSION=v1 export ENTRYPOINT_MAILRELAY_CONF_VERSION=v1 +export ENTRYPOINT_HTTPD_CONF_VERSION=v1 +export HTTPD_VHOSTS_CONF_VERSION=v1 export MSMTP_CONF_VERSION=v3 abra_backup_app() { diff --git a/compose.httpd.yml b/compose.httpd.yml index cffd363..9f26f81 100644 --- a/compose.httpd.yml +++ b/compose.httpd.yml @@ -21,14 +21,22 @@ services: - "traefik.http.middlewares.${STACK_NAME}-redirect.headers.SSLHost=${DOMAIN}" - coop-cloud.${STACK_NAME}.frontend.version=1.20-c628b67d volumes: - - site_content:/usr/local/apache2/htdocs/ - # configs: - # - source: httpd_default_conf - # target: /usr/local/apache2/conf/httpd.conf - + - site_content:/var/www/html/ + entrypoint: "/docker-entrypoint.sh" - #configs: - # httpd_default_conf: - # name: ${STACK_NAME}_httpd_default_conf_${HTTPD_DEFAULT_CONF_VERSION} - # file: httpd.conf - # template_driver: golang + configs: + - source: entrypoint_httpd_conf + target: /docker-entrypoint.sh + mode: 0555 + - source: httpd_vhosts_conf + target: /usr/local/apache2/conf/extra/httpd-vhosts.conf + + +configs: + entrypoint_httpd_conf: + name: ${STACK_NAME}_entrypoint_httpd_conf_${ENTRYPOINT_HTTPD_CONF_VERSION} + file: entrypoint.httpd.sh + httpd_vhosts_conf: + name: ${STACK_NAME}_httpd_vhosts_conf_${HTTPD_VHOSTS_CONF_VERSION} + file: httpd-vhosts.conf + template_driver: golang diff --git a/compose.yml b/compose.yml index ab788df..52c1dce 100644 --- a/compose.yml +++ b/compose.yml @@ -51,6 +51,7 @@ services: environment: - STACK_NAME - ROOT_PATH + - DOMAIN # healthcheck: # test: ["CMD", "curl", "-f", "http://localhost"] # interval: 30s diff --git a/entrypoint.httpd.sh b/entrypoint.httpd.sh new file mode 100644 index 0000000..ec34a50 --- /dev/null +++ b/entrypoint.httpd.sh @@ -0,0 +1,10 @@ +#!/bin/sh + +sed -i 's,#Include conf/extra/httpd-vhosts.conf,Include conf/extra/httpd-vhosts.conf,g' /usr/local/apache2/conf/httpd.conf + +sed -i '/LoadModule rewrite_module/s/^#//g' /usr/local/apache2/conf/httpd.conf && \ + sed -i 's#AllowOverride [Nn]one#AllowOverride All#' /usr/local/apache2/conf/httpd.conf && \ + sed -i '/LoadModule proxy_module/s/^#//g' /usr/local/apache2/conf/httpd.conf + sed -i '/LoadModule proxy_fcgi_module/s/^#//g' /usr/local/apache2/conf/httpd.conf + +httpd-foreground diff --git a/httpd-vhosts.conf b/httpd-vhosts.conf new file mode 100644 index 0000000..e2db04c --- /dev/null +++ b/httpd-vhosts.conf @@ -0,0 +1,17 @@ + + DocumentRoot /var/www/html/ + ServerName {{ env "DOMAIN" }} + ErrorLog logs/{{ env "DOMAIN" }}-error_log + CustomLog logs/{{ env "DOMAIN" }}-access_log common + + + AllowOverride All + DirectoryIndex index.php index.php + Options -Indexes + Require all granted + + + + SetHandler "proxy:fcgi://{{ env "STACK_NAME" }}_app:9000" + + diff --git a/release/next b/release/next new file mode 100644 index 0000000..d50e0ee --- /dev/null +++ b/release/next @@ -0,0 +1,3 @@ +This version adds optional HTTPD (apache) support, instead of the default Nginx. +This "should" be "fine", but please proceed with caution, taking a backup before +upgrade probably even more important than usual.