Web-server with Shibboleth SP to put in front of a PHP FPM app
100K+
Apache containers created with this image serve as the front-end for the application containers. The functions of the Apache:
Serve static content
Apply .htaccess rules
Play Shibboleth Service Provider role
Implement basic security measures (such as bouncing off requests with
unknown Host headers) or enforce HTTPS.
Provide session mechanism that can be controlled from PHP code.
Normally, containers based off of this image are not adding the content
(such as pictures or .htaccess files), instead it's expected that the volume
will be attached to the container somewhere in /var/www/html.
In other word, this image shouldn't be built in CodePipeline, it can be used
directly it the TaskDefinition.
This container expects another one with the name phpbin to exist in the same
network. This container should run PHP FPM on port 9000.
Otherwise, *.php files won't be working.
In production, we achieve it by using the Links parameter of the
ContainerDefinitions section of AWS::ECS::TaskDefinition.
In local environment, the easiest way to achieve it is to use docker-compose.
| Variable name | Default value |
|---|---|
| sp_skip_update | - |
| sp_idp | https://imp.bu.edu/idp/shibboleth |
| sp_sp | http://imp.bu.edu:8000/shibboleth |
| SP_HANDLER_URL | /Shibboleth.sso/ |
| SP_HOME_URL | / |
| SHIB_SP_KEY | /run/secrets/SHIB_SP_KEY |
| SHIB_SP_CERT | /run/secrets/SHIB_SP_CERT |
| SECRETS_BUCKET_PATH | - |
| SECRETS_DESTINATION | - |
| CSP_REPORT_URL | - |
| PROXY_INTERNAL | 10.0.0.0/8 127.0.0.0/8 172.16.0.0/12 192.168.0.0/16 169.254.0.0/16 |
| PROXY_EXTERNAL | - |
| REMOTE_IP_HEADER | X-Forwarded-For |
| SERVER_NAME | localhost |
| SERVER_ALIAS | - |
| SESSION_MAX_AGE | 28800 |
| SESSION_COOKIE_NAME | php-app-session |
| SESSION_COOKIE_PATH | / |
| SESSION_COOKIE_DOMAIN | - |
| SESSION_PASSPHRASE | secretPassphraseChangeItPlease |
| IDP_LOGOUT_URL | - |
| LANDSCAPE_VERSION | - |
sp_skip_update (when set to any non-empty value) allows to avoid downloading
the IdP metadata when running the container. It's generally useful only for
local development.
SP_HOME_URL must start and end with /.
PROXY_INTERNAL is corresponding to Apache's
RemoteIPInternalProxy Directive.
PROXY_EXTERNAL is corresponding to Apache's
RemoteIPTrustedProxy Directive.
The default value of PROXY_INTERNAL is overly permissive and intended only
for development environments. For production, you need to figure out the proper
combination of values passed as PROXY_INTERNAL and PROXY_EXTERNAL. If not
sure if you need this, set both to empty strings.
The local sandbox is available for you to experiment with the Apache container. The sandbox consists of an IdP connected to an LDAP that this container can communicate with and an SSL terminating proxy in front of it.
Also, there's a basic PHP application
that hides behind the Apache and the container is called phpbin.
This setup is simulating how real app containers are configured.
To start the sandbox, run:
docker-compose up --build --force-recreate
While it's running, you can open a bash session with the container:
docker-compose exec sp bash
When done, don't forget to clean up:
docker-compose down
The LDAP has several pre-defined accounts that you can use to login.
Try using superadmin, student1, or staff for the username and
password for the password.
Feel free to edit the LDAP config to add more.
cd tests/
scripts/all_cases.sh
Content type
Image
Digest
Size
217.5 MB
Last updated
over 5 years ago
docker pull bostonuniversity/apache-php-fpm