User Tools

Site Tools


guifi.net:desarrollo_web:instalacion

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
guifi.net:desarrollo_web:instalacion [2012/02/11 18:57] joseguifi.net:desarrollo_web:instalacion [2015/04/13 20:19] (current) – external edit 127.0.0.1
Line 39: Line 39:
 Instalamos el paquete gdal-bin Instalamos el paquete gdal-bin
  
-Añadir al cron: +Crear el siguiente fichero para que funcione el comando: 
-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+  php refresh.php 
 + 
 +  touch /tmp/last_update 
 + 
 +**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 
 + 
 +Vamos a /mnt/raid/www/public/http/guifimaps 
 + 
 +Creamos la carpeta data en dos sitios: 
 +/mnt/raid/www/public/http/guifimaps/data 
 +/mnt/raid/www/public/http/data 
 + 
 +Descargamos los ficheros: 
 +  wget http://maps.guifi.net/data/dnodes.gml 
 +  wget http://maps.guifi.net/data/dlinks.gml 
 + 
 +  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 
 + 
 +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 
 +y le quitamos la linea 16 
 + 
 +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 
 + 
 +====== Para que se vean las capas ====== 
 +Si abrimos la página de maps con firebug, veremos que hace llamadas a urls del tipo: 
 +  http://maps.matarosensefils.net/cgi-bin/mapserv?map=/mnt/raid/www/public/http/guifimaps/GMap.map&REQUEST=GetMap&SERVICE=WMS&VERSION=1.1.1&LAYERS=Nodes,Links&FORMAT=image/png&BGCOLOR=0xFFFFFF&TRANSPARENT=TRUE&SRS=EPSG:4326&BBOX=2.548828125,41.57436130598913,2.5927734375,41.60722821271716&WIDTH=256&HEIGHT=256 
 +Si las lanzamos individualmente veremos que da el error:
  
 <code> <code>
-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 Shapefiledlinks dlinks.gml; ogr2ogr -f "ESRI Shapefilednodes dnodes.gml +<?xml version='1.0' encoding="ISO-8859-1standalone="no?> 
-FAILURE: +<!DOCTYPE ServiceExceptionReport SYSTEM "http://schemas.opengis.net/wms/1.1.1/exception_1_1_1.dtd"
-Unable to open datasource `dlinks.gml' with the following drivers. +<ServiceExceptionReport version="1.1.1"
-  -> ESRI Shapefile +<ServiceException
-  -> MapInfo File +msWMSDispatch()WMS server errorWMS request not enabledCheck wms/ows_enable_request settings
-  -> UK .NTF +</ServiceException
-  -SDTS +</ServiceExceptionReport>
-  -> 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+
 </code> </code>
  
 +Puede ser por la versión de mapserv. En el fichero GMap.map en el apartado WEB METADATA tenemos que añadir la linea:
 +  OWS_ENABLE_REQUEST "*"
 +Quedará mas o menos así:
 +
 +<code>
 +WEB
 +  TEMPLATE "web.html"
 +  IMAGEPATH "/tmp/ms_tmp/"
 +  IMAGEURL "/tmp/"
 + #*************-Afegit IDEC--Descripició de les capacitats
 +  METADATA
 +    OWS_ENABLE_REQUEST "*"
 +    WMS_TITLE "Nodes GUIFI.NET"
 +    WMS_ABSTRACT "Localització de nodes"
 +    WMS_FEATURE_INFO_MIME_TYPE  "text/html"
 +    WMS_ONLINERESOURCE "http://maps.matarosensefils.net/cgi-bin/mapserv?map=/mnt/raid/www/public/http/guifimaps/GMap.map&"
 +    WMS_SRS "EPSG:4326 EPSG:23031"
 +  END
 + #*************-Final afegit
 +END
 +</code>
guifi.net/desarrollo_web/instalacion.1328986659.txt.gz · Last modified: 2015/04/13 20:19 (external edit)