Templates
On the Templates page, you can create htpasswd and htaccess configurations required for publishing apps. You can either create a new template or, if one already exists, edit the existing template.
htpasswd Configuration
If no htpasswd configuration has been created yet, a message appears indicating that no configuration is currently available. In the upper right corner, two buttons are provided:
for adding users and
for editing the raw configuration.
Add Users
Clicking opens the Add User dialog, where a username and password can be entered. The password can be shown or hidden using
, and a random password can be generated using
.
The user can then be added or the process can be cancelled. Once a user has been created, a list of all existing users is displayed, each with for deletion.
| The password is no longer visible in plain text after saving and must therefore be stored or remembered carefully. |
Edit Raw Configuration
opens the raw configuration. If no users exist, the text field is empty. If entries are present, the users are listed in the following format:
username:encodedPassword
Additional users can also be added manually in this field, for example to transfer configurations from other projects. It is important to note that the password is no longer visible in plain text after saving and must therefore be stored or remembered carefully.
htaccess Configuration
If no htaccess configuration has been created yet, a message appears indicating that no configuration is currently available. In the upper right corner, is available to edit the configuration.
Clicking this icon opens an empty text field in which the desired htaccess configuration can be entered. The configuration can then be saved or the process cancelled.
Once an htaccess configuration has been created, it is displayed in the text field and can be edited at any time using . Any changes can be saved or discarded as needed.
Example Configurations
The htacces file can be used to override the apache configuration. This only works if the apache configuration allows the override.
For further information, please visit https://httpd.apache.org/docs/2.4/howto/htaccess.html.
<Directory "/www/htdocs"> AllowOverride All </Directory>
Proxy WMS to circumvent missing CORS-header
Proxy WMS service to circumvent missing CORS-header. The App configuration can then use the new relative wms-url.
<IfModule rewrite_module> RequestHeader unset Authorization RewriteEngine On RewriteRule ^wms/(.*)$ http://wms.wmsservice.de$1 [P] </IfModule>
Proxy Password protected Service
<IfModule rewrite_module> SetEnvIf Request_URI ^.*wmstest$ WMSTEST RequestHeader set Authorization "Basic xxx=" env=WMSTEST RewriteRule ^wmstest(.*)$ https://wmsurl$1 [P] </IfModule>
Protect Website with Password
Users and Passwords need to be defined in htpasswd.
AuthType Basic AuthName "Restricted Files" AuthBasicProvider file AuthUserFile "/var/www/sites/kunde/.htpasswd" Require valid-user Require ip 1.2.3.4 #optional IP adress requests from this ip don't need a password Require ip 2.3.4.5
Save Datasources on AWS-S3
All requests to the datasource-data folder will be rewritten to the given s3 bucket.
<IfModule rewrite_module> RequestHeader unset Authorization RewriteEngine On RewriteRule ^datasource-data(.*)$ https://s3.eu-central-1.amazonaws.com/bucket$1 [P] </IfModule>
Add URL without Password with UUID
<IfModule rewrite_module> RequestHeader unset Authorization RewriteEngine On RewriteRule ^UUID/(.*)$ $1 [L] RewriteRule ^datasource-data(.*)$ https://s3.eu-central-1.amazonaws.com/virtualcitymaps/bucket [P] </IfModule> SetEnvIf Request_URI "UUID/" noauth=1 AuthType Basic AuthName "Restricted Files" AuthBasicProvider file AuthUserFile "/var/www/sites/kunde/.htpasswd" Require valid-user Require env=noauth