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

Commit

Permalink
Added support to httpd
Browse files Browse the repository at this point in the history
  • Loading branch information
villadalmine committed Sep 12, 2016
1 parent efaa536 commit de4cc30
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 11 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ RUN ln -s /usr/lib64/shibboleth/mod_shib_24.so /etc/httpd/modules/mod_shib_24.so
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
RUN [[ $CHANGE_TO_SSL_HTTPD_KEY && ${CHANGE_TO_SSL_HTTPD_KEY-x} ]] && [[ $CHANGE_TO_SSL_HTTPD_CERT && ${CHANGE_TO_SSL_HTTPD_CERT-x} ]] && ln -s /opt/etc/httpd/conf.d/virtual_host_443.conf /etc/httpd/conf.d/00-comanage-443.conf

# Port
EXPOSE 80 443
Expand Down
25 changes: 15 additions & 10 deletions container_files/bin/configure_httpd.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,22 @@

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
sed -i "s|COMANAGE_SERVER_FQDN|$COMANAGE_SERVER_FQDN|g" /opt/etc/httpd/conf.d/virtual_host_80.conf >> $log
sed -i "s|COMANAGE_SERVER_FQDN|$COMANAGE_SERVER_FQDN|g" /opt/etc/httpd/conf.d/virtual_host_443.conf >> $log
if [[ $CHANGE_TO_SSL_HTTPD_KEY && ${CHANGE_TO_SSL_HTTPD_KEY-x} ]]; then
sed -i "s|CHANGE_TO_SSL_HTTPD_KEY|$CHANGE_TO_SSL_HTTPD_KEY|g" /opt/etc/httpd/conf.d/virtual_host_443.conf >> $log
else
echo "CHANGE_TO_SSL_HTTPD_KEY variable is not used" >> $log
fi
if [[ $CHANGE_TO_SSL_HTTPD_CERT && ${CHANGE_TO_SSL_HTTPD_CERT-x} ]]; then
sed -i "s|CHANGE_TO_SSL_HTTPD_CERT|$CHANGE_TO_SSL_HTTPD_CERT|g" /opt/etc/httpd/conf.d/virtual_host_443.conf >> $log
else
echo "CHANGE_TO_SSL_HTTPD_CERT variable is not used" >> $log
fi

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
echo "Removing Listen 80 in httpd.conf" >> $log
sed -i 's/^Listen 80$//' /etc/httpd/conf/httpd.conf
date >> $log
echo "Configuration of httpd completed " >> $log

0 comments on commit de4cc30

Please sign in to comment.