Sign inSign up

hydrozyk1/apache-shibboleth-sp

By hydrozyk1

•Updated almost 2 years ago

RockyLinux based Shibboleth-sp provider as a Reverse-Proxy to any of your apps.

Image
Networking
Developer tools
Web servers
0

1.4K

hydrozyk1/apache-shibboleth-sp repository overview

Instructions for Running apache-shibboleth-sp as Docker Compose Image.

This guide provides step-by-step instructions to set up and run the hydrozyk1/apache-shibboleth-sp Docker image using the provided docker-compose.yml file. It focuses on mounting volumes from local directories to the Docker container.

Prerequisites

Docker and Docker Compose are installed on your system.
Basic familiarity with command-line operations.

Directory Structure

Create the necessary subdirectories and files as specified in the docker-compose.yml file.

├── apache │   ├── httpd.conf │   ├── my_app.conf │   ├── selfsigned.crt │   ├── selfsigned.key │   ├── shib.conf │   └── ssl.conf ├── docker-compose.yml ├── LICENSE ├── my-app.com_data └── shibboleth

Prepare Apache Configuration Files

You need to place the following files inside the apache directory:

httpd.conf
shib.conf
ssl.conf
my_app.conf  
selfsigned.crt  --- This needs to your server SSL certificate 
selfsigned.key  --- Your server Private key for SSL

Create or Or adjust Configuration Files

httpd.conf: The main Apache configuration file. Use a default version or customize it as needed.
shib.conf: Configuration file for the Shibboleth module in Apache.
ssl.conf: Contains SSL configurations for Apache.
my_app.conf: Configuration file specific to your application or virtual host.

openssl req -x509 -nodes -days 365
-newkey rsa:2048
-keyout apache/selfsigned.key
-out apache/selfsigned.crt

Follow the prompts to enter the certificate details.

Prepare the my_app.conf File

Create the my_app.conf file inside the apache directory. This file should contain the Apache configuration directives for your specific application.

Example my_app.conf:

<VirtualHost *:80> ServerName my-app.com DocumentRoot /var/www/html/my-app.com

<Directory /var/www/html/my-app.com>
    Options Indexes FollowSymLinks
    AllowOverride All
    Require all granted
</Directory>

# Additional configurations as needed

Prepare the Shibboleth Configuration

Place your Shibboleth configuration files inside the shibboleth directory.

Add your web application files to the my-app.com_data directory. These files will be served by Apache from /var/www/html/my-app.com inside the container.

Create a docker-compose.yml file in the root of your project directory with the following content, updated to include the new volume mount:

docker-compose.yml version: '3.1' services: apache: image: hydrozyk1/apache-shibboleth-sp container_name: apache_shib volumes: - ./apache/httpd.conf:/etc/httpd/conf/httpd.conf:rw - ./apache/shib.conf:/etc/httpd/conf.d/shib.conf:rw - ./apache/ssl.conf:/etc/httpd/conf.d/ssl.conf:rw - ./apache/selfsigned.crt:/etc/httpd/conf.d/selfsigned.crt - ./apache/selfsigned.key:/etc/httpd/conf.d/selfsigned.key - ./apache/my_app.conf:/etc/httpd/conf.d/my_app.conf:rw # Added volume mount - ./my-app.com_data:/var/www/html/my-app.com:rw - ./shibboleth:/etc/shibboleth:rw restart: unless-stopped ports: - "80:80" - "443:443" command: > sh -c "httpd -DFOREGROUND & shibd -F" networks: shib_network: ipv4_address: 172.18.1.2

networks: shib_network: driver: bridge ipam: config: - subnet: 172.18.1.0/24

chmod -R 755 apache_shibboleth_project

docker-compose up

Run the following command to start the service: docker-compose up -d

Check the status of the running containers: docker ps

Test the Setup

Access your web application and Apache server via a web browser:

HTTP: http://localhost
HTTPS: https://localhost

Monitor Logs

To view the logs from the container in real-time:

docker-compose logs -f

When you're done and want to stop the containers:

Additional Notes

Custom Network Configuration: The docker-compose.yml file specifies a custom network with a fixed IP address. Ensure that this IP doesn't conflict with existing networks on your system. Firewall Settings: Make sure that ports 80 and 443 are open and not blocked by your firewall. SELinux Considerations: If you're using SELinux, you might need to adjust the security context or disable SELinux to allow volume mounting. Permissions Issues: If you encounter permission denied errors, verify the ownership and permissions of the mounted directories and files. docker-compose down

Tag summary

Content type

Image

Digest

sha256:3f6dd9034…

Size

121.9 MB

Last updated

almost 2 years ago

docker pull hydrozyk1/apache-shibboleth-sp