From 61ef23906481a9bf9448413196e43117bf4d923f Mon Sep 17 00:00:00 2001 From: Florens Pauwels Date: Sun, 24 Jul 2022 18:09:00 +0200 Subject: [PATCH] Separate vhosts for docker --- docker-compose.yml | 4 ++-- tools/apache-hosts/dls1.nintendowifi.net.conf | 6 +++--- .../apache-hosts/gamestats.gs.nintendowifi.net.conf | 4 ++-- .../apache-hosts/gamestats2.gs.nintendowifi.net.conf | 4 ++-- .../nas-naswii-conntest.nintendowifi.net.conf | 12 ++++++------ tools/apache-hosts/sake.gs.nintendowifi.net.conf | 8 ++++---- tools/{ => docker}/apache-hosts/Dockerfile | 7 +++++-- tools/docker/apache-hosts/dls1.nintendowifi.net.conf | 9 +++++++++ .../apache-hosts/gamestats.gs.nintendowifi.net.conf | 8 ++++++++ .../apache-hosts/gamestats2.gs.nintendowifi.net.conf | 10 ++++++++++ .../nas-naswii-conntest.nintendowifi.net.conf | 12 ++++++++++++ .../apache-hosts/sake.gs.nintendowifi.net.conf | 11 +++++++++++ 12 files changed, 74 insertions(+), 21 deletions(-) rename tools/{ => docker}/apache-hosts/Dockerfile (86%) create mode 100644 tools/docker/apache-hosts/dls1.nintendowifi.net.conf create mode 100644 tools/docker/apache-hosts/gamestats.gs.nintendowifi.net.conf create mode 100644 tools/docker/apache-hosts/gamestats2.gs.nintendowifi.net.conf create mode 100644 tools/docker/apache-hosts/nas-naswii-conntest.nintendowifi.net.conf create mode 100644 tools/docker/apache-hosts/sake.gs.nintendowifi.net.conf diff --git a/docker-compose.yml b/docker-compose.yml index d5c8854..999b70d 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -8,7 +8,7 @@ services: proxy: build: - context: tools/apache-hosts + context: tools/docker/apache-hosts # environment: -# - HOST=example.com +# - DWC_HOST=example.com network_mode: "host" diff --git a/tools/apache-hosts/dls1.nintendowifi.net.conf b/tools/apache-hosts/dls1.nintendowifi.net.conf index 1b46827..fda65ea 100644 --- a/tools/apache-hosts/dls1.nintendowifi.net.conf +++ b/tools/apache-hosts/dls1.nintendowifi.net.conf @@ -1,8 +1,8 @@ ServerAdmin webmaster@localhost - ServerName dls1.${HOST} - ServerAlias "dls1.${HOST}" - ServerAlias "dls1.${HOST}, dls1.${HOST}" + ServerName dls1.nintendowifi.net + ServerAlias "dls1.nintendowifi.net" + ServerAlias "dls1.nintendowifi.net, dls1.nintendowifi.net" ProxyPreserveHost On ProxyPass / http://127.0.0.1:9003/ ProxyPassReverse / http://127.0.0.1:9003/ diff --git a/tools/apache-hosts/gamestats.gs.nintendowifi.net.conf b/tools/apache-hosts/gamestats.gs.nintendowifi.net.conf index df9a761..dc67950 100644 --- a/tools/apache-hosts/gamestats.gs.nintendowifi.net.conf +++ b/tools/apache-hosts/gamestats.gs.nintendowifi.net.conf @@ -1,7 +1,7 @@ ServerAdmin webmaster@localhost - ServerName gamestats.gs.${HOST} - ServerAlias "gamestats.gs.${HOST}, gamestats.gs.${HOST}" + ServerName gamestats.gs.nintendowifi.net + ServerAlias "gamestats.gs.nintendowifi.net, gamestats.gs.nintendowifi.net" ProxyPreserveHost On ProxyPass / http://127.0.0.1:9002/ ProxyPassReverse / http://127.0.0.1:9002/ diff --git a/tools/apache-hosts/gamestats2.gs.nintendowifi.net.conf b/tools/apache-hosts/gamestats2.gs.nintendowifi.net.conf index 21da7b9..3f79350 100644 --- a/tools/apache-hosts/gamestats2.gs.nintendowifi.net.conf +++ b/tools/apache-hosts/gamestats2.gs.nintendowifi.net.conf @@ -1,7 +1,7 @@ ServerAdmin webmaster@localhost - ServerName gamestats2.gs.${HOST} - ServerAlias "gamestats2.gs.${HOST}, gamestats2.gs.${HOST}" + ServerName gamestats2.gs.nintendowifi.net + ServerAlias "gamestats2.gs.nintendowifi.net, gamestats2.gs.nintendowifi.net" ProxyPreserveHost On diff --git a/tools/apache-hosts/nas-naswii-conntest.nintendowifi.net.conf b/tools/apache-hosts/nas-naswii-conntest.nintendowifi.net.conf index 68fe032..94da24c 100644 --- a/tools/apache-hosts/nas-naswii-conntest.nintendowifi.net.conf +++ b/tools/apache-hosts/nas-naswii-conntest.nintendowifi.net.conf @@ -1,11 +1,11 @@ ServerAdmin webmaster@localhost - ServerName naswii.${HOST} - ServerAlias "naswii.${HOST}, naswii.${HOST}" - ServerAlias "nas.${HOST}" - ServerAlias "nas.${HOST}, nas.${HOST}" - ServerAlias "conntest.${HOST}" - ServerAlias "conntest.${HOST}, conntest.${HOST}" + ServerName naswii.nintendowifi.net + ServerAlias "naswii.nintendowifi.net, naswii.nintendowifi.net" + ServerAlias "nas.nintendowifi.net" + ServerAlias "nas.nintendowifi.net, nas.nintendowifi.net" + ServerAlias "conntest.nintendowifi.net" + ServerAlias "conntest.nintendowifi.net, conntest.nintendowifi.net" ProxyPreserveHost On ProxyPass / http://127.0.0.1:9000/ ProxyPassReverse / http://127.0.0.1:9000/ diff --git a/tools/apache-hosts/sake.gs.nintendowifi.net.conf b/tools/apache-hosts/sake.gs.nintendowifi.net.conf index 2e6ed0b..ab854a6 100644 --- a/tools/apache-hosts/sake.gs.nintendowifi.net.conf +++ b/tools/apache-hosts/sake.gs.nintendowifi.net.conf @@ -1,9 +1,9 @@ ServerAdmin webmaster@localhost - ServerName sake.gs.${HOST} - ServerAlias sake.gs.${HOST} *.sake.gs.${HOST} - ServerAlias secure.sake.gs.${HOST} - ServerAlias secure.sake.gs.${HOST} *.secure.sake.gs.${HOST} + ServerName sake.gs.nintendowifi.net + ServerAlias sake.gs.nintendowifi.net *.sake.gs.nintendowifi.net + ServerAlias secure.sake.gs.nintendowifi.net + ServerAlias secure.sake.gs.nintendowifi.net *.secure.sake.gs.nintendowifi.net ProxyPass / http://127.0.0.1:8000/ diff --git a/tools/apache-hosts/Dockerfile b/tools/docker/apache-hosts/Dockerfile similarity index 86% rename from tools/apache-hosts/Dockerfile rename to tools/docker/apache-hosts/Dockerfile index 0083e6a..658a31a 100644 --- a/tools/apache-hosts/Dockerfile +++ b/tools/docker/apache-hosts/Dockerfile @@ -4,13 +4,16 @@ ENV APACHE_LOG_DIR=/usr/local/apache2/logs # Change this if you have your own domain name set up # Otherwise, you will need to set up a DNS server to point nintendowifi.net to your IP address -ENV HOST=nintendowifi.net +ENV DWC_HOST=nintendowifi.net -# TODO: do in one line +# vhost config RUN echo $'IncludeOptional /usr/local/apache2/vhost.d/*.conf\n\ ServerName localhost\n\ HttpProtocolOptions Unsafe' >> conf/httpd.conf + +# Enable proxy module RUN sed -i 's/^#LoadModule proxy_module/LoadModule proxy_module/' conf/httpd.conf RUN sed -i 's/^#LoadModule proxy_http_module/LoadModule proxy_http_module/' conf/httpd.conf +# Copy vhosts COPY *.conf vhost.d/ diff --git a/tools/docker/apache-hosts/dls1.nintendowifi.net.conf b/tools/docker/apache-hosts/dls1.nintendowifi.net.conf new file mode 100644 index 0000000..5c154da --- /dev/null +++ b/tools/docker/apache-hosts/dls1.nintendowifi.net.conf @@ -0,0 +1,9 @@ + + ServerAdmin webmaster@localhost + ServerName dls1.${DWC_HOST} + ServerAlias "dls1.${DWC_HOST}" + ServerAlias "dls1.${DWC_HOST}, dls1.${DWC_HOST}" + ProxyPreserveHost On + ProxyPass / http://127.0.0.1:9003/ + ProxyPassReverse / http://127.0.0.1:9003/ + diff --git a/tools/docker/apache-hosts/gamestats.gs.nintendowifi.net.conf b/tools/docker/apache-hosts/gamestats.gs.nintendowifi.net.conf new file mode 100644 index 0000000..be30eb7 --- /dev/null +++ b/tools/docker/apache-hosts/gamestats.gs.nintendowifi.net.conf @@ -0,0 +1,8 @@ + + ServerAdmin webmaster@localhost + ServerName gamestats.gs.${DWC_HOST} + ServerAlias "gamestats.gs.${DWC_HOST}, gamestats.gs.${DWC_HOST}" + ProxyPreserveHost On + ProxyPass / http://127.0.0.1:9002/ + ProxyPassReverse / http://127.0.0.1:9002/ + diff --git a/tools/docker/apache-hosts/gamestats2.gs.nintendowifi.net.conf b/tools/docker/apache-hosts/gamestats2.gs.nintendowifi.net.conf new file mode 100644 index 0000000..d42b51f --- /dev/null +++ b/tools/docker/apache-hosts/gamestats2.gs.nintendowifi.net.conf @@ -0,0 +1,10 @@ + + ServerAdmin webmaster@localhost + ServerName gamestats2.gs.${DWC_HOST} + ServerAlias "gamestats2.gs.${DWC_HOST}, gamestats2.gs.${DWC_HOST}" + + ProxyPreserveHost On + + ProxyPass / http://127.0.0.1:9002/ + ProxyPassReverse / http://127.0.0.1:9002/ + diff --git a/tools/docker/apache-hosts/nas-naswii-conntest.nintendowifi.net.conf b/tools/docker/apache-hosts/nas-naswii-conntest.nintendowifi.net.conf new file mode 100644 index 0000000..cf33ed9 --- /dev/null +++ b/tools/docker/apache-hosts/nas-naswii-conntest.nintendowifi.net.conf @@ -0,0 +1,12 @@ + + ServerAdmin webmaster@localhost + ServerName naswii.${DWC_HOST} + ServerAlias "naswii.${DWC_HOST}, naswii.${DWC_HOST}" + ServerAlias "nas.${DWC_HOST}" + ServerAlias "nas.${DWC_HOST}, nas.${DWC_HOST}" + ServerAlias "conntest.${DWC_HOST}" + ServerAlias "conntest.${DWC_HOST}, conntest.${DWC_HOST}" + ProxyPreserveHost On + ProxyPass / http://127.0.0.1:9000/ + ProxyPassReverse / http://127.0.0.1:9000/ + diff --git a/tools/docker/apache-hosts/sake.gs.nintendowifi.net.conf b/tools/docker/apache-hosts/sake.gs.nintendowifi.net.conf new file mode 100644 index 0000000..7d528a8 --- /dev/null +++ b/tools/docker/apache-hosts/sake.gs.nintendowifi.net.conf @@ -0,0 +1,11 @@ + + ServerAdmin webmaster@localhost + ServerName sake.gs.${DWC_HOST} + ServerAlias sake.gs.${DWC_HOST} *.sake.gs.${DWC_HOST} + ServerAlias secure.sake.gs.${DWC_HOST} + ServerAlias secure.sake.gs.${DWC_HOST} *.secure.sake.gs.${DWC_HOST} + + ProxyPass / http://127.0.0.1:8000/ + + CustomLog ${APACHE_LOG_DIR}/access.log combined +