From 49c54388669efcd68dd204e175569d052ec04472 Mon Sep 17 00:00:00 2001 From: Josh Knapp Date: Tue, 17 Dec 2024 21:44:09 -0800 Subject: [PATCH] Added fix for issues found while setting up anhonesthost --- Dockerfile | 1 + configs/remote_ip.conf | 2 ++ scripts/entrypoint.sh | 3 +++ 3 files changed, 6 insertions(+) create mode 100644 configs/remote_ip.conf diff --git a/Dockerfile b/Dockerfile index 4238190..18a6353 100644 --- a/Dockerfile +++ b/Dockerfile @@ -18,6 +18,7 @@ COPY ./configs/prod-php.ini /etc/php.ini COPY ./configs/phpinfo.php /var/www/html/ COPY ./configs/mariadb.repo /etc/yum.repos.d/ COPY ./configs/index.php /var/www/html/ +COPY ./remote_ip.conf /etc/httpd/conf.d/ RUN echo "15 */12 * * * root /scripts/log-rotate.sh" >> /etc/crontab RUN yum clean all ENTRYPOINT [ "/scripts/entrypoint.sh" ] diff --git a/configs/remote_ip.conf b/configs/remote_ip.conf new file mode 100644 index 0000000..f61caee --- /dev/null +++ b/configs/remote_ip.conf @@ -0,0 +1,2 @@ +RemoteIPHeader X-Forwarded-For +LogFormat "%a %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined \ No newline at end of file diff --git a/scripts/entrypoint.sh b/scripts/entrypoint.sh index b1b3cbb..1a363c8 100644 --- a/scripts/entrypoint.sh +++ b/scripts/entrypoint.sh @@ -14,6 +14,9 @@ mv /var/log/httpd /var/log/httpd.bak ln -s /home/$user/logs/apache /var/log/httpd ln -s /home/$user/logs/php-fpm /var/log/php-fpm +rm -f /etc/httpd/conf.d/userdir.conf +docker_network=$(ip addr show |grep eth0 |grep inet |awk -F " " {'print $2'}) +echo "RemoteIPInternalProxy $docker_network" >> /etc/httpd/conf.d/remoteip.conf /scripts/install-php$PHPVER.sh /scripts/create-vhost.sh