Loading...
 
Skip to main content

Features / Usability


Changing apache ports

Hi I've got a small problem related to the apache listening port.

I originally set up apache to listen on port 81 (there was a good reason, honestly). After some time running a tw I changed the port to 80. Everything works ok, until I go to log out. The logout link itself is ok - using default port, and the session does get logged out but then redirects to the :81 address, which obviously errs out.

As far as I can tell the absolute url includes $url_port which is set to the port number in $_SERVER which clearly, should be 80.

Any thoughts?

BTW for any devs tiki-logout.php includes the comment:
// RFC 2616 defines that the 'Location' HTTP headerconsists of an absolute URI
but the are many files that include:

//this script may only be included - so its better to die if called directly.
if 'SCRIPT_NAME',basename(FILE" class="wiki wikinew text-danger tips strpos">$_SERVER'SCRIPT_NAME',basename(FILE !== false) {
header('location: index.php');
exit;

For the moment I've got around it by changing absolute_urls.php from:

// check if the current port is not 80 or 443
if $_SERVER%22SERVER_PORT%22 {
if 'SERVER_PORT' != 80) && ($_SERVER'SERVER_PORT' != 443" class="wiki wikinew text-danger tips">$_SERVER'SERVER_PORT' != 80) && ($_SERVER'SERVER_PORT' != 443 {
if 'HTTPS') && $_SERVER'HTTPS' 'on'" class="wiki wikinew text-danger tips">isset($_SERVER'HTTPS') && $_SERVER'HTTPS' 'on' {
$prefs'https_port' = (int) $_SERVER'SERVER_PORT';
} else {
$prefs'http_port' = (int) $_SERVER'SERVER_PORT';
}
}

to

// check if the current port is not 80 or 443
if $_SERVER%22SERVER_PORT%22 {
$prefs'http_port' = $_SERVER%22SERVER_PORT%22 ;
if 'SERVER_PORT' != 80) && ($_SERVER'SERVER_PORT' != 443" class="wiki wikinew text-danger tips">$_SERVER'SERVER_PORT' != 80) && ($_SERVER'SERVER_PORT' != 443 {
if 'HTTPS') && $_SERVER'HTTPS' 'on'" class="wiki wikinew text-danger tips">isset($_SERVER'HTTPS') && $_SERVER'HTTPS' 'on' {
$prefs'https_port' = (int) $_SERVER'SERVER_PORT';
} else {
$prefs'http_port' = (int) $_SERVER'SERVER_PORT';
}
}

But I don't know if that is a suitable long-term fix.


I had the same problem and fixed it in another way:

Search the tiki database for http_port (should be in tiki_preferences)
Change the value to whatever port you changed to (or make it blank if unnecessary)


I'd forgotten all about this issue.. just as well you pinged that alternative - I was planning to upgrade & that would've broken it again.