Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tiles attempt loading from 127.0.0.1 -- no obvious hostname config #30

Closed
jywarren opened this issue May 17, 2011 · 7 comments
Closed

Comments

@jywarren
Copy link

I booted up tilestream at:

http://tilestream.publiclaboratory.org/

and at first, one tileset worked and one showed up grey. Now both are failing to load, and I'm getting "Failed to load resource: Could not connect to the server." for 8.png,

I realized it's requesting them from 127.0.0.1, not tilestream.publiclaboratory.org. I tried grepping around but couldn't find either an obvious place to change 127.0.0.1 or instructions or examples on the config JSON file ... also i noticed "localhost" was hardcoded in many places, though i imagine that's just internal references between the ui server and other parts.

This is probably a really minor thing but could someone post an example config JSON file? that ought to clear things up. And/or providing for a host as a commandline flag.

Thanks! Great stuff.

@springmeyer
Copy link
Contributor

Hey @jywarren. If you want to mount on port 80 you should be able to do (i think references to localhost should be harmless and only used if logging it turned on - its default off):

sudo ./bin/tilestream --config config.json
{
  "uiPort":80,
  "tilePort":80
}

Though it looks like there is a subtle bug, whereby the tileserver is not mounting on the proper port (if you supply different ports for tiles vs ui).

This does not work (because tiles still mount on 8000):

./bin/tilestream --config config.json
{
  "uiPort":8000,
  "tilePort":8001
}

@springmeyer
Copy link
Contributor

re: possible issues with hostnames, do you have a local dns or any edits to /etc/hosts?

@jywarren
Copy link
Author

hey dane -- actually the port # is not so important, i'm just running a reverse proxy on Apache to point it back. The ul loads, it's just the tiles themselves that are routed to 127.0.0.1. I am running it from my server and accessing it from my laptop. So if i had run it locally it would work fine -- maybe that's why the issue is not coming up for most people? Somewhere, the tile URLS are being generated for 127.0.0.1. I thought i'd found it at the bottom of /modules/tilelive.js/bin/tilelive_server.js, (i'm running the master-ndistro branch), but i wasnt sure that's what's generating the OpenLayers UI.

@jywarren
Copy link
Author

and to answer your Q, no, no local DNS or hostfile edits.

@jywarren
Copy link
Author

I guess i'm looking for some config for the uiserver that looks like:

host: tilestream.publiclaboratory.org

@yhahn
Copy link
Contributor

yhahn commented May 18, 2011

Hey @jywarren,

TileStream by default has no explicit host configuration -- instead, it expects that the HTTP request being made against it provides a proper Host header.

My guess is that the Apache reverse proxy on your server is stripping this header from the requests that your laptop is making. Perhaps you can try setting the mod_proxy ProxyPreserveHost directive as documented here?

http://httpd.apache.org/docs/2.0/mod/mod_proxy.html#proxypreservehost

@jywarren
Copy link
Author

That worked perfectly! I hadn't thought of that, though it was indeed odd that i couldn't find a reference to 127.0.0.1 in the tilestream source tree. Good catch.

http://tilestream.publiclaboratory.org/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

3 participants