Changes between Initial Version and Version 1 of GIS/InstallationGuidelines/Linux


Ignore:
Timestamp:
08/31/10 11:32:02 (14 years ago)
Author:
Fran Boon
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • GIS/InstallationGuidelines/Linux

    v1 v1  
     1[[TOC]]
     2= Installation of GIS Tools on Linux =
     3
     4Suggest these CLI tools for data manipulation:
     5 * GDAL's ogr2ogr, etc
     6 * [http://mpa.itc.it/rs/srtm/srtm_generate_hdr.sh Convert SRTM to GeoTIFF]
     7
     8== PostGIS ==
     9 * [http://postgis.refractions.net PostGIS] adds Spatial storage to [http://www.postgresql.org PostgreSQL]
     10{{{
     11apt-get install postgresql-8.3-postgis
     12su postgres
     13createdb gis
     14createlang plpgsql gis
     15psql -d gis -f /usr/share/postgresql-8.3-postgis/lwpostgis.sql
     16psql -d gis -f /usr/share/postgresql-8.3-postgis/spatial_ref_sys.sql
     17}}}
     18 * Add Spherical Mercator projection (900913. See http://www.cadmaps.com/gisblog/?p=81 for 54004):
     19{{{
     20psql gis
     21INSERT into spatial_ref_sys (srid, auth_name, auth_srid, srtext, proj4text) values (900913 ,'EPSG',900913,'GEOGCS["WGS 84", DATUM["World Geodetic System 1984", SPHEROID["WGS 84", 6378137.0, 298.257223563,AUTHORITY["EPSG","7030"]], AUTHORITY["EPSG","6326"]],PRIMEM["Greenwich", 0.0, AUTHORITY["EPSG","8901"]], NIT["degree",0.017453292519943295], AXIS["Longitude", EAST], AXIS["Latitude", NORTH],AUTHORITY["EPSG","4326"]], PROJECTION["Mercator_1SP"],PARAMETER["semi_minor", 6378137.0], PARAMETER["latitude_of_origin",0.0], PARAMETER["central_meridian", 0.0], PARAMETER["scale_factor",1.0], PARAMETER["false_easting", 0.0], PARAMETER["false_northing", 0.0],UNIT["m", 1.0], AXIS["x", EAST], AXIS["y", NORTH],AUTHORITY["EPSG","900913"]] |','+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +no_defs');
     22}}}
     23 * Allow remote access:
     24{{{
     25vim /etc/postgresql/8.3/main/postgresql.conf
     26listen_addresses = '*'
     27
     28/etc/init.d/postgresql-8.3 restart
     29
     30vim /etc/iptables.rules
     31-A INPUT -p tcp --dport 5432 -j ACCEPT
     32
     33reboot
     34}}}
     35----
     36Alternatively these can be installed as part of [http://opengeo.org/community/suite/download/ OpenGeoSuite]
     37
     38== Java ==
     39{{{
     40vim /etc/apt/sources.list
     41# for sun-java packages in unstable
     42deb http://ftp.debian.org/debian/ unstable non-free
     43deb-src http://ftp.debian.org/debian/ unstable non-free
     44
     45apt-get update
     46apt-get install sun-java6-jdk
     47vim /etc/profile
     48JAVA_HOME=/usr/lib/jvm/java-6-sun
     49export JAVA_HOME
     50}}}
     51or:
     52 * [http://java.sun.com/javase/downloads/widget/jdk6.jsp Download the JDK] & install it:
     53{{{
     54cd /usr/local
     55sh ~/jdk-6u21-linux-i586.bin
     56ln -sf /usr/local/jdk1.6.0_21 /usr/local/java
     57vim /etc/profile
     58JAVA_HOME=/usr/local/java
     59export JAVA_HOME
     60}}}
     61
     62== Apache Tomcat ==
     63[http://tomcat.apache.org Tomcat] is the recommended way to deploy Java applications
     64 * [http://www.debianadmin.com/how-to-setup-apache-tomcat-55-on-debian-etch.html Debian]:
     65{{{
     66apt-get install sun-java6-jdk tomcat5.5 libapache2-mod-jk
     67a2enmod jk
     68vim /etc/libapache2-mod-jk/workers.properties
     69workers.java_home=/usr/lib/jvm/java-6-sun
     70
     71vim /etc/init.d/tomcat5.5
     72TOMCAT5_SECURITY=no
     73/etc/init.d/tomcat5.5 restart
     74}}}
     75
     76== WMS/WFS ==
     77=== [http://geoserver.org GeoServer] ===
     78(recommended)
     79
     80{{{
     81apt-get install unzip
     82wget http://downloads.sourceforge.net/project/geoserver/GeoServer/2.0.2/geoserver-2.0.2-war.zip
     83
     84cd /var/lib/tomcat5.5/webapps
     85unzip ~/geoserver-2.0.2-war.zip
     86
     87/etc/init.d/tomcat5.5 restart
     88
     89vim /etc/iptables.rules
     90-A INPUT -p tcp --dport 8180 -j ACCEPT
     91
     92reboot
     93}}}
     94
     95http://geo.host.domain:8180/geoserver
     96 * l: admin
     97 * p: geoserver
     98Change the password
     99
     100or
     101{{{
     102wget http://downloads.sourceforge.net/project/geoserver/GeoServer/2.0.2/geoserver-2.0.2-bin.zip
     103cd /usr/local
     104unzip ~/geoserver-2.0.2-bin.zip
     105ln -sf /usr/local/geoserver-2.0.2 /usr/local/geoserver
     106
     107vim /etc/profile
     108GEOSERVER_HOME=/usr/local/geoserver
     109export GEOSERVER_HOME
     110
     111vim /etc/rc.local
     112/usr/local/geoserver/bin/startup.sh &
     113
     114vim /etc/iptables.rules
     115-A INPUT -p tcp --dport 8080 -j ACCEPT
     116
     117reboot
     118}}}
     119http://geo.host.domain:8080/geoserver
     120
     121Configure:
     122 * http://docs.geoserver.org/stable/en/user/production/index.html
     123   
     124=== [http://mapserver.org MapServer] ===
     125 * [http://www.tinyows.org TinyOWS] can complement this for WFS-T
     126
     127== Printing ==
     128For Printing TMS layers, need to compile the Trunk version of the [http://www.mapfish.org/doc/print/ MapFish Print Module] & then serve the resultant .war with [http://tomcat.apache.org Tomcat]:
     129 1. Ensure that {{{JAVA_HOME}}} points to a JDK.
     130 2. Download & build source:
     131{{{
     132svn checkout http://www.mapfish.org/svn/mapfish/print/trunk/
     133cd trunk
     134./gradlew build
     135}}}
     136 3. Configure Tomcat
     137{{{
     138vim /etc/tomcat5.5/policy.d/04webapps.policy
     139permission java.io.FilePermission "/var/lib/tomcat5.5/webapps/print-servlet-1.2-SNAPSHOT/WEB-INF/classes/logging.properties", "read";
     140
     141/etc/init.d/tomcat5.5 restart
     142
     143vim /etc/apache2/sites-available/print
     144
     145
     146ln -s /etc/apache2/sites-available/print /etc/apache2/sites-enabled/print
     147/etc/init.d/apache2 restart
     148}}}
     149 4. Copy the WAR file to your %WEBAPPS% directory:
     150{{{
     151cp trunk/build/libs/print-servlet-1.2-SNAPSHOT.war /var/lib/tomcat5.5/webapps
     152}}}
     153 5. (re)Start Tomcat
     154 6. Configure the Map URL for Eden to:
     155  * http://host.domain:8180/print-servlet-1.2-SNAPSHOT/pdf/
     156 7. Configure %WEBAPPS%\print-servlet-1.2-SNAPSHOT\config.yaml: http://www.mapfish.org/doc/print/configuration.html
     157
     158Printing can also be done within !GeoServer:
     159 * http://geoserver.org/display/GEOS/Printing+2.0+HOWTO
     160However this version doesn't yet support TMS layers, like !OpenStreetMap.
     161{{{
     162wget http://geoserver.org/download/attachments/20938936/printing-2.0.x.zip
     163wget http://geoserver.org/download/attachments/20938936/printing-data-2.0.x.zip
     164cd /usr/local/geoserver-2.0.2/webapps/geoserver/WEB-INF/lib
     165unzip ~/printing-2.0.x.zip
     166cd /usr/local/geoserver-2.0.2/data_dir
     167unzip ~/printing-data-2.0.x.zip
     168/usr/local/geoserver/bin/shutdown.sh
     169/usr/local/geoserver/bin/startup.sh &
     170}}}
     171   * Configure by editing {{{/usr/local/geoserver-2.0.2/data_dir/printing/config.yaml}}} according to [http://trac.mapfish.org/trac/mapfish/wiki/PrintModuleServer Documentation]
     172
     173=== Print to Image ===
     174 * http://trac.mapfish.org/trac/mapfish/ticket/161
     175
     176== Cache ==
     177 * http://mapproxy.org
     178  * http://mapproxy.org/docs/latest/install.html
     179{{{
     180wget http://effbot.org/downloads/Imaging-1.1.7.tar.gz
     181tar zxvf Imaging-1.1.7.tar.gz
     182cd Imaging-1.1.7
     183python setup.py install
     184cd ..
     185
     186wget http://pyproj.googlecode.com/files/pyproj-1.8.6.tar.gz
     187tar zxvf pyproj-1.8.6.tar.gz
     188cd pyproj-1.8.6
     189python setup.py install
     190cd ..
     191
     192wget http://pyyaml.org/download/pyyaml/PyYAML-3.09.tar.gz
     193tar zxvf PyYAML-3.09.tar.gz
     194cd PyYAML-3.09
     195python setup.py install
     196cd ..
     197
     198wget http://pypi.python.org/packages/source/J/Jinja2/Jinja2-2.1.1.tar.gz
     199tar zxvf Jinja2-2.1.1.tar.gz
     200cd Jinja2-2.1.1
     201python setup.py install
     202cd ..
     203
     204wget http://pypi.python.org/packages/source/f/flup/flup-1.0.3.dev-20100525.tar.gz
     205tar zxvf flup-1.0.3.dev-20100525.tar.gz
     206cd flup-1.0.3.dev-20100525
     207python setup.py install
     208cd ..
     209
     210wget http://pypi.python.org/packages/source/P/Paste/Paste-1.7.4.tar.gz
     211tar zxvf Paste-1.7.4.tar.gz
     212cd Paste-1.7.4
     213python setup.py install
     214cd ..
     215
     216wget http://pypi.python.org/packages/source/P/PasteDeploy/PasteDeploy-1.3.3.tar.gz
     217tar zxvf PasteDeploy-1.3.3.tar.gz
     218cd PasteDeploy-1.3.3
     219python setup.py install
     220cd ..
     221
     222wget http://pypi.python.org/packages/source/P/PasteScript/PasteScript-1.7.3.tar.gz
     223tar zxvf PasteScript-1.7.3.tar.gz
     224cd PasteScript-1.7.3
     225python setup.py install
     226cd ..
     227
     228wget http://pypi.python.org/packages/source/M/MapProxy/MapProxy-0.8.4.tar.gz
     229tar zxvf MapProxy-0.8.4.tar.gz
     230cd MapProxy-0.8.4
     231python setup.py install
     232cd ..
     233
     234cd /home
     235paster create -t mapproxy_conf mapproxy
     236}}}
     237  * http://code.google.com/p/modwsgi/wiki/IntegrationWithPylons
     238{{{
     239wget http://pypi.python.org/packages/source/C/ConcurrentLogHandler/ConcurrentLogHandler-0.8.4.tar.gz
     240tar zxvf ConcurrentLogHandler-0.8.4.tar.gz
     241cd ConcurrentLogHandler-0.8.4
     242python setup.py install
     243cd ..
     244
     245mkdir /var/www/.python-eggs
     246chown www-data /var/www/.python-eggs
     247
     248vim /home/mapproxy/mapproxy.py
     249import os, sys
     250from paste.script.util.logging_config import fileConfig
     251BASEDIR = os.path.dirname(__file__)
     252INIFILE = os.path.join(BASEDIR, 'etc', 'config.ini')
     253LOGFILE = os.path.join(BASEDIR, 'etc', 'log_deploy.ini')
     254sys.path.append(BASEDIR)
     255os.environ['PYTHON_EGG_CACHE'] = '/var/www/.python-eggs'
     256fileConfig( LOGFILE )
     257from paste.deploy import loadapp
     258application = loadapp('config:%s' % INIFILE)
     259
     260vim /etc/apache2/sites-available/proxy
     261<VirtualHost *:80>
     262  ServerName proxy.sahanafoundation.org
     263  ServerAdmin webmaster@sahanafoundation.org
     264 
     265  WSGIScriptAlias / /home/mapproxy/mapproxy.py
     266  WSGIDaemonProcess mapproxy user=www-data group=www-data home=/home/mapproxy processes=2 maximum-requests=100
     267 
     268  <Location "/">
     269    Order deny,allow
     270    Allow from all
     271    WSGIProcessGroup mapproxy
     272  </Location>
     273
     274  ErrorLog /var/log/apache2/proxy_error.log
     275  LogLevel warn
     276  CustomLog /var/log/apache2/proxy_access.log combined
     277</VirtualHost>
     278
     279cd /etc/apache2/sites-enabled
     280ln -s ../sites-available/proxy
     281/etc/init.d/apache2 force-reload
     282}}}
     283  * http://mapproxy.org/docs/latest/configuration.html
     284{{{
     285
     286}}}
     287
     288 * http://tilecache.org
     289  * http://github.com/migurski/GridTile
     290
     291 * http://geowebcache.org
     292  * e.g. included as part of [http://opengeo.org/community/suite/download/ OpenGeoSuite]
     293