View Issue Details

IDProjectCategoryView StatusLast Update
0011269mantisbtintegrationpublic2015-11-09 14:37
Reportersebdelyon Assigned Todregad  
PriorityhighSeveritycrashReproducibilityalways
Status closedResolutionunable to reproduce 
Product Version1.2.0rc2 
Summary0011269: Problems with apache virtualhost configuration
Description

I have an unique webserver on which I configured virtualhost for each application which are :
mantis-1.1.8 (url : http://mantis118.mydomain )
mantis-1.2RC2 (url : http://mantis12.mydomain )
testlink (url : http://testlink.mydomain )

here the conf file of my apache webserver:

<VirtualHost *:80>
DocumentRoot "C:/wamp/www/mantisbt-1.1.8/"
ServerName mantis118.mydomain
ErrorLog "C:/wamp/www/mantisbt-1.1.8/logs/mantis-error.log"
CustomLog "C:/wamp/www/mantisbt-1.1.8/logs/mantis-access.log" common
</VirtualHost>

<VirtualHost *:80>
DocumentRoot "C:/wamp/www/testlink/"
ServerName testlink.mydomain
ErrorLog "C:/wamp/www/testlink/logs/mantis-error.log"
CustomLog "C:/wamp/www/testlink/logs/mantis-access.log" common
</VirtualHost>

<VirtualHost *:80>
DocumentRoot "C:/wamp/www/mantisbt-1.2/"
ServerName mantis12.mydomain
ErrorLog "C:/wamp/www/mantisbt-1.2/logs/mantis-error.log"
CustomLog "C:/wamp/www/mantisbt-1.2/logs/mantis-access.log" common
</VirtualHost>

With this configuration, I can access version 1.8 of mantis by typing http://mantis118.mydomain in the web navigator

When I try to access the new version by typing http://mantis12.mydomain, the url is transformed into "http://mantis12.mydomain\/login_page.php"

When I access directly the login page (by deleting the backslash from the previous url), I read the following error :
SYSTEM WARNING: preg_match() [function.preg-match]: Compilation failed: missing ) at offset 110

SYSTEM WARNING: preg_match() [function.preg-match]: Compilation failed: missing ) at offset 84

SYSTEM WARNING: preg_match() [function.preg-match]: Compilation failed: missing ) at offset 110

SYSTEM WARNING: preg_match() [function.preg-match]: Compilation failed: missing ) at offset 84

And the access log file contains the value "%5C" instead of "mantis" inside each path :

127.0.0.1 - - [07/Dec/2009:15:37:20 +0100] "GET / HTTP/1.1" 500 26
127.0.0.1 - - [07/Dec/2009:16:19:50 +0100] "GET / HTTP/1.1" 302 26
127.0.0.1 - - [07/Dec/2009:16:20:03 +0100] "GET /login_page.php HTTP/1.1" 200 1660
127.0.0.1 - - [07/Dec/2009:16:20:04 +0100] "GET /%5C/css/default.css HTTP/1.1" 404 215
127.0.0.1 - - [07/Dec/2009:16:20:04 +0100] "GET /%5C/javascript/min/common.js HTTP/1.1" 404 224
127.0.0.1 - - [07/Dec/2009:16:20:04 +0100] "GET /%5C/javascript/min/ajax.js HTTP/1.1" 404 222
127.0.0.1 - - [07/Dec/2009:16:20:04 +0100] "GET /%5C/images/mantis_logo.gif HTTP/1.1" 404 222
127.0.0.1 - - [07/Dec/2009:16:20:04 +0100] "GET /%5C/images/mantis_logo_button.gif HTTP/1.1" 404 229
127.0.0.1 - - [07/Dec/2009:16:20:35 +0100] "GET /login_page.php HTTP/1.1" 200 1660
127.0.0.1 - - [07/Dec/2009:16:20:36 +0100] "GET /%5C/css/default.css HTTP/1.1" 404 215
127.0.0.1 - - [07/Dec/2009:16:20:36 +0100] "GET /%5C/javascript/min/common.js HTTP/1.1" 404 224
127.0.0.1 - - [07/Dec/2009:16:20:36 +0100] "GET /%5C/javascript/min/ajax.js HTTP/1.1" 404 222
127.0.0.1 - - [07/Dec/2009:16:20:36 +0100] "GET /%5C/images/mantis_logo.gif HTTP/1.1" 404 222
127.0.0.1 - - [07/Dec/2009:16:20:36 +0100] "GET /%5C/images/mantis_logo_button.gif HTTP/1.1" 404 229

TagsNo tags attached.

Activities

jreese

jreese

2009-12-07 13:42

reporter   ~0023874

Mantis 1.2.x requires a minimum PHP version of 5.1 or newer. The error you are seeing is most likely a result of using an older PHP version.

sebdelyon

sebdelyon

2009-12-08 08:40

reporter   ~0023882

Last edited: 2009-12-08 10:29

I forgot to mention that my work environment is based on WampServer2.0i
So, I work with the PHP version 5.3

I noticed that the error is raised by the function "string_sanitize_url( $p_url, $p_return_absolute = false )" in script string_api.php

sebdelyon

sebdelyon

2009-12-08 11:53

reporter   ~0023884

Last edited: 2009-12-09 02:12

Finally, I managed to hide this problem by making the following changes in file config_default_inc.php

I add the test:
if ( '/' == $t_path || '\' == $t_path ) {
$t_path = '';
}
before line 147: $t_url = $t_protocol . '://' . $t_host . $t_path.'/';

with my server configuration, calculated value of $t_path is "\" whereas the variable must be empty to work.

staratnight

staratnight

2010-03-05 09:02

reporter   ~0024650

I do have the same problem with release version 1.2.0 of mantisbt.

My environment is a non virtual Apache installation. PHP-Version is 5.2.1.
It is also a windows based system.

Mantis 1.1.8 worked without any problems. I also installed 1.2.0 on a *nix based system without any problem.

The little hack from sebdelyon also worked for me.

laplix

laplix

2010-11-05 17:54

reporter   ~0027267

Same here. Sebdelyon patch did the trick. I have had this problem since the first releases of 1.2, forcing me to stay with 1.1.18. Never managed to find why.

So a HUGE THANK YOU Mr. Sebdelyon.

dregad

dregad

2015-10-25 06:45

developer   ~0051715

The logic to set $g_path has been modified in 1.2.12. Feel free to reopen this issue if the problem persists in the latest version.