Bacula-users

Re: [Bacula-users] Baculum redirects from https to http

2016-08-05 02:01:59
Subject: Re: [Bacula-users] Baculum redirects from https to http
From: Marcin Haba <ganiuszka AT gmail DOT com>
To: Jari Fredriksson <jarif AT iki DOT fi>
Date: Fri, 5 Aug 2016 08:00:49 +0200
Hello Jari,

About the issue 1):

To solve it I propose to check:
1) nginx config to be sure that the directing to Apache is https
2) Apache config - specially rewrite rules for Baculum URLs in config
and in .htaccess, to be sure that nothing redirects https to http
there

If after checking both 1) and 2) look OK for you, then you can try
following code:

<?php
$result = (array_key_exists('HTTPS', $_SERVER) &&
!empty($_SERVER['HTTPS'])) ? 'HTTPS detected' : 'HTTPS - NOT
detected';
$all_headers = var_export($_SERVER, true);
echo "RESULT=$result, ALL HEADERS=$all_headers";
?>

Please put it to a new PHP file and save it in Baculum document root
directory. In the end you can load it without nginx (same Apache) and
with nginx.

This code does the same as Baculum does for detecting https
connection. You will see where the https is lost.

About the issue 2):

Baculum compares document root directory with directory in which
Baculum really works. It does that to know if Baculum should add a
subdirectory (or subdirectories) to URL or Baculum shouldn't add
anything to URL. It is done for supporting Baculum placed in document
root sub-directory.

In your case it looks that Baculum files are placed somewhere outside
the path defined in Apache config as document root:

/usr/share/apache2/bacula

You can use following code to check it:

<?php
$document_root = $_SERVER['DOCUMENT_ROOT'];
$baculum_dir = __DIR__;
$result = ($document_root === $baculum_dir) ? 'OK - paths are the
same' : 'NOT OK - paths are different';
echo "DOCUMENT ROOT=$document_root, BACULUM DIR=$baculum_dir, RESULT=$result";
?>

The same as in the previous issue, please put it in a new PHP file and then run.

Please note that Baculum in the paths checking does one additional
step which the code above doesn't do. Baculum reads symbolic links and
uses target directory in this case.

If in your path:

/usr/share/apache2/bacula

one from directories is symbolic link, then it explains the additional
path in URL and you need to use a path that doesn't contain symbolic
links.

Inside the Baculum document root all symbolic links doesn't matter,
but in the path to Baculum document root these links have meaning.

Please let know if it helped.

Best regards.
Marcin Haba (gani)

On 5 August 2016 at 00:21, Jari Fredriksson <jarif AT iki DOT fi> wrote:
> I have configured an Apache with Baculum latest to run on port 80 for http.
>
> In front of that is an nginx serving https and passing the connection to the
> apache.
>
> After login the session dies because of many redirects.
>
> The location that it wants to give is
>
> Location: http://bacula.bitwell.biz/usr/share/apache2//wizard/
>
>
> Two issues:
>
>
> 1. https -> http and the nginx is doing exactly the opposite as intended!
>
> 2. why the /usr/share/apache2// in the url?? That is the file system path...
>
> I adapted the conf for apache from examples/deb/baculum-apache.conf
>
> and it is as here: http://pastebin.ca/3673834
>
>
> Any ideas?
>
> --
>
> jarif AT iki DOT fi
>
>
> ------------------------------------------------------------------------------
>
> _______________________________________________
> Bacula-users mailing list
> Bacula-users AT lists.sourceforge DOT net
> https://lists.sourceforge.net/lists/listinfo/bacula-users
>



-- 
"Większej miłości nikt nie ma nad tę, jak gdy kto życie swoje kładzie
za przyjaciół swoich." Jezus Chrystus

------------------------------------------------------------------------------
_______________________________________________
Bacula-users mailing list
Bacula-users AT lists.sourceforge DOT net
https://lists.sourceforge.net/lists/listinfo/bacula-users
<Prev in Thread] Current Thread [Next in Thread>