Skip to content

Commit c424ee4

Browse files
committed
Enable ldaps on port 8443
1 parent f3fa33e commit c424ee4

3 files changed

Lines changed: 34 additions & 4 deletions

File tree

Dockerfile

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,14 @@ RUN curl -sSL -o /tmp/simplesamlphp.tar.gz https://github.com/simplesamlphp/simp
2525
COPY config/simplesamlphp/config.php /var/www/simplesamlphp/config
2626
COPY config/simplesamlphp/authsources.php /var/www/simplesamlphp/config
2727
COPY config/simplesamlphp/saml20-sp-remote.php /var/www/simplesamlphp/metadata
28-
COPY config/simplesamlphp/server.crt /var/www/simplesamlphp/cert/
29-
COPY config/simplesamlphp/server.pem /var/www/simplesamlphp/cert/
28+
COPY config/simplesamlphp/server.crt /etc/ssl/private/cert.crt
29+
COPY config/simplesamlphp/server.pem /etc/ssl/private/private.key
3030

3131
RUN echo "<?php" > /var/www/simplesamlphp/metadata/shib13-sp-remote.php
3232

3333
# Apache
3434
ENV HTTP_PORT 8080
35+
ENV HTTPS_PORT 8443
3536

3637
COPY config/apache/ports.conf.mo /tmp
3738
COPY config/apache/simplesamlphp.conf.mo /tmp
@@ -40,7 +41,7 @@ RUN /tmp/mo /tmp/ports.conf.mo > /etc/apache2/ports.conf && \
4041

4142
# hadolint ignore=DL3059
4243
RUN a2dissite 000-default.conf default-ssl.conf && \
43-
a2enmod rewrite && \
44+
a2enmod rewrite ssl && \
4445
a2ensite simplesamlphp.conf
4546

4647
# Clean up
@@ -51,4 +52,4 @@ RUN rm -rf /tmp/*
5152
WORKDIR /var/www/simplesamlphp
5253

5354
# General setup
54-
EXPOSE ${HTTP_PORT}
55+
EXPOSE ${HTTP_PORT} ${HTTPS_PORT}

config/apache/ports.conf.mo

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,9 @@
11
Listen {{HTTP_PORT}}
2+
3+
<IfModule ssl_module>
4+
Listen {{HTTPS_PORT}}
5+
</IfModule>
6+
7+
<IfModule mod_gnutls.c>
8+
Listen {{HTTPS_PORT}}
9+
</IfModule>

config/apache/simplesamlphp.conf.mo

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,26 @@
1616
</IfModule>
1717
</Directory>
1818
</VirtualHost>
19+
<VirtualHost *:{{HTTPS_PORT}}>
20+
ServerName localhost
21+
DocumentRoot /var/www/simplesamlphp
22+
SSLEngine on
23+
SSLCertificateFile /etc/ssl/private/cert.crt
24+
SSLCertificateKeyFile /etc/ssl/private/private.key
25+
Alias /simplesaml /var/www/simplesamlphp/www
26+
27+
<Directory /var/www/simplesamlphp>
28+
RewriteEngine On
29+
RewriteBase /
30+
RewriteRule ^$ www [L]
31+
RewriteRule ^/(.+)$ www/$1 [L]
32+
</Directory>
33+
34+
<Directory /var/www/simplesamlphp/www>
35+
<IfModule !mod_authz_core.c>
36+
Require all granted
37+
</IfModule>
38+
</Directory>
39+
</VirtualHost>
1940

2041
ServerName localhost

0 commit comments

Comments
 (0)