[library-web/oscp] Add httpd image



commit d066314a18e6933b92280ab1bb4021fec7569b56
Author: Bartłomiej Piotrowski <bpiotrowski gnome org>
Date:   Wed Jan 15 07:58:41 2020 +0100

    Add httpd image

 httpd/Dockerfile               | 22 ++++++++++++++++++
 httpd/developer.gnome.org.conf | 51 ++++++++++++++++++++++++++++++++++++++++++
 httpd/entrypoint.sh            |  2 ++
 3 files changed, 75 insertions(+)
---
diff --git a/httpd/Dockerfile b/httpd/Dockerfile
new file mode 100644
index 0000000..c5bd602
--- /dev/null
+++ b/httpd/Dockerfile
@@ -0,0 +1,22 @@
+FROM centos/s2i-base-centos7
+
+RUN INSTALL_PKGS="httpd24 httpd24-mod_ssl" && \
+    yum install -y centos-release-scl epel-release && \
+    yum -y --setopt=tsflags=nodocs install --enablerepo=centosplus $INSTALL_PKGS && \
+    rpm -V $INSTALL_PKGS && \
+    # Remove centos-logos (httpd dependency) to keep image size smaller.
+    rpm -e --nodeps centos-logos && \
+    yum -y clean all --enablerepo='*'
+
+RUN sed -ri ' s!^(\s*CustomLog)\s+\S+!\1 /proc/self/fd/1!g; s!^(\s*ErrorLog)\s+\S+!\1 /proc/self/fd/2!g;' 
/opt/rh/httpd24/root/etc/httpd/conf/httpd.conf && \
+    sed -ri ' s!^(\s*CustomLog)\s+\S+!\1 /proc/self/fd/1!g; s!^(\s*TransferLog)\s+\S+!\1 /proc/self/fd/1!g; 
s!^(\s*ErrorLog)\s+\S+!\1 /proc/self/fd/2!g;' /opt/rh/httpd24/root/etc/httpd/conf.d/ssl.conf
+
+RUN sed -i 's/Listen\ 80/Listen\ 8080/' /opt/rh/httpd24/root/etc/httpd/conf/httpd.conf && \ 
+    sed -i 's/Listen\ 443/Listen\ 8443/' /opt/rh/httpd24/root/etc/httpd/conf.d/ssl.conf && \
+    sed -i 's/_default_:443/_default_:8443/' /opt/rh/httpd24/root/etc/httpd/conf.d/ssl.conf
+
+ADD developer.gnome.org.conf /opt/rh/httpd24/root/etc/httpd/conf.d/developer.gnome.org.conf
+
+ADD entrypoint.sh /entrypoint.sh
+ENTRYPOINT ["/entrypoint.sh"]
+CMD ["httpd", "-DFOREGROUND"]
diff --git a/httpd/developer.gnome.org.conf b/httpd/developer.gnome.org.conf
new file mode 100644
index 0000000..630ed1c
--- /dev/null
+++ b/httpd/developer.gnome.org.conf
@@ -0,0 +1,51 @@
+<VirtualHost *:8080>
+    DocumentRoot /data/output/developer.gnome.org
+    ServerName developer.gnome.org
+    ServerAlias developer.oscp.gnome.org
+
+    SetEnvIf X-Forwarded-For "^.*\..*\..*\..*" forwarded
+
+    DirectoryIndex index.html
+
+    RemoveType .el .gv .ms .pl .ps .si .sl .tr
+
+    # Bugzilla #689838
+    RedirectMatch /gtk/(.*)$ /gtk3/$1
+
+    # https://bugzilla.gnome.org/show_bug.cgi?id=703063
+    RewriteEngine On
+    RedirectMatch /glib/2.29(|/.*)$ https://developer.gnome.org/glib/2.37$1
+    RedirectMatch /glib/2.31(|/.*)$ https://developer.gnome.org/glib/2.37$1
+    RedirectMatch /glib/2.33(|/.*)$ https://developer.gnome.org/glib/2.37$1
+    RedirectMatch /glib/2.35(|/.*)$ https://developer.gnome.org/glib/2.37$1
+
+    # https://bugzilla.gnome.org/show_bug.cgi?id=699072
+    RedirectMatch /gtk-faq(|/.*) https://developer.gnome.org/gtk3/stable/gtk-question-index.html
+    RedirectMatch /gtk3/3.1(|/.*)$ https://developer.gnome.org/gtk3/stable$1
+    RedirectMatch /gtk3/3.3(|/.*)$ https://developer.gnome.org/gtk3/stable$1
+    RedirectMatch /gtk3/3.5(|/.*)$ https://developer.gnome.org/gtk3/stable$1
+
+    # Redirect /gdk to /gdk3
+    RedirectMatch /gdk/(.*)$ /gdk3/$1
+
+    # Additional redirects
+    RedirectMatch 301 /hig-book/stable/(.*)$ /hig/stable/$1
+</VirtualHost>
+
+<Directory /data/output/developer.gnome.org>
+       Options +Indexes +MultiViews
+
+       IndexOptions +FancyIndexing -IconsAreLinks +VersionSort +FoldersFirst +SuppressHTMLPreamble
+       HeaderName /HEADER.html 
+       ReadmeName /FOOTER.html
+       IndexStyleSheet /lgo.css
+
+       SetEnvIf Cookie "language=(.+)" prefer-language=$1 Header append Vary cookie 
+       #SetEnvIf Cookie "language=en" prefer-language=en
+       #SetEnvIf Cookie "language=sr" prefer-language=sr
+
+       LanguagePriority en
+       ForceLanguagePriority Prefer Fallback
+
+       Header append Vary Cookie
+</Directory>
diff --git a/httpd/entrypoint.sh b/httpd/entrypoint.sh
new file mode 100644
index 0000000..7744fc2
--- /dev/null
+++ b/httpd/entrypoint.sh
@@ -0,0 +1,2 @@
+#!/bin/bash
+scl enable rh-python36 httpd24 "$*"


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]