[BlueOnyx:26793] Re: GUI on non-standard ports now possible
Michael Stauber
mstauber at blueonyx.it
Sat Mar 2 12:00:38 -05 2024
Hi Juerg,
>> /etc/httpd/conf.perl/00-default-vsite.pl
>
> I'm not an expert with PerlConfigRequire, can you help me to find the
> error?
>
> First I enabled $DEBUG to generate a /tmp/httpd.debug (tooks some time
> until I remembered, httpd has PrivateTmp=true and the file is in a
> subfolder...) There's the alias:
>
> RewriteEngine On
> RewriteCond %{HTTP_HOST} ^([^:]+)
> RewriteCond %{DOCUMENT_ROOT} !-d
> RewriteRule .* https://%1:81/gui/Forbidden403 [L,R]
> RewriteCond %{HTTP_HOST} ^([^:]+)
> RewriteRule ^/login/?$ https://%1:81/login [L,R]
> RewriteCond %{HTTP_HOST} ^([^:]+)
> RewriteRule ^/testxyz/?$ https://%1:81/login [L,R]
>
> If I put same in site1.include it works. How can I check if the config
> with perl-script is loaded?
Yeah, it's not easy to debug. The configuration doesn't need to be
written out for it to work in Apache. The Perl Module dynamically
generates that part of the Apache config and dynamically inserts it into
Apache itself.
Back in the days of old we used to use this to generate the whole SSL
configuration for Apache on the fly.
The way we use /etc/httpd/conf.perl/00-default-vsite.pl now is that it
generates default Vsites that operate on all IPv4/IPv6 addresses that
Apache listens to. This prevents a random Vsite from appearing when
someone visits the server just by the IP.
But as a side effect we can also use the RewriteRules to redirect to the
GUI. This still leaves some wiggle-room so that custom RewriteRules for
redirecting to the GUI can be used in .htaccess or siteX.include files
for each individual Vsites if need be.
> In the generated debug-file, DocumentRoot is /var/www/html/ and SSL
> cert is also wrong
No, this is fine, because its for the "Default Vsite" on each IP. So it
uses the AdmServ cert and DocumentRoot /var/www/html/, from where the
index.html will do a redirect to the GUI.
--
With best regards
Michael Stauber
More information about the Blueonyx
mailing list