User Tools

Site Tools


guifi.net:desarrollo_web:instalacion

This is an old revision of the document!


http://acacha.org/mediawiki/index.php/Entorn_de_desenvolupament_guifi

http://es.wiki.guifi.net/wiki/Preparando_el_entorno_de_desarrollo

Instalar mapserver

apt-get install mapserver-bin cgi-mapserver

Repositorio guifimaps

https://gitorious.org/guifi/guifimaps

Pulsamos el botón de “Clone repository”

gitorious

Ahora vamos a nuestro disco duro y lo clonamos en local:

git clone git@gitorious.org:~joselegido/guifi/joselegido-guifimaps.git guifimaps

Dentro de la carpeta de guifimaps editamos el fichero refresh.php:

/mnt/raid/www/public/http/guifimaps/refresh.php
  $hlastnow = @fopen("http://guifi.net/guifi/refresh/maps", "r") or die('Error reading changes\n');
...
  $hlinks = @fopen("http://guifi.net/guifi/gml/".$rootZone."/links/csv", "r") or die("Error getting links cv\n");;
...
  $hnodes = @fopen("http://guifi.net/guifi/gml/".$rootZone."/nodes/csv", "r");

por

  $hlastnow = @fopen("http://guifidev.matarosensefils.net/guifi/refresh/maps", "r") or die('Error reading changes\n');
...
  $hlinks = @fopen("http://guifidev.matarosensefils.net/guifi/gml/".$rootZone."/links/csv", "r") or die("Error getting links cv\n");;
...
  $hnodes = @fopen("http://guifidev.matarosensefils.net/guifi/gml/".$rootZone."/nodes/csv", "r");

Copiar los mapas:
En el proyecto guifimaps no hay carpeta data. La creamos primero dentro de la carpeta guifimaps
Instalamos el paquete gdal-bin

Añadir al cron:

3,13,23,33,43,53 * * * * cd /mnt/raid/www/public/http/guifimaps; php refresh.php > /dev/null 2>&1; cd data; rm -rf dlinks/*; rm -rf dnodes/*; ogr2ogr -f "ESRI Shapefile" dlinks dlinks.gml; ogr2ogr -f "ESRI Shapefile" dnodes dnodes.gml
donquixot:/mnt/raid/www/public/http/guifimaps/data# cd /mnt/raid/www/public/http/guifimaps; php refresh.php > /dev/null 2>&1; cd data; rm -rf dlinks/*; rm -rf dnodes/*; ogr2ogr -f "ESRI Shapefile" dlinks dlinks.gml; ogr2ogr -f "ESRI Shapefile" dnodes dnodes.gml
FAILURE:
Unable to open datasource `dlinks.gml' with the following drivers.
  -> ESRI Shapefile
  -> MapInfo File
  -> UK .NTF
  -> SDTS
  -> TIGER
  -> S57
  -> DGN
  -> VRT
  -> REC
  -> Memory
  -> BNA
  -> CSV
  -> GML
  -> GPX
  -> KML
  -> GeoJSON
  -> Interlis 1
  -> Interlis 2
  -> GMT
  -> SQLite
  -> DODS
  -> ODBC
  -> PGeo
  -> OGDI
  -> PostgreSQL
  -> MySQL
  -> PCIDSK
  -> XPlane
  -> AVCBin
  -> AVCE00
  -> DXF
  -> Geoconcept
  -> GeoRSS
  -> GPSTrackMaker
  -> VFK
FAILURE:
Unable to open datasource `dnodes.gml' with the following drivers.
  -> ESRI Shapefile
  -> MapInfo File
  -> UK .NTF
  -> SDTS
  -> TIGER
  -> S57
  -> DGN
  -> VRT
  -> REC
  -> Memory
  -> BNA
  -> CSV
  -> GML
  -> GPX
  -> KML
  -> GeoJSON
  -> Interlis 1
  -> Interlis 2
  -> GMT
  -> SQLite
  -> DODS
  -> ODBC
  -> PGeo
  -> OGDI
  -> PostgreSQL
  -> MySQL
  -> PCIDSK
  -> XPlane
  -> AVCBin
  -> AVCE00
  -> DXF
  -> Geoconcept
  -> GeoRSS
  -> GPSTrackMaker
  -> VFK

Copiamos el fichero binario de mapserver:

# cp /usr/lib/cgi-bin/mapserv /mnt/raid/www/public/http/guifimaps/cgi-bin/

Añadimos al virtualhost:

ScriptAlias /cgi-bin/ "/mnt/raid/www/public/http/guifimaps/cgi-bin/"

http://maps.matarosensefils.net/cgi-bin/mapserv?map=/mnt/raid/www/public/http/guifimaps/GMap.map

http://guifidev.matarosensefils.net/ca/admin/settings/guifi

El usuario administrador será “webmestre” y la contraseña “guifi”.

Modificación opciones mapa

Para que funcione, he descargado GMap.map de producción de:

http://maps.guifi.net/GMap.map

Descargado también:

http://maps.guifi.net/guifi_symbols.sym

He creado el fichero vacio web.html:

/mnt/raid/www/public/http/guifimaps/web.html

He tenido que crear la carpeta:

/tmp/ms_tmp

En ca/admin/settings/guifi

URL for WMS service:
http://guifi.net/cgi-bin/mapserv?map=/home/guifi/maps.guifi.net/guifimaps/GMap.map

URL for maps module:
http://maps.guifi.net

Cambiar por las locales

Google maps key

http://code.google.com/apis/maps/signup.html

ABQIAAAAc_9onakTMYFPkm8AOLxVtxRB-teqlm_auOpyOeRPFLJzLncjFhRxnAPMceDQc12XIBzD6KSVU0QFPg

Se cambia aquí

http://guifidev.matarosensefils.net/ca/admin/settings/guifi
guifi.net/desarrollo_web/instalacion.1329058678.txt.gz · Last modified: 2015/04/13 20:19 (external edit)