infostreams / mbtiles-php

PHP backend for reading tiles from mbtiles databases
MIT License
125 stars 34 forks source link

Can we run this on 1and1?? #7

Closed atnightmaps closed 10 years ago

atnightmaps commented 10 years ago

we are trying to publish some maps in a 1and1 server but we have several problems htaccess works fine (i think) but i don't know if there's any missing or depreceated php module perhaps it helps http://atnight.ws/code/info.php5

1and1 is a very unconfortable hosting service with infinite limited capabilities (but cheap). Perhaps could be interesting recommend a hosting service working fine with this code.

infostreams commented 10 years ago

Good question. I didn't try 1and1 in a loooong time :-) Do you have a link to the page with the map you're trying to publish?

atnightmaps commented 10 years ago

Hi, this is the link http://atnight.ws/infostreams/ is the same example as you posted on github tell me what you need for a correct diagnosis

infostreams commented 10 years ago

Ah, well the javascript says your map is located at http://atnight.ws/infostreams/server/basemap.tilejson, but that gets me a 1and1 error page (do 'view source' or see view-source:http://atnight.ws/infostreams/server/basemap.tilejson). Also, if I try to access the servers main page at http://atnight.ws/infostreams/server/, then I get a 403 Access Forbidden error...

These are the things you need to fix first. The server should not return a 403 Forbidden Error, and if you request the basemap.tilejson file you should get some sort of JSON file (example: http://api.tiles.mapbox.com/v3/mapbox.geography-class.jsonp). If you get that going, then the rest will probably work as well. Let me know how it goes.

PS: You need to make sure that there is a basemap.mbtiles file in the server directory! Is there one?

atnightmaps commented 10 years ago

hi!! now you can access to the directory http://atnight.ws/infostreams/server/ i have modified the .htaccess now it looks just like that

Options +Indexes Options +FollowSymLinks Options -MultiViews RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ tileserver.php [QSA,L]

But i can't see the tiles neither the json

infostreams commented 10 years ago

Ah, it looks like your .htaccess file is not being parsed... I think you need to maybe change a setting (in your hosting provider's settings) somewhere to both allow .htaccess files and to enable mod_rewrite.

atnightmaps commented 10 years ago

YES, the problem is with the htaccess the directive Options +FollowSymLinks is not accepted in 1and1 shared servers

now i don't know if the tileserver.php can run without the hatccess, passing the arguments in the URL

infostreams commented 10 years ago

Try removing that option from the .htaccess and see what it does. I don't think it's that important in most cases. I see that you already did something to the .htaccess file, because the server's info page is now showing.

However, I don't think the tile requests (such as http://atnight.ws/infostreams/server/basemap.tilejson) end up at the tileserver.php file yet. I got an empty 1&1 error page just now. You can try putting something like

echo "This is the tileserver.php"; die;

at the top of tileserver.php (after <?php) to see if the requests are properly rewritten. If they don't, adjust the .htaccess to make sure that they do (fiddle with it until you see the message "This is the tileserver.php"). Once the individual requests end up at the tileserver.php, there's a good chance that you've managed to get it to work. If you see the message above, then it's time to remove the code you added and see if it works. If it doesn't work, then you've probably found a bug.

As it stands, the tileserver.php doesn't run without the .htaccess file, unfortunately. It would be possible to make it work but it requires a rewriting of some of the code.

atnightmaps commented 10 years ago

Effectively the problem is with some of the directives of the htaccess. The rewritte engine doesn't work fully in 1&1, even though they say opposite. The test doesn't has worked.

Now we are testing this beautyful code in http://www.serversfree.com/server-features/ and works fine. So if anyone wants to try it in an easy (and free) way this is a solution (but not very stable, sometimes this server is down)

Thanks infostreams!

infostreams commented 10 years ago

Ok, so I can close this issue I guess. I'm glad that you got it to work!