# Sample VirtualHost configuration file for EtherCalc under Apache # Permissions are granted # * for all sheets: to users belonging to # cn=ethercalc,ou=groups,dc=example,dc=com group # * for single sheet: to users belonging to subgroup of # cn=ethercalc,ou=groups,dc=example,dc=com group. Name of this # subgroup determines the name of sheet user has access to. # e.g. member of cn=diner,cn=ethercalc,ou=groups,dc=example,dc=com # has access to https://ethercalc.example.com/diner sheet. # # Note: duplicated AuthLDAP directives should be removed using # AuthnProviderAlias. Unfortunately it does not seem to work as of # Apache 2.4.9 # # AuthBasicProvider ldap # AuthLDAPBindDN "cn=apache,dc=example,dc=com" # AuthLDAPBindPassword # AuthLDAPURL ldap://localhost/ou=people,dc=example,dc=com?uid # ServerName ethercalc.example.com ErrorLog /var/log/apache2/ethercalc-ssl_error_log TransferLog /var/log/apache2/ethercalc-ssl_access_log CustomLog /var/log/apache2/ethercalc-ssl_request_log \ "%t %h %{SSL_PROTOCOL}x %{SSL_CIPHER}x \"%r\" %b" ProxyRequests Off ProxyPass / http://127.0.0.1:8000/ Require all denied # Files referred to by Ethercalc sheet AuthType Basic AuthName "EtherCalc" AuthBasicProvider ldap AuthLDAPBindDN "cn=apache,dc=example,dc=com" AuthLDAPBindPassword AuthLDAPURL ldap://localhost/ou=people,dc=example,dc=com?uid #AuthBasicProvider ethercalc SetEnvIf Referer "^https://[^/]+/([^/]+)$" CALC_REFERRAL=$1 Require ldap-group cn=ethercalc,ou=groups,dc=example,dc=com Require ldap-group cn=%{unescape:%{env:CALC_REFERRAL}},cn=ethercalc,ou=groups,dc=example,dc=com # Ethercalc sheet [^/]+)$' > AuthType Basic AuthName "EtherCalc" AuthBasicProvider ldap AuthLDAPBindDN "cn=apache,dc=example,dc=com" AuthLDAPBindPassword AuthLDAPURL ldap://localhost/ou=people,dc=example,dc=com?uid #AuthBasicProvider ethercalc Require ldap-group cn=ethercalc,ou=groups,dc=example,dc=com Require ldap-group cn=%{unescape:%{env:MATCH_CALCNAME}},cn=ethercalc,ou=groups,dc=example,dc=com #LogLevel authz_core:trace1 SSLEngine on SSLCertificateFile /etc/ssl/apache2/server.crt SSLCertificateKeyFile /etc/ssl/apache2/server.key # vim: ts=4 filetype=apache