Hello!
If I want to host all the OSM tiles on my own server, are there any solutions that I can follow as a guide? Thanks!
Hello!
If I want to host all the OSM tiles on my own server, are there any solutions that I can follow as a guide? Thanks!
Unless your server has enormous capacity there’s no way you could host all the tiles!
TileDrawer offers a way to leverage Amazon EC2 instances to generate tiles cheaply, quickly and using a custom stylesheet. These are served through TileCache which will take care of caching tiles that have been rendered and tiles that haven’t been rendered are created on demand.
Thank Alex McKee. If I just want to host the tiles of one country, e.g. Sweden, can I do that? I have a server with 42G memory and 2T harddisk. I can download the tiles from cloudmade.com, but don’t know how to host the tiles. Thanks again.
Your server is very capable, and could even host the planet if necessary. It will easily handle a single country - with power left over for other analysis or development if necessary.
I would also recommend the TileDrawer if all you need is serving tiles. But if you want to do other things, the very long process of server setup may be worthwhile. For reference, an overview is at -
http://wiki.openstreetmap.org/wiki/Develop
Also, the following is a good reference; as you can see from the comments - the exact install procedure is very dependent on the OS and version of the OS that you will be using:
http://www.weait.com/content/build-your-own-openstreetmap-server
Also, because raw tile images are so large, they are generally not available for download on a mass scale, such as for a country.
If you want to have all tiles for an entire country, then generally it is best to render them your self. With 2T of disk, you probably can do it for a country, but for the entire world it is not possible, which is why neither the OSM tile server, nor CloudMade have all tiles rendered but render on the fly when tiles are requested (and not yet cached). However that is also why OSM’s tileserver and probably cloudmades too (although I don’t know in that case) won’t like/allow you to download a whole country as it will have to render and store all the tiles for which the majority will never get looked at. http://wiki.openstreetmap.org/wiki/Tile_Disk_Usage gives you an overview of how little actually gets stored for the higher zoom levels. Of cause, most of that is ocean, so the percentage would be higher for a country, but my guess would still be no where close to 100%.
It is not all that bad to set up your own rendering though. E.g. http://wiki.openstreetmap.org/wiki/Mapnik gives an overview of how to set up your own rendering with mapnik and a postGIS database. Alternatively, you might be able to download the entire tiles from cloudmade, but you would need to ask beforehand to check if it is ok.
Actually serving tiles then to users can be done in two ways. If you pre generate all your tiles, you can simply use a standard webserver. The tiles get generated in the directory structure that is used by the webmaps (yourtilserver.com/z/y/x.png). The other method, that the OSM-tileserver uses, is a special apache module mod_tile. It is needed as it both does the tile serving from a disk cache and drive the on-the-fly rendering process where tiles are missing from the cache. Very similar as Tiledrawer.com does it, but doesn’t use Amazon EC2.