Site is different when not on intranet

# 11 Old 08-19-2007, 08:01 PM
Graham Graham is offline Graham's reputation Graham is on a distinguished road » Community Member
Join Date: Aug 2007 Posts: 139
Any progress on this?
# 12 Old 08-20-2007, 06:30 AM
SteveB SteveB is online now SteveB's reputation SteveB has a reputation beyond reputeSteveB has a reputation beyond reputeSteveB has a reputation beyond repute » MindTouch Team
Join Date: Jul 2006 Location: San Diego, CA Posts: 4,949
Not yet, sorry. Will keep you posted.
Steve G. Bjorg - Chief Architect
Did you check the MindTouch Deki FAQ?
Found a bug? Report it.
Follow me on Twitter
Find us on IRC: irc.freenode.net #mindtouch
# 13 Old 08-22-2007, 08:54 PM
SteveB SteveB is online now SteveB's reputation SteveB has a reputation beyond reputeSteveB has a reputation beyond reputeSteveB has a reputation beyond repute » MindTouch Team
Join Date: Jul 2006 Location: San Diego, CA Posts: 4,949
Yeah! Found out what the problem is.

Good news: it's not a problem with Deki Wiki. So, you can easily resolve it without needing new bits.

Here is the problem: when you connect to Deki Wiki, PHP inherits the hostname and uses it to contact the API. This works wonderfully when the hostname is resolvable by both the browser and the VM. However, that's generally not the case in NAT scenarios.

So, how can you fix this? Easy. Open 'LocalSettings.php' and add the following line:
Code:
$wgDreamServer = "http://localhost";
Alternatively, if you're using hostnames (e.g. 'http://mywiki') to reach your wiki site, you can also add this hostname to your VM so that it will resolve it correctly when it sees it, but you'll need to do so for each wiki hostname.

Let me know if this resolved the issue for you as well.
Steve G. Bjorg - Chief Architect
Did you check the MindTouch Deki FAQ?
Found a bug? Report it.
Follow me on Twitter
Find us on IRC: irc.freenode.net #mindtouch
# 14 Old 08-22-2007, 09:06 PM
SteveB SteveB is online now SteveB's reputation SteveB has a reputation beyond reputeSteveB has a reputation beyond reputeSteveB has a reputation beyond repute » MindTouch Team
Join Date: Jul 2006 Location: San Diego, CA Posts: 4,949
Hmm, unfortunately. This seems to only solve part of the problem...
Steve G. Bjorg - Chief Architect
Did you check the MindTouch Deki FAQ?
Found a bug? Report it.
Follow me on Twitter
Find us on IRC: irc.freenode.net #mindtouch
# 15 Old 08-22-2007, 09:21 PM
merktnichts merktnichts is offline merktnichts's reputation merktnichts is on a distinguished road » Community Member
Join Date: Jul 2007 Posts: 347
The LocalSettings.php tweak only works for the deki frontpage, but not for deeper pages. So that one is unusable.

The /etc/hosts workaround seems to work for me, all pages are displayed correctly then. That manual way is not a real problem, as the hostname changes rarely (read: never) anyway. Of course, if it can be solved "automatically" in dream/deki without manual hosts-tweaks, I wouldn't say no to such a fix.
For those who are interested, the entry in /etc/hosts would be
Code:
127.0.0.1	localhost deki
Note: This is for using e.g. "http://deki" in the local network. I can't speak for Graham's problem.
# 16 Old 08-22-2007, 09:23 PM
SteveB SteveB is online now SteveB's reputation SteveB has a reputation beyond reputeSteveB has a reputation beyond reputeSteveB has a reputation beyond repute » MindTouch Team
Join Date: Jul 2006 Location: San Diego, CA Posts: 4,949
Ok, there is a bug in dream.php which prevents it from doing the right thing. So, while the wiki page will show, all the links on it will be bad.

open includes/dream.php and apply the following change:
Code:
--- includes/dream.php  (revision 5258)
+++ includes/dream.php  (working copy)
@@ -101,10 +101,7 @@
                                $this->query = '';
                        }
                        $this->query .= 'dream.out.format=' . rawurlencode($output);
-                       if (isset($this->host)) {
-                               $this->query .= '&dream.in.host=' . rawurlencode($this->host);
-                       }
-                       elseif (isset($_SERVER['HTTP_HOST'])) {
+                       if (isset($_SERVER['HTTP_HOST'])) {
                                $this->query .= '&dream.in.host=' . rawurlencode($_SERVER['HTTP_HOST']);
                        }
                        if (isset($_SERVER['REMOTE_ADDR'])) {
This will remove the first 'if' statement that checks for the 'host' name being present in the URI. That hostname is not valid, instead we have to pass along the hostname provided by the host header. (For those who care about the details )
Steve G. Bjorg - Chief Architect
Did you check the MindTouch Deki FAQ?
Found a bug? Report it.
Follow me on Twitter
Find us on IRC: irc.freenode.net #mindtouch
# 17 Old 08-22-2007, 09:30 PM
merktnichts merktnichts is offline merktnichts's reputation merktnichts is on a distinguished road » Community Member
Join Date: Jul 2007 Posts: 347
Indeed, that diff seems to do the trick. I didn't check it thoroughly, but the handful of pages I clicked are showing ok so far.
Thanks, Steve!
# 18 Old 08-23-2007, 05:29 AM
Graham Graham is offline Graham's reputation Graham is on a distinguished road » Community Member
Join Date: Aug 2007 Posts: 139
I had a look in my vmware image at

var/www/deki-hayes/includes/dream.php at lines 101 et sequitur

and the lines to remove ( - ? ) don't correspond with what I see.

Will there be an updated vmware image soon?

PS: just saw Royk's announce regarding Friday.
# 19 Old 08-23-2007, 07:04 AM
royk royk is online now royk's reputation royk has a reputation beyond reputeroyk has a reputation beyond repute » MindTouch Team
Join Date: Feb 2007 Posts: 1,873
Quote: Originally Posted by Graham View Post I had a look in my vmware image at

var/www/deki-hayes/includes/dream.php at lines 101 et sequitur

and the lines to remove ( - ? ) don't correspond with what I see.
Just find that code block - the line # may not match up exactly, but it should be in the same area.
# 20 Old 11-21-2007, 03:45 AM
yoink yoink is offline yoink's reputation yoink is on a distinguished road » Newcomer
Join Date: Nov 2007 Posts: 3
Quote: Originally Posted by SteveB View Post Ok, there is a bug in dream.php which prevents it from doing the right thing. So, while the wiki page will show, all the links on it will be bad.

open includes/dream.php and apply the following change:
CODE REMOVED IN THE INTEREST OF BREVITY

This will remove the first 'if' statement that checks for the 'host' name being present in the URI. That hostname is not valid, instead we have to pass along the hostname provided by the host header. (For those who care about the details )
I bet you have never run a dekiwiki inside a nat and on a strange port using SSL and http basic auth

I have a heavily loaded single IP address and so I used a port to make dekiwiki accessible to the outside world (think FQDN:8080). And as I mentioned, I made it SSL, and I added http basic auth.

As the original poster stated, I had no trouble accessing dekiwiki inside the NAT, but once I tried to hit it from the outside with all that extra garbage, I could never login. I have the latest tarball (as of 2007-11-20) so my dream.php already had the above patch included.

Looking at the trace output, I could see that the dream.in.host was getting set to FQDN:8080. I assumed that the API does not speak SSL and this was what was causing the login to fail. I manually edited dream.php to remove $_SERVER['HTTP_HOST'] and replaced it with the string literal 'FQDN' and I can now login. I have not tested everything yet, but I will start looking at it now.

Please let me know if you would like more gory details.
Page 2 of 3 < 1 2 3 >

Thread Tools

Search this Thread

Search this Thread Advanced Search

Display Modes

Powered by MindTouch 2010