Skip to content

Instantly share code, notes, and snippets.

@mefarazath
Created April 14, 2017 15:51
Show Gist options
  • Save mefarazath/5273c31b2ff5321b514f0bf63c871b44 to your computer and use it in GitHub Desktop.
Save mefarazath/5273c31b2ff5321b514f0bf63c871b44 to your computer and use it in GitHub Desktop.
<VirtualHost *:80>
# The ServerName directive sets the request scheme, hostname and port that
# the server uses to identify itself. This is used when creating
# redirection URLs. In the context of virtual hosts, the ServerName
# specifies what hostname must appear in the request's Host: header to
# match this virtual host. For the default virtual host (this file) this
# value is not decisive as it is used as a last resort host regardless.
# However, you must set it for any further virtual host explicitly.
#ServerName www.example.com
ServerAdmin webmaster@localhost
DocumentRoot /var/www/html
# Available loglevels: trace8, ..., trace1, debug, info, notice, warn,
# error, crit, alert, emerg.
# It is also possible to configure the loglevel for particular
# modules, e.g.
#LogLevel info ssl:warn
# This is a server-wide configuration that will add information from the Mellon session to all requests.
<Location />
</Location>
# This is a location that will trigger authentication when requested.
<Location /auth_mellon.php>
MellonEnable "auth"
# Add information from the mod_auth_mellon session to the request.
# Configure the SP metadata
# This should be the files which were created when creating SP metadata.
MellonSPPrivateKeyFile /etc/apache2/mellon/auth_mellon.key
MellonSPCertFile /etc/apache2/mellon/auth_mellon.cert
MellonSPMetadataFile /etc/apache2/mellon/auth_mellon.xml
# IdP metadata. This should be the metadata file you got from the IdP.
MellonIdPMetadataFile /etc/apache2/mellon/idp-metadata.xml
MellonSamlResponseDump On
MellonIDP "IDP"
MellonSetEnv "username" "username"
# The location all endpoints should be located under.
# It is the URL to this location that is used as the second parameter to the metadata generation script.
# This path is relative to the root of the web server.
MellonEndpointPath /mellon/callback
</Location>
# This is a location that will trigger authentication when requested.
<Location /spa>
MellonEnable "auth"
# Add information from the mod_auth_mellon session to the request.
# Configure the SP metadata
# This should be the files which were created when creating SP metadata.
MellonSPPrivateKeyFile /etc/apache2/mellon/spa/http_localhost_singlePageApp.key
MellonSPCertFile /etc/apache2/mellon/http_localhost_travelocity.com.cert
MellonSPMetadataFile /etc/apache2/mellon/spa/http_localhost_singlePageApp.xml
# IdP metadata. This should be the metadata file you got from the IdP.
MellonIdPMetadataFile /etc/apache2/mellon/idp-metadata.xml
MellonSamlResponseDump On
MellonIDP "IDP"
MellonSetEnv "username" "username"
# The location all endpoints should be located under.
# It is the URL to this location that is used as the second parameter to the metadata generation script.
# This path is relative to the root of the web server.
MellonEndpointPath /spa/callback
</Location>
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
# For most configuration files from conf-available/, which are
# enabled or disabled at a global level, it is possible to
# include a line for only one particular virtual host. For example the
# following line enables the CGI configuration for this host only
# after it has been globally disabled with "a2disconf".
#Include conf-available/serve-cgi-bin.conf
</VirtualHost>
# vim: syntax=apache ts=4 sw=4 sts=4 sr noet
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment