Proxying TestLink

Ask community to help.

Moderators: Amaradana, TurboPT, TL Developers

Post Reply
DarrenBeck
TestLink user
Posts: 2
Joined: Mon Aug 09, 2010 8:53 pm

Proxying TestLink

Post by DarrenBeck »

Hi all,

I'm trying to get TestLink working behind a proxy. Before I get into more detail here are the software versions I'm using:
  • TestLink: 1.8.5
  • Apache: 2.2.3
  • PHP: 5.2.10
  • OS: CentOS 5.5
I have installed TestLink using the provided installation instructions and it's working perfectly on the internal network. However, we reverse proxy all internal services using a second apache instance which is externally facing and running over HTTPS.

I've tried using the patch described here, but it didn't seem to make any difference.

The proxy server has the following config:

Code: Select all

ProxyRequests Off
ProxyPreserveHost On

<Proxy *>
	Order deny,allow
	Allow from all
</Proxy>

<Location /testlink>
	ProxyPass http://testserver/testlink
	ProxyPassReverse http://testserver/testlink
</Location>
The TestLink server is just using the following:

Code: Select all

Alias /testlink "/opt/testlink"
When I try and login (using https://externalserver/testlink) I get redirected to the login page as expected, however when I login I just get redirected back to the login page. There are no errors on the screen and nothing in the logs for the apache servers or TestLink.

Looking at the headers that are requested for the external URL shows the POST when the login button is clicked but the next header is a GET for the login.php page.

As stated earlier the server works fine if you use the internal URL.

Any ideas on where to look for the issue, or any other diagnostic tips?

Thanks,

Darren.
fman
Member of TestLink Community
Posts: 3123
Joined: Tue Nov 15, 2005 7:19 am

Re: Proxying TestLink

Post by fman »

do some search on our mantis, one user has contributed some code regarding proxy but was never added due to lack of infrastructure to test it.
let us know
DarrenBeck
TestLink user
Posts: 2
Joined: Mon Aug 09, 2010 8:53 pm

Re: Proxying TestLink

Post by DarrenBeck »

I have only found one issue on this subject #0002404, this is the same patch I referenced in my original post. It's not woking for me so far...
fman
Member of TestLink Community
Posts: 3123
Joined: Tue Nov 15, 2005 7:19 am

Re: Proxying TestLink

Post by fman »

ok, I'm sorry but I've no idea how to help you
patrickn
TestLink user
Posts: 1
Joined: Wed Apr 20, 2011 5:41 am

Re: Proxying TestLink

Post by patrickn »

Any luck here? I'm running into the same problem as well.
michiel
TestLink user
Posts: 2
Joined: Tue Jul 05, 2011 9:10 am

Re: Proxying TestLink

Post by michiel »

Hi,

The patch mentioned above works but for https to be proxied correctly, you need to add another line. The patch of lib/functions/configCheck.php would look like this (mind the added line with 'protocol'):

Code: Select all

@@ -63,6 +63,12 @@
$t_path = '';
}

+ if ( isset( $_SERVER['HTTP_X_FORWARDED_HOST'] ) ) {
+ $t_protocol = 'https';
+ $t_host = $_SERVER['HTTP_X_FORWARDED_HOST'];
+ $t_port = '';
+ }
+
$t_url = $t_protocol . '://' . $t_host . $t_path.'/';

return ($t_url); 
It would be very nice if this could be implemented in a future version.

Thanks,

Michiel
fman
Member of TestLink Community
Posts: 3123
Joined: Tue Nov 15, 2005 7:19 am

Re: Proxying TestLink

Post by fman »

zero possibility to see any change in future version is no feature request is done on mantis, attaching ALL CODE not patch
Post Reply