Bug#922040: x2gobroker-wsgi: default apache configuration gives 403 error

2019-03-18 Thread Mike Gabriel

Hi Linnea,

(re-Cc-ing the Debian bug)

On  Mo 18 Mär 2019 14:38:54 UTC, Linnea Skogtvedt wrote:


Den 18.03.2019 12:25, skrev Mike Gabriel:

Control: tags -1 patch

Hi Linnea,

On Mon, 11 Feb 2019 15:11:01 +0100 Linnea Skogtvedt
 wrote:

Package: x2gobroker-wsgi
Version: 0.0.4.0-3

wget -O - http://127.0.0.1/x2gobroker/ yields a 403 Forbidden error
message. /var/log/apache2/error.log shows the following message:
[authz_core:error] ... [client 127.0.0.1:49216] AH01630: client denied
by server configuration: /usr/bin/x2gobroker

Editing /etc/apache2/conf-available/x2gobroker-wsgi.conf to change
 to  and restarting
apache2 removes the 403 Forbidden error, but it's not a good
configuration. I suggest creating a WSGI wrapper script in its own
subdirectory.


I am using a freshly installed Debian testing VM, with unstable added in
sources.list to be able to install x2gobroker. I used the following
command to install the packages: apt install apache2 x2gobroker
x2gobroker-wsgi


can you rebuild your x2gobroker instance from source with attached patch
applied (or alternatively, reconfigure your runtime instance as
demonstrated by the patch's content) and check whether the above issue
is solved then?

Thanks,
Mike


Hi Mike,

I have tested by purging all x2gobroker packages and rebuilding with
your patch. Can confirm that it solves the issue.

Kind regards,

Linnea


Thanks. Very cool!

Mike
--

DAS-NETZWERKTEAM
c\o Technik- und Ökologiezentrum Eckernförde
Mike Gabriel, Marienthaler str. 17, 24340 Eckernförde
mobile: +49 (1520) 1976 148
landline: +49 (4354) 8390 139

GnuPG Fingerprint: 9BFB AEE8 6C0A A5FF BF22  0782 9AF4 6B30 2577 1B31
mail: mike.gabr...@das-netzwerkteam.de, http://das-netzwerkteam.de



pgpynMM7Rq0qN.pgp
Description: Digitale PGP-Signatur


Bug#922040: x2gobroker-wsgi: default apache configuration gives 403 error

2019-03-18 Thread Mike Gabriel

Control: tags -1 patch

Hi Linnea,

On Mon, 11 Feb 2019 15:11:01 +0100 Linnea Skogtvedt 
 wrote:

> Package: x2gobroker-wsgi
> Version: 0.0.4.0-3
>
> wget -O - http://127.0.0.1/x2gobroker/ yields a 403 Forbidden error
> message. /var/log/apache2/error.log shows the following message:
> [authz_core:error] ... [client 127.0.0.1:49216] AH01630: client denied
> by server configuration: /usr/bin/x2gobroker
>
> Editing /etc/apache2/conf-available/x2gobroker-wsgi.conf to change
>  to  and restarting
> apache2 removes the 403 Forbidden error, but it's not a good
> configuration. I suggest creating a WSGI wrapper script in its own
> subdirectory.
>
>
> I am using a freshly installed Debian testing VM, with unstable added in
> sources.list to be able to install x2gobroker. I used the following
> command to install the packages: apt install apache2 x2gobroker
> x2gobroker-wsgi

can you rebuild your x2gobroker instance from source with attached patch 
applied (or alternatively, reconfigure your runtime instance as 
demonstrated by the patch's content) and check whether the above issue 
is solved then?


Thanks,
Mike
>From 5bb47a9cb08804af8cd22085da9de3ca08fa7c97 Mon Sep 17 00:00:00 2001
From: Mike Gabriel 
Date: Mon, 18 Mar 2019 12:22:46 +0100
Subject: [PATCH] x2gobroker-wsgi: Placa WSGI script symlink (pointing to
 /x2gobroker) into a dedicated folder and configure Apache2 to use
 WSGIScriptAlias from that folder. (See Debian bug #922040).

---
 Makefile | 3 +++
 debian/x2gobroker-wsgi.install   | 1 +
 etc/x2gobroker-wsgi.apache.conf  | 4 ++--
 etc/x2gobroker-wsgi.apache.vhost | 4 ++--
 4 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/Makefile b/Makefile
index ca1c85f..ad2bec9 100755
--- a/Makefile
+++ b/Makefile
@@ -182,6 +182,9 @@ install:
 	${INSTALL_FILE} etc/x2gobroker-wsgi.apache.{conf,vhost} \
 	"${DESTDIR}${ETCDIR}/"
 	${INSTALL_FILE} logrotate/x2gobroker-wsgi "${DESTDIR}/etc/logrotate.d/"
+	mkdir -p "${DESTDIR}${LIBDIR}/x2gobroker/wsgi"
+	${INSTALL_SYMLINK} "${BINDIR}/x2gobroker" \
+	"${DESTDIR}${LIBDIR}/x2gobroker/wsgi/x2gobroker-wsgi"
 
 	# x2gobroker
 	mkdir -p "${DESTDIR}${BINDIR}" "${DESTDIR}${SBINDIR}" \
diff --git a/debian/x2gobroker-wsgi.install b/debian/x2gobroker-wsgi.install
index 743a1cc..42b6b92 100644
--- a/debian/x2gobroker-wsgi.install
+++ b/debian/x2gobroker-wsgi.install
@@ -1,3 +1,4 @@
 etc/x2go/x2gobroker-wsgi.apache.conf
 etc/x2go/x2gobroker-wsgi.apache.vhost
 etc/logrotate.d/x2gobroker-wsgi
+usr/lib/x2gobroker/wsgi/
diff --git a/etc/x2gobroker-wsgi.apache.conf b/etc/x2gobroker-wsgi.apache.conf
index 3ee97ee..42da235 100644
--- a/etc/x2gobroker-wsgi.apache.conf
+++ b/etc/x2gobroker-wsgi.apache.conf
@@ -28,10 +28,10 @@ SetEnv X2GOBROKER_DEFAULT_BACKEND inifile
 # if you have to-be-statically-served files somewhere below the broker URL
 #Alias /x2gobroker/static /some/static/path/
 
-WSGIScriptAlias /x2gobroker /usr/bin/x2gobroker
+WSGIScriptAlias /x2gobroker /usr/lib/x2gobroker/wsgi/x2gobroker-wsgi
 WSGIProcessGroup x2gobroker
 
-
+
 
 Require local
 
diff --git a/etc/x2gobroker-wsgi.apache.vhost b/etc/x2gobroker-wsgi.apache.vhost
index 9b9e1cd..44df536 100644
--- a/etc/x2gobroker-wsgi.apache.vhost
+++ b/etc/x2gobroker-wsgi.apache.vhost
@@ -42,10 +42,10 @@
 # if you have to-be-statically-served files somewhere below the broker URL
 #Alias /x2gobroker/static /some/static/path/
 
-WSGIScriptAlias / /usr/bin/x2gobroker
+WSGIScriptAlias / /usr/lib/x2gobroker/wsgi/x2goroker-wsgi
 WSGIProcessGroup x2gobroker
 
-
+
 
 Require local
 
-- 
2.11.0



Bug#922040: x2gobroker-wsgi: default apache configuration gives 403 error

2019-02-11 Thread Linnea Skogtvedt
Package: x2gobroker-wsgi
Version: 0.0.4.0-3

wget -O - http://127.0.0.1/x2gobroker/ yields a 403 Forbidden error
message. /var/log/apache2/error.log shows the following message:
[authz_core:error] ... [client 127.0.0.1:49216] AH01630: client denied
by server configuration: /usr/bin/x2gobroker

Editing /etc/apache2/conf-available/x2gobroker-wsgi.conf to change
 to  and restarting
apache2 removes the 403 Forbidden error, but it's not a good
configuration. I suggest creating a WSGI wrapper script in its own
subdirectory.


I am using a freshly installed Debian testing VM, with unstable added in
sources.list to be able to install x2gobroker. I used the following
command to install the packages: apt install apache2 x2gobroker
x2gobroker-wsgi