<VirtualHost *:80>
DocumentRoot /usr/share/thruk/root
CustomLog /var/log/httpd/thruk_access.log combined
ErrorLog /var/log/httpd/thruk_error.log
<Directory /usr/share/thruk/root>
Options FollowSymLinks
AllowOverride All
order allow,deny
allow from all
</Directory>
Alias /thruk/documentation.html /usr/share/thruk/root/thruk/documentation.html
Alias /thruk/startup.html /usr/share/thruk/root/thruk/startup.html
AliasMatch ^/thruk/(.*\.cgi|.*\.html) /usr/share/thruk/fcgid_env.sh/thruk/$1
AliasMatch ^/thruk/plugins/(.*?)/(.*)$ /etc/thruk/plugins/plugins-enabled/$1/root/$2
Alias /thruk/themes/ /etc/thruk/themes/themes-enabled/
Alias /thruk /usr/share/thruk/root/thruk
<LocationMatch /thruk>
Options ExecCGI
AuthName "Thruk Demo"
AuthType Basic
AuthUserFile /etc/thruk/htpasswd
order allow,deny
allow from all
require valid-user
</LocationMatch>
RewriteMap users prg:/usr/share/thruk/script/thruk_auth
# make all cookies accessible by the url
RewriteCond %{REQUEST_URI} !^/thruk/cgi-bin/restricted.cgi
RewriteCond %{HTTP_COOKIE} (thruk_auth=[^;]+|$) [NC]
RewriteRule ^/(.*)$ /%1/%{REMOTE_ADDR}/____/$1 [C,NS]
RewriteRule ^(.*)$ ${users:$1|/loginbad/} [C,NS]
RewriteRule ^/pass/(.*)$ /$1 [NS,E=!REMOTE_USER]
RewriteRule ^/redirect/(.*)$ /$1 [NS,R=302]
RewriteRule ^/loginok/([^/]+)/(.*)$ /$2 [NS,E=REMOTE_USER:$1]
<LocationMatch ^/(?!thruk/cgi-bin/restricted.cgi)>
Order allow,deny
Allow from all
Satisfy any
</LocationMatch>
<IfModule mod_fcgid.c>
# AddHandler fcgid-script .pl
AddHandler fcgid-script .sh
MaxRequestsPerProcess 100
</IfModule>
</VirtualHost>
Arnaud
Still had no time, but its quite easy and just a few lines of apache rewrite magic:
This is taken from demo.thruk.org where it works without OMD:
RewriteMap users prg:/home/thruk/Thruk/script/thruk_auth
RewriteCond %{REQUEST_URI} !^/thruk/cgi-bin/restricted.cgi
RewriteCond %{HTTP_COOKIE} (thruk_auth=[^;]+|$) [NC]
RewriteRule ^/(.*)$ /%1/%{REMOTE_ADDR}/____/$1 [C,NS]
RewriteRule ^(.*)$ ${users:$1|/loginbad/} [C,NS]
RewriteRule ^/pass/(.*)$ /$1 [NS,E=!REMOTE_USER]
RewriteRule ^/redirect/(.*)$ /$1 [NS,R=302]
RewriteRule ^/loginok/([^/]+)/(.*)$ /$2 [NS,E=REMOTE_USER:$1]
<LocationMatch ^/(?!thruk/cgi-bin/restricted.cgi)>
Order allow,deny
Allow from all
Satisfy any
</LocationMatch>
Maybe this helps already.
Sven
On 08.10.2013 13:59, PvPer wrote:
> Hello there,
>
> I definately need this solution too, the logging without cookie authentification is a pain in the ass for our users :-)
>
> Regards.
>
> Le jeudi 26 septembre 2013 15:33:19 UTC+2, aesnau...@gmail.com a �crit :
>
> Hi Sven,
>
> Have you find some time to write documentation on how to configure cookie authentication in non-omd setups ?
>
> Aranud
>
> Le mardi 28 mai 2013 10:40:16 UTC+2, Sven Nierlein a �crit :