Skip to content
This repository has been archived by the owner. It is now read-only.

Commit

Permalink
Added httpd structure
Browse files Browse the repository at this point in the history
  • Loading branch information
villadalmine committed Sep 12, 2016
1 parent 14bd1b0 commit efaa536
Show file tree
Hide file tree
Showing 8 changed files with 45 additions and 26 deletions.
14 changes: 13 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,20 @@ VOLUME /opt/shibboleth/ssl/

# Required volumes for mounting Apache SSL files into container
VOLUME /opt/httpd/ssl/
#Added ssl default conf
RUN ln -s /opt/etc/httpd/conf.d/ssl.conf /etc/httpd/conf.d/ssl.conf

#Added shib module apache
RUN ln -s /opt/etc/httpd/conf.modules.d/00-shib.conf /etc/httpd/conf.modules.d/00-shib.conf
RUN ln -s /usr/lib64/shibboleth/mod_shib_24.so /etc/httpd/modules/mod_shib_24.so

#Add httpd configuration
RUN ln -s /opt/etc/httpd/conf.d/ports.conf /etc/httpd/conf.d/ports.conf
RUN ln -s /opt/etc/httpd/conf.d/handlers.conf /etc/httpd/conf.d/handlers.conf
RUN ln -s /opt/etc/httpd/conf.d/virtual_host_80.conf /etc/httpd/conf.d/00-comanage-80.conf
RUN ln -s /opt/etc/httpd/conf.d/virtual_host_443.conf /etc/httpd/conf.d/00-comanage-443.conf

# Port
EXPOSE 80 443

CMD ["/opt/bin/start.sh"]
CMD ["/opt/bin/start.sh"]
15 changes: 14 additions & 1 deletion container_files/bin/configure_httpd.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,18 @@
#!/bin/bash

log="/tmp/httpd.log"
date >> $log
echo "Configuring httpd: " > $log

echo "Configuring httpd: " > $log
echo "Removing Listen 80 in httpd.conf" > $log
sed -i 's/^Listen 80$//' /etc/httpd/conf/httpd.conf

for i in /usr/lib64/shibboleth/mod_shib_24.so /etc/httpd/modules/mod_shib_24.so /etc/httpd/conf.d/ssl.conf /etc/httpd/conf.d/handlers.conf /etc/httpd/conf.d/ports.conf /etc/httpd/conf.modules.d/00-shib.conf /etc/httpd/conf.d/00-comanage_80.conf /etc/httpd/conf.d/00-comanage_443.conf
do
if [ -f $i ]; then
echo " $i is configured" >> $log
else
echo "$i is not configured >> $log
fi
date >> $log
echo "Configuration of httpd completed " >> $log
3 changes: 3 additions & 0 deletions container_files/etc/httpd/conf.d/handlers.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
AddType text/html .php
php_value session.save_handler "files"
php_value session.save_path "/var/lib/php/session"
2 changes: 2 additions & 0 deletions container_files/etc/httpd/conf.d/ports.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Listen 80 http
Listen 443 https
6 changes: 6 additions & 0 deletions container_files/etc/httpd/conf.d/ssl.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
SSLPassPhraseDialog exec:/usr/libexec/httpd-ssl-pass-dialog
SSLSessionCache shmcb:/run/httpd/sslcache(512000)
SSLSessionCacheTimeout 300
SSLRandomSeed startup file:/dev/urandom 256
SSLRandomSeed connect builtin
SSLCryptoDevice builtin
Original file line number Diff line number Diff line change
@@ -1,25 +1,3 @@
Listen 80 http
Listen 443 https

AddType text/html .php
php_value session.save_handler "files"
php_value session.save_path "/var/lib/php/session"

LoadModule mod_shib /usr/lib64/shibboleth/mod_shib_24.so

<VirtualHost _default_:80>
ServerName http://COMANAGE_SERVER_FQDN:80
UseCanonicalName On
RedirectMatch (.*) https://COMANAGE_SERVER_FQDN$1
</VirtualHost>

SSLPassPhraseDialog exec:/usr/libexec/httpd-ssl-pass-dialog
SSLSessionCache shmcb:/run/httpd/sslcache(512000)
SSLSessionCacheTimeout 300
SSLRandomSeed startup file:/dev/urandom 256
SSLRandomSeed connect builtin
SSLCryptoDevice builtin

<VirtualHost _default_:443>
ServerName https://COMANAGE_SERVER_FQDN:443
UseCanonicalName On
Expand Down Expand Up @@ -103,5 +81,4 @@ Redirect "/registry/users/logout" "https://COMANAGE_SERVER_FQDN/Shibboleth.sso/L
Require all denied
</Files>

</VirtualHost>

</VirtualHost>
5 changes: 5 additions & 0 deletions container_files/etc/httpd/conf.d/virtual_host_80.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<VirtualHost _default_:80>
ServerName http://COMANAGE_SERVER_FQDN:80
UseCanonicalName On
RedirectMatch (.*) https://COMANAGE_SERVER_FQDN$1
</VirtualHost>
1 change: 1 addition & 0 deletions container_files/etc/httpd/conf.modules.d/00-shib.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
LoadModule mod_shib /usr/lib64/shibboleth/mod_shib_24.so

0 comments on commit efaa536

Please sign in to comment.