===== 2009-08-28 ===== ==== Connexion ==== $ slogin -CX maposmatic@maposmatic.org maposmatic@maposmatic.org's password: xxxxxxxxxxxx $ sudo aptitude update [sudo] password for maposmatic: xxxxxxxxxxxx ==== PostGIS et Postgresql ==== $ sudo aptitude install postgresql-8.3-postgis The following NEW packages will be automatically installed: libgeos-c1 libgeos2c2a postgis postgresql-8.3 postgresql-client-8.3 postgresql-client-common postgresql-common proj The following NEW packages will be installed: libgeos-c1 libgeos2c2a postgis postgresql-8.3 postgresql-8.3-postgis postgresql-client-8.3 postgresql-client-common postgresql-common proj 0 packages upgraded, 9 newly installed, 0 to remove and 0 not upgraded. === Mot de passe === $ pwgen --no-capitalize 16 === Utilisateur Postgres === $ sudo -u postgres createuser -P maposmatic Enter password for new role: yyyyyyyyyyyyyyyy Enter it again: yyyyyyyyyyyyyyyy Shall the new role be a superuser? (y/n) n Shall the new role be allowed to create databases? (y/n) n Shall the new role be allowed to create more new roles? (y/n) n === Base === Selon http://wiki.openstreetmap.org/wiki/Mapnik/PostGIS $ sudo -u postgres createdb -E UTF8 -O maposmatic maposmatic === Autorisations === La configuration de postgresql est inchangée (car convenable). $ sudo less /etc/postgresql/8.3/main/pg_hba.conf (Extraits) # Database administrative login by UNIX sockets local all postgres ident sameuser # TYPE DATABASE USER CIDR-ADDRESS METHOD # "local" is for Unix domain socket connections only local all all ident sameuser # IPv4 local connections: host all all 127.0.0.1/32 md5 # IPv6 local connections: host all all ::1/128 md5 === Test de connexion === $ psql -h localhost -U maposmatic maposmatic Password for user maposmatic: yyyyyyyyyyyyyyyy Welcome to psql 8.3.7, the PostgreSQL interactive terminal. Type: \copyright for distribution terms \h for help with SQL commands \? for help with psql commands \g or terminate with semicolon to execute query \q to quit === Activation de PostGIS pour la base === Selon /usr/share/doc/postgis/README.postgis.gz. Et, pour spatial_ref_sys.sql : http://postgis.refractions.net/documentation/manual-1.4/ch02.html#id2532099 $ sudo -u postgres createlang plpgsql maposmatic $ sudo -u postgres psql -f /usr/share/postgresql-8.3-postgis/lwpostgis.sql -d maposmatic $ sudo -u postgres psql -f /usr/share/postgresql-8.3-postgis/spatial_ref_sys.sql -d maposmatic $ sudo -u postgres psql -f /usr/share/postgresql/8.3/contrib/_int.sql -d maposmatic # module 'intarray' pour le support des diffs $ echo "ALTER TABLE geometry_columns OWNER TO maposmatic; ALTER TABLE spatial_ref_sys OWNER TO maposmatic;" | sudo -u postgres psql -d maposmatic ==== Stow pour d2 ==== $ sudo aptitude install stow $ mkdir -p apps/stow Utiliser ''--prefix=/home/maposmatic/apps/stow/le-nom-la-version/''. $ cd ~/apps/stow $ stow le-nom-la-version Puis aussi ''/home/maposmatic/apps/bin'' dans le $PATH, ''/home/maposmatic/apps/lib'' dans le $LD_LIBRARY_PATH, et ''/home/maposmatic/apps/lib/python2.5/site-packages'' dans le $PYTHONPATH. ==== Import par osm2pgsql ==== $ sudo aptitude -R install osm2pgsql Setting up osm2pgsql (0.08.20071007-1) ... Il n'a pas l'option ''-m'' pour la projection de Mercator. Donc recompilation à partir des sources avec Stow. $ sudo aptitude purge osm2pgsql === Compilation à partir des sources === == Répertoire download pour d2 == $ mkdir download $ cd download == Sources et compilation avec Stow == Selon http://wiki.openstreetmap.org/wiki/Osm2pgsql#From_source $ sudo aptitude install build-essential libxml2-dev libgeos-dev libpq-dev libbz2-dev proj libbz2-dev The following NEW packages will be automatically installed: comerr-dev dpkg-dev g++ g++-4.2 libkadm55 libkrb5-dev libssl-dev libstdc++6-4.2-dev libtimedate-perl make patch zlib1g-dev The following NEW packages will be installed: build-essential comerr-dev dpkg-dev g++ g++-4.2 libbz2-dev libgeos-dev libkadm55 libkrb5-dev libpq-dev libssl-dev libstdc++6-4.2-dev libtimedate-perl libxml2-dev make patch zlib1g-dev 0 packages upgraded, 17 newly installed, 0 to remove and 0 not upgraded. $ sudo aptitude install subversion The following NEW packages will be automatically installed: libneon27 libsvn1 The following NEW packages will be installed: libneon27 libsvn1 subversion 0 packages upgraded, 3 newly installed, 0 to remove and 0 not upgraded. $ svn co http://svn.openstreetmap.org/applications/utils/export/osm2pgsql/ $ cd osm2pgsql $ make Version : 0.66-17318 $ mkdir -p /home/maposmatic/apps/stow/osm2pgsql-0.66-17318/bin $ cp osm2pgsql /home/maposmatic/apps/stow/osm2pgsql-0.66-17318/bin $ cd ~/apps/stow $ stow osm2pgsql-0.66-17318 :!: Note : revoir le script mapnik-osm-updater.sh === OSM France === $ wget http://download.geofabrik.de/osm/europe/france.osm.bz2 === Import === Il faut indiquer la projection Google. $ psql -h localhost -U maposmatic -f /home/maposmatic/download/osm2pgsql/900913.sql -d maposmatic Password for user maposmatic: yyyyyyyyyyyyyyyy INSERT 0 1 Avec le default.style dans le répertoire de compilation et le « slim mode ». $ PATH="$PATH:/home/maposmatic/apps/bin" osm2pgsql -S '/home/maposmatic/download/osm2pgsql/default.style' -s -c -d maposmatic -m -U maposmatic -W -H localhost france.osm.bz2 osm2pgsql SVN version 0.66-17318 Password:yyyyyyyyyyyyyyyy *** WARNING: intarray contrib module not installed *** The resulting database will not be usable for applying diffs. Et **sans** le « slim mode ». $ PATH="$PATH:/home/maposmatic/apps/bin" osm2pgsql -S '/home/maposmatic/download/osm2pgsql/default.style' -c -d maposmatic -m -U maposmatic -W -H localhost france.osm.bz2 ==== Installation de Mapnik ==== Sur une Ubuntu 08.04, selon http://trac.mapnik.org/wiki/UbuntuInstallationOld === Dépendances === $ sudo aptitude install binutils cpp-3.3 g++-3.3 gcc-3.3 gcc-3.3-base libboost-dev libboost-filesystem-dev libboost-filesystem1.34.1 libboost-iostreams-dev libboost-iostreams1.34.1 libboost-program-options-dev libboost-program-options1.34.1 libboost-python-dev libboost-python1.34.1 libboost-regex-dev libboost-regex1.34.1 libboost-serialization-dev libboost-serialization1.34.1 libboost-thread-dev libboost-thread1.34.1 libicu-dev libicu38 libstdc++5 libstdc++5-3.3-dev python2.5-dev The following NEW packages will be automatically installed: libboost-date-time-dev libboost-date-time1.34.1 libboost-doc libboost-graph-dev libboost-graph1.34.1 libboost-signals-dev libboost-signals1.34.1 libboost-test-dev libboost-test1.34.1 libboost-wave-dev libboost-wave1.34.1 The following NEW packages will be installed: cpp-3.3 g++-3.3 gcc-3.3 gcc-3.3-base libboost-date-time-dev libboost-date-time1.34.1 libboost-dev libboost-doc libboost-filesystem-dev libboost-filesystem1.34.1 libboost-graph-dev libboost-graph1.34.1 libboost-iostreams-dev libboost-iostreams1.34.1 libboost-program-options-dev libboost-program-options1.34.1 libboost-python-dev libboost-python1.34.1 libboost-regex-dev libboost-regex1.34.1 libboost-serialization-dev libboost-serialization1.34.1 libboost-signals-dev libboost-signals1.34.1 libboost-test-dev libboost-test1.34.1 libboost-thread-dev libboost-thread1.34.1 libboost-wave-dev libboost-wave1.34.1 libicu-dev libicu38 libstdc++5 libstdc++5-3.3-dev python2.5-dev 0 packages upgraded, 35 newly installed, 0 to remove and 0 not upgraded. $ sudo aptitude install libfreetype6 libfreetype6-dev libjpeg62 libjpeg62-dev libltdl3 libltdl3-dev libpng12-0 libpng12-dev libtiff4 libtiff4-dev libtiffxx0c2 python-imaging python-imaging-dbg proj The following NEW packages will be automatically installed: autotools-dev libtool python-dbg python2.5-dbg The following NEW packages will be installed: autotools-dev libfreetype6-dev libjpeg62-dev libltdl3-dev libpng12-dev libtiff4-dev libtiffxx0c2 libtool python-dbg python-imaging python-imaging-dbg python2.5-dbg 0 packages upgraded, 12 newly installed, 0 to remove and 0 not upgraded. $ sudo aptitude install libcairo2 libcairo2-dev python-cairo python-cairo-dev libcairomm-1.0-1 libcairomm-1.0-dev libglib2.0-0 libpixman-1-0 libpixman-1-dev libpthread-stubs0 libpthread-stubs0-dev ttf-dejavu ttf-dejavu-core ttf-dejavu-extra The following NEW packages will be automatically installed: libexpat1-dev libfontconfig1-dev libice-dev libsm-dev libx11-dev libxau-dev libxcb-xlib0-dev libxcb1-dev libxdmcp-dev libxrender-dev pkg-config x11proto-core-dev x11proto-input-dev x11proto-kb-dev x11proto-render-dev xtrans-dev The following NEW packages will be installed: libcairo2-dev libcairomm-1.0-1 libcairomm-1.0-dev libexpat1-dev libfontconfig1-dev libice-dev libpixman-1-dev libpthread-stubs0 libpthread-stubs0-dev libsm-dev libx11-dev libxau-dev libxcb-xlib0-dev libxcb1-dev libxdmcp-dev libxrender-dev pkg-config python-cairo python-cairo-dev x11proto-core-dev x11proto-input-dev x11proto-kb-dev x11proto-render-dev xtrans-dev 0 packages upgraded, 24 newly installed, 0 to remove and 0 not upgraded. $ sudo aptitude install libgdal-dev python2.5-gdal postgresql-8.3-postgis postgresql-8.3 postgresql-server-dev-8.3 postgresql-contrib-8.3 Note: selecting "libgdal1-dev" instead of the virtual package "libgdal-dev" Note: selecting "python-gdal" instead of the virtual package "python2.5-gdal" The following packages are BROKEN: libgdal1-dev python-gdal The following NEW packages will be automatically installed: libdbd-pg-perl libossp-uuid15 The following NEW packages will be installed: libdbd-pg-perl libossp-uuid15 postgresql-contrib-8.3 postgresql-server-dev-8.3 0 packages upgraded, 6 newly installed, 0 to remove and 0 not upgraded. Need to get 4263kB of archives. After unpacking 18.5MB will be used. The following packages have unmet dependencies: python-gdal: Depends: libgdal1-1.4.0 but it is not installable Depends: python-numeric but it is not installable libgdal1-dev: Depends: libcurl4-dev which is a virtual package. or libcurl-dev which is a virtual package. Depends: libgdal1-1.4.0 (= 1.4.4-1ubuntu3) but it is not installable Depends: libgif-dev but it is not installable Depends: libhdf4g-dev but it is not installable Depends: libhdf5-serial-dev but it is not installable Depends: libjasper-dev but it is not installable or libjasper-1.701-dev which is a virtual package. Depends: libmysqlclient15-dev but it is not installable Depends: libsqlite3-dev but it is not installable Depends: libxerces27-dev but it is not installable Depends: netcdfg-dev but it is not installable Depends: unixodbc-dev but it is not installable Resolving dependencies... The following actions will resolve these dependencies: Keep the following packages at their current version: libgdal1-dev [Not Installed] python-gdal [Not Installed] Score is 190 Accept this solution? [Y/n/q/?] n Resolving dependencies... The following actions will resolve these dependencies: Install the following packages: libgdal1-1.4.0 [1.4.4-1ubuntu3 (hardy)] libgif4 [4.1.6-4 (hardy)] libhdf4g [4.1r4-21 (hardy)] libhdf5-serial-1.6.5-0 [1.6.5-5.2build1 (hardy)] libnetcdf4 [1:3.6.2-2 (hardy)] libogdi3.2 [3.2.0~beta1-3ubuntu1 (hardy)] libxerces27 [2.7.0-5 (hardy)] odbcinst1debian1 [2.2.11-16build1 (hardy)] python-numeric [24.2-8ubuntu2 (hardy)] unixodbc [2.2.11-16build1 (hardy)] Keep the following packages at their current version: libgdal1-dev [Not Installed] Score is 25 Accept this solution? [Y/n/q/?] n Resolving dependencies... The following actions will resolve these dependencies: Install the following packages: libgdal1-1.4.0 [1.4.4-1ubuntu3 (hardy)] libgif4 [4.1.6-4 (hardy)] libhdf4g [4.1r4-21 (hardy)] libhdf5-mpich-1.6.5-0 [1.6.5-5.2build1 (hardy)] libnetcdf4 [1:3.6.2-2 (hardy)] libogdi3.2 [3.2.0~beta1-3ubuntu1 (hardy)] libxerces27 [2.7.0-5 (hardy)] odbcinst1debian1 [2.2.11-16build1 (hardy)] python-numeric [24.2-8ubuntu2 (hardy)] unixodbc [2.2.11-16build1 (hardy)] Keep the following packages at their current version: libgdal1-dev [Not Installed] Score is 23 Accept this solution? [Y/n/q/?] n Resolving dependencies... The following actions will resolve these dependencies: Install the following packages: lam-runtime [7.1.2-1.3 (hardy)] libgdal1-1.4.0 [1.4.4-1ubuntu3 (hardy)] libgif4 [4.1.6-4 (hardy)] libhdf4g [4.1r4-21 (hardy)] libhdf5-lam-1.6.5-0 [1.6.5-5.2build1 (hardy)] liblam4 [7.1.2-1.3 (hardy)] libnetcdf4 [1:3.6.2-2 (hardy)] libogdi3.2 [3.2.0~beta1-3ubuntu1 (hardy)] libxerces27 [2.7.0-5 (hardy)] odbcinst1debian1 [2.2.11-16build1 (hardy)] python-numeric [24.2-8ubuntu2 (hardy)] unixodbc [2.2.11-16build1 (hardy)] Keep the following packages at their current version: libgdal1-dev [Not Installed] Score is 1 Accept this solution? [Y/n/q/?] n Resolving dependencies... The following actions will resolve these dependencies: Install the following packages: libgdal1-1.4.0 [1.4.4-1ubuntu3 (hardy)] libgif4 [4.1.6-4 (hardy)] libhdf4g [4.1r4-21 (hardy)] libhdf5-lam-1.6.5-0 [1.6.5-5.2build1 (hardy)] liblam4 [7.1.2-1.3 (hardy)] libnetcdf4 [1:3.6.2-2 (hardy)] libogdi3.2 [3.2.0~beta1-3ubuntu1 (hardy)] libxerces27 [2.7.0-5 (hardy)] odbcinst1debian1 [2.2.11-16build1 (hardy)] python-numeric [24.2-8ubuntu2 (hardy)] unixodbc [2.2.11-16build1 (hardy)] Keep the following packages at their current version: libgdal1-dev [Not Installed] Leave the following dependencies unresolved: liblam4 recommends lam-runtime Score is -188 Accept this solution? [Y/n/q/?] n Resolving dependencies... The following actions will resolve these dependencies: Install the following packages: libaudio2 [1.9.1-1 (hardy)] libcurl4-gnutls-dev [7.18.0-1ubuntu2.2 (hardy-security)] libgcrypt11-dev [1.2.4-2ubuntu7 (hardy)] libgdal1-1.4.0 [1.4.4-1ubuntu3 (hardy)] libgif-dev [4.1.6-4 (hardy)] libgif4 [4.1.6-4 (hardy)] libglu1-mesa [7.0.3~rc2-1ubuntu3 (hardy)] libgnutls-dev [2.0.4-1ubuntu2.6 (hardy-security)] libgnutlsxx13 [2.0.4-1ubuntu2.6 (hardy-security)] libgpg-error-dev [1.4-2ubuntu7 (hardy)] libhdf4g [4.1r4-21 (hardy)] libhdf4g-dev [4.1r4-21 (hardy)] libhdf5-serial-1.6.5-0 [1.6.5-5.2build1 (hardy)] libhdf5-serial-dev [1.6.5-5.2build1 (hardy)] libidn11-dev [1.1-1 (hardy)] libjasper-dev [1.900.1-3ubuntu0.8.04.1 (hardy-security)] libldap2-dev [2.4.9-0ubuntu0.8.04.1 (hardy-updates, hardy-security)] liblzo2-dev [2.02-3 (hardy)] libmng1 [1.0.9-1 (hardy)] libmysqlclient15-dev [5.0.51a-3ubuntu5.4 (hardy-updates, hardy-security)] libnetcdf-dev [1:3.6.2-2 (hardy)] libnetcdf4 [1:3.6.2-2 (hardy)] libodbcinstq1c2 [2.2.11-16build1 (hardy)] libogdi3.2 [3.2.0~beta1-3ubuntu1 (hardy)] libopencdk10-dev [0.6.6-1ubuntu1 (hardy)] libqt3-mt [3:3.3.8-b-0ubuntu3 (hardy)] libsqlite3-dev [3.4.2-2 (hardy)] libtasn1-3-dev [1.1-1 (hardy)] libxerces27 [2.7.0-5 (hardy)] libxerces27-dev [2.7.0-5 (hardy)] netcdf-doc [1:3.6.2-2 (hardy)] netcdfg-dev [1:3.6.2-2 (hardy)] odbcinst1debian1 [2.2.11-16build1 (hardy)] unixodbc [2.2.11-16build1 (hardy)] unixodbc-dev [2.2.11-16build1 (hardy)] Keep the following packages at their current version: python-gdal [Not Installed] Score is -210 Accept this solution? [Y/n/q/?] n Resolving dependencies... The following actions will resolve these dependencies: Install the following packages: libaudio2 [1.9.1-1 (hardy)] libcurl4-gnutls-dev [7.18.0-1ubuntu2.2 (hardy-security)] libgcrypt11-dev [1.2.4-2ubuntu7 (hardy)] libgdal1-1.4.0 [1.4.4-1ubuntu3 (hardy)] libgif-dev [4.1.6-4 (hardy)] libgif4 [4.1.6-4 (hardy)] libglu1-mesa [7.0.3~rc2-1ubuntu3 (hardy)] libgnutls-dev [2.0.4-1ubuntu2.6 (hardy-security)] libgnutlsxx13 [2.0.4-1ubuntu2.6 (hardy-security)] libgpg-error-dev [1.4-2ubuntu7 (hardy)] libhdf4g [4.1r4-21 (hardy)] libhdf4g-dev [4.1r4-21 (hardy)] libhdf5-serial-1.6.5-0 [1.6.5-5.2build1 (hardy)] libhdf5-serial-dev [1.6.5-5.2build1 (hardy)] libidn11-dev [1.1-1 (hardy)] libjasper-dev [1.900.1-3ubuntu0.8.04.1 (hardy-security)] libldap2-dev [2.4.7-6ubuntu3 (hardy)] liblzo2-dev [2.02-3 (hardy)] libmng1 [1.0.9-1 (hardy)] libmysqlclient15-dev [5.0.51a-3ubuntu5.4 (hardy-updates, hardy-security)] libnetcdf-dev [1:3.6.2-2 (hardy)] libnetcdf4 [1:3.6.2-2 (hardy)] libodbcinstq1c2 [2.2.11-16build1 (hardy)] libogdi3.2 [3.2.0~beta1-3ubuntu1 (hardy)] libopencdk10-dev [0.6.6-1ubuntu1 (hardy)] libqt3-mt [3:3.3.8-b-0ubuntu3 (hardy)] libsqlite3-dev [3.4.2-2 (hardy)] libtasn1-3-dev [1.1-1 (hardy)] libxerces27 [2.7.0-5 (hardy)] libxerces27-dev [2.7.0-5 (hardy)] netcdf-doc [1:3.6.2-2 (hardy)] netcdfg-dev [1:3.6.2-2 (hardy)] odbcinst1debian1 [2.2.11-16build1 (hardy)] unixodbc [2.2.11-16build1 (hardy)] unixodbc-dev [2.2.11-16build1 (hardy)] Keep the following packages at their current version: python-gdal [Not Installed] Downgrade the following packages: libldap-2.4-2 [2.4.9-0ubuntu0.8.04.1 (hardy-updates, hardy-security, now) -> 2.4.7-6ubuntu3 (hardy)] Score is -200 Accept this solution? [Y/n/q/?] n Resolving dependencies... The following actions will resolve these dependencies: Install the following packages: libaudio2 [1.9.1-1 (hardy)] libcurl4-gnutls-dev [7.18.0-1ubuntu2.2 (hardy-security)] libgcrypt11-dev [1.2.4-2ubuntu7 (hardy)] libgdal1-1.4.0 [1.4.4-1ubuntu3 (hardy)] libgif-dev [4.1.6-4 (hardy)] libgif4 [4.1.6-4 (hardy)] libglu1-mesa [7.0.3~rc2-1ubuntu3 (hardy)] libgnutls-dev [2.0.4-1ubuntu2.6 (hardy-security)] libgnutlsxx13 [2.0.4-1ubuntu2.6 (hardy-security)] libgpg-error-dev [1.4-2ubuntu7 (hardy)] libhdf4g [4.1r4-21 (hardy)] libhdf4g-dev [4.1r4-21 (hardy)] libhdf5-serial-1.6.5-0 [1.6.5-5.2build1 (hardy)] libhdf5-serial-dev [1.6.5-5.2build1 (hardy)] libidn11-dev [1.1-1 (hardy)] libjasper-dev [1.900.1-3ubuntu0.8.04.1 (hardy-security)] libldap2-dev [2.4.9-0ubuntu0.8.04.1 (hardy-updates, hardy-security)] liblzo2-dev [2.02-3 (hardy)] libmng1 [1.0.9-1 (hardy)] libmysqlclient15-dev [5.0.51a-3ubuntu5 (hardy)] libnetcdf-dev [1:3.6.2-2 (hardy)] libnetcdf4 [1:3.6.2-2 (hardy)] libodbcinstq1c2 [2.2.11-16build1 (hardy)] libogdi3.2 [3.2.0~beta1-3ubuntu1 (hardy)] libopencdk10-dev [0.6.6-1ubuntu1 (hardy)] libqt3-mt [3:3.3.8-b-0ubuntu3 (hardy)] libsqlite3-dev [3.4.2-2 (hardy)] libtasn1-3-dev [1.1-1 (hardy)] libxerces27 [2.7.0-5 (hardy)] libxerces27-dev [2.7.0-5 (hardy)] netcdf-doc [1:3.6.2-2 (hardy)] netcdfg-dev [1:3.6.2-2 (hardy)] odbcinst1debian1 [2.2.11-16build1 (hardy)] unixodbc [2.2.11-16build1 (hardy)] unixodbc-dev [2.2.11-16build1 (hardy)] Keep the following packages at their current version: python-gdal [Not Installed] Score is -230 Accept this solution? [Y/n/q/?] n Resolving dependencies... The following actions will resolve these dependencies: Install the following packages: libaudio2 [1.9.1-1 (hardy)] libcurl4-gnutls-dev [7.18.0-1ubuntu2.2 (hardy-security)] libgcrypt11-dev [1.2.4-2ubuntu7 (hardy)] libgdal1-1.4.0 [1.4.4-1ubuntu3 (hardy)] libgif-dev [4.1.6-4 (hardy)] libgif4 [4.1.6-4 (hardy)] libglu1-mesa [7.0.3~rc2-1ubuntu3 (hardy)] libgnutls-dev [2.0.4-1ubuntu2.6 (hardy-security)] libgnutlsxx13 [2.0.4-1ubuntu2.6 (hardy-security)] libgpg-error-dev [1.4-2ubuntu7 (hardy)] libhdf4g [4.1r4-21 (hardy)] libhdf4g-dev [4.1r4-21 (hardy)] libhdf5-serial-1.6.5-0 [1.6.5-5.2build1 (hardy)] libhdf5-serial-dev [1.6.5-5.2build1 (hardy)] libidn11-dev [1.1-1 (hardy)] libjasper-dev [1.900.1-3ubuntu0.8.04.1 (hardy-security)] libldap2-dev [2.4.7-6ubuntu3 (hardy)] liblzo2-dev [2.02-3 (hardy)] libmng1 [1.0.9-1 (hardy)] libmysqlclient15-dev [5.0.51a-3ubuntu5 (hardy)] libnetcdf-dev [1:3.6.2-2 (hardy)] libnetcdf4 [1:3.6.2-2 (hardy)] libodbcinstq1c2 [2.2.11-16build1 (hardy)] libogdi3.2 [3.2.0~beta1-3ubuntu1 (hardy)] libopencdk10-dev [0.6.6-1ubuntu1 (hardy)] libqt3-mt [3:3.3.8-b-0ubuntu3 (hardy)] libsqlite3-dev [3.4.2-2 (hardy)] libtasn1-3-dev [1.1-1 (hardy)] libxerces27 [2.7.0-5 (hardy)] libxerces27-dev [2.7.0-5 (hardy)] netcdf-doc [1:3.6.2-2 (hardy)] netcdfg-dev [1:3.6.2-2 (hardy)] odbcinst1debian1 [2.2.11-16build1 (hardy)] unixodbc [2.2.11-16build1 (hardy)] unixodbc-dev [2.2.11-16build1 (hardy)] Keep the following packages at their current version: python-gdal [Not Installed] Downgrade the following packages: libldap-2.4-2 [2.4.9-0ubuntu0.8.04.1 (hardy-updates, hardy-security, now) -> 2.4.7-6ubuntu3 (hardy)] Score is -220 Accept this solution? [Y/n/q/?] n Resolving dependencies... The following actions will resolve these dependencies: Install the following packages: libaudio2 [1.9.1-1 (hardy)] libcurl4-gnutls-dev [7.18.0-1ubuntu2.2 (hardy-security)] libgcrypt11-dev [1.2.4-2ubuntu7 (hardy)] libgdal1-1.4.0 [1.4.4-1ubuntu3 (hardy)] libgif-dev [4.1.6-4 (hardy)] libgif4 [4.1.6-4 (hardy)] libglu1-mesa [7.0.3~rc2-1ubuntu3 (hardy)] libgnutls-dev [2.0.4-1ubuntu2.6 (hardy-security)] libgnutlsxx13 [2.0.4-1ubuntu2.6 (hardy-security)] libgpg-error-dev [1.4-2ubuntu7 (hardy)] libhdf4g [4.1r4-21 (hardy)] libhdf4g-dev [4.1r4-21 (hardy)] libhdf5-serial-1.6.5-0 [1.6.5-5.2build1 (hardy)] libhdf5-serial-dev [1.6.5-5.2build1 (hardy)] libidn11-dev [1.1-1 (hardy)] libjasper-dev [1.900.1-3 (hardy)] libldap2-dev [2.4.9-0ubuntu0.8.04.1 (hardy-updates, hardy-security)] liblzo2-dev [2.02-3 (hardy)] libmng1 [1.0.9-1 (hardy)] libmysqlclient15-dev [5.0.51a-3ubuntu5.4 (hardy-updates, hardy-security)] libnetcdf-dev [1:3.6.2-2 (hardy)] libnetcdf4 [1:3.6.2-2 (hardy)] libodbcinstq1c2 [2.2.11-16build1 (hardy)] libogdi3.2 [3.2.0~beta1-3ubuntu1 (hardy)] libopencdk10-dev [0.6.6-1ubuntu1 (hardy)] libqt3-mt [3:3.3.8-b-0ubuntu3 (hardy)] libsqlite3-dev [3.4.2-2 (hardy)] libtasn1-3-dev [1.1-1 (hardy)] libxerces27 [2.7.0-5 (hardy)] libxerces27-dev [2.7.0-5 (hardy)] netcdf-doc [1:3.6.2-2 (hardy)] netcdfg-dev [1:3.6.2-2 (hardy)] odbcinst1debian1 [2.2.11-16build1 (hardy)] unixodbc [2.2.11-16build1 (hardy)] unixodbc-dev [2.2.11-16build1 (hardy)] Keep the following packages at their current version: python-gdal [Not Installed] Downgrade the following packages: libjasper1 [1.900.1-3ubuntu0.8.04.1 (hardy-security, now) -> 1.900.1-3 (hardy)] Score is -260 Accept this solution? [Y/n/q/?] n Resolving dependencies... The following actions will resolve these dependencies: Install the following packages: libaudio2 [1.9.1-1 (hardy)] libcurl4-gnutls-dev [7.18.0-1ubuntu2.2 (hardy-security)] libgcrypt11-dev [1.2.4-2ubuntu7 (hardy)] libgdal1-1.4.0 [1.4.4-1ubuntu3 (hardy)] libgif-dev [4.1.6-4 (hardy)] libgif4 [4.1.6-4 (hardy)] libglu1-mesa [7.0.3~rc2-1ubuntu3 (hardy)] libgnutls-dev [2.0.4-1ubuntu2.6 (hardy-security)] libgnutlsxx13 [2.0.4-1ubuntu2.6 (hardy-security)] libgpg-error-dev [1.4-2ubuntu7 (hardy)] libhdf4g [4.1r4-21 (hardy)] libhdf4g-dev [4.1r4-21 (hardy)] libhdf5-serial-1.6.5-0 [1.6.5-5.2build1 (hardy)] libhdf5-serial-dev [1.6.5-5.2build1 (hardy)] libidn11-dev [1.1-1 (hardy)] libjasper-dev [1.900.1-3 (hardy)] libldap2-dev [2.4.7-6ubuntu3 (hardy)] liblzo2-dev [2.02-3 (hardy)] libmng1 [1.0.9-1 (hardy)] libmysqlclient15-dev [5.0.51a-3ubuntu5.4 (hardy-updates, hardy-security)] libnetcdf-dev [1:3.6.2-2 (hardy)] libnetcdf4 [1:3.6.2-2 (hardy)] libodbcinstq1c2 [2.2.11-16build1 (hardy)] libogdi3.2 [3.2.0~beta1-3ubuntu1 (hardy)] libopencdk10-dev [0.6.6-1ubuntu1 (hardy)] libqt3-mt [3:3.3.8-b-0ubuntu3 (hardy)] libsqlite3-dev [3.4.2-2 (hardy)] libtasn1-3-dev [1.1-1 (hardy)] libxerces27 [2.7.0-5 (hardy)] libxerces27-dev [2.7.0-5 (hardy)] netcdf-doc [1:3.6.2-2 (hardy)] netcdfg-dev [1:3.6.2-2 (hardy)] odbcinst1debian1 [2.2.11-16build1 (hardy)] unixodbc [2.2.11-16build1 (hardy)] unixodbc-dev [2.2.11-16build1 (hardy)] Keep the following packages at their current version: python-gdal [Not Installed] Downgrade the following packages: libjasper1 [1.900.1-3ubuntu0.8.04.1 (hardy-security, now) -> 1.900.1-3 (hardy)] libldap-2.4-2 [2.4.9-0ubuntu0.8.04.1 (hardy-updates, hardy-security, now) -> 2.4.7-6ubuntu3 (hardy)] Score is -250 Accept this solution? [Y/n/q/?] n Resolving dependencies... The following actions will resolve these dependencies: Install the following packages: libaudio2 [1.9.1-1 (hardy)] libcurl4-gnutls-dev [7.18.0-1ubuntu2.2 (hardy-security)] libgcrypt11-dev [1.2.4-2ubuntu7 (hardy)] libgdal1-1.4.0 [1.4.4-1ubuntu3 (hardy)] libgif-dev [4.1.6-4 (hardy)] libgif4 [4.1.6-4 (hardy)] libglu1-mesa [7.0.3~rc2-1ubuntu3 (hardy)] libgnutls-dev [2.0.4-1ubuntu2.6 (hardy-security)] libgnutlsxx13 [2.0.4-1ubuntu2.6 (hardy-security)] libgpg-error-dev [1.4-2ubuntu7 (hardy)] libhdf4g [4.1r4-21 (hardy)] libhdf4g-dev [4.1r4-21 (hardy)] libhdf5-serial-1.6.5-0 [1.6.5-5.2build1 (hardy)] libhdf5-serial-dev [1.6.5-5.2build1 (hardy)] libidn11-dev [1.1-1 (hardy)] libjasper-dev [1.900.1-3 (hardy)] libldap2-dev [2.4.9-0ubuntu0.8.04.1 (hardy-updates, hardy-security)] liblzo2-dev [2.02-3 (hardy)] libmng1 [1.0.9-1 (hardy)] libmysqlclient15-dev [5.0.51a-3ubuntu5 (hardy)] libnetcdf-dev [1:3.6.2-2 (hardy)] libnetcdf4 [1:3.6.2-2 (hardy)] libodbcinstq1c2 [2.2.11-16build1 (hardy)] libogdi3.2 [3.2.0~beta1-3ubuntu1 (hardy)] libopencdk10-dev [0.6.6-1ubuntu1 (hardy)] libqt3-mt [3:3.3.8-b-0ubuntu3 (hardy)] libsqlite3-dev [3.4.2-2 (hardy)] libtasn1-3-dev [1.1-1 (hardy)] libxerces27 [2.7.0-5 (hardy)] libxerces27-dev [2.7.0-5 (hardy)] netcdf-doc [1:3.6.2-2 (hardy)] netcdfg-dev [1:3.6.2-2 (hardy)] odbcinst1debian1 [2.2.11-16build1 (hardy)] unixodbc [2.2.11-16build1 (hardy)] unixodbc-dev [2.2.11-16build1 (hardy)] Keep the following packages at their current version: python-gdal [Not Installed] Downgrade the following packages: libjasper1 [1.900.1-3ubuntu0.8.04.1 (hardy-security, now) -> 1.900.1-3 (hardy)] Score is -280 Accept this solution? [Y/n/q/?] n Resolving dependencies... The following actions will resolve these dependencies: Install the following packages: libaudio2 [1.9.1-1 (hardy)] libcurl4-gnutls-dev [7.18.0-1ubuntu2.2 (hardy-security)] libgcrypt11-dev [1.2.4-2ubuntu7 (hardy)] libgdal1-1.4.0 [1.4.4-1ubuntu3 (hardy)] libgif-dev [4.1.6-4 (hardy)] libgif4 [4.1.6-4 (hardy)] libglu1-mesa [7.0.3~rc2-1ubuntu3 (hardy)] libgnutls-dev [2.0.4-1ubuntu2.6 (hardy-security)] libgnutlsxx13 [2.0.4-1ubuntu2.6 (hardy-security)] libgpg-error-dev [1.4-2ubuntu7 (hardy)] libhdf4g [4.1r4-21 (hardy)] libhdf4g-dev [4.1r4-21 (hardy)] libhdf5-serial-1.6.5-0 [1.6.5-5.2build1 (hardy)] libhdf5-serial-dev [1.6.5-5.2build1 (hardy)] libidn11-dev [1.1-1 (hardy)] libjasper-dev [1.900.1-3 (hardy)] libldap2-dev [2.4.7-6ubuntu3 (hardy)] liblzo2-dev [2.02-3 (hardy)] libmng1 [1.0.9-1 (hardy)] libmysqlclient15-dev [5.0.51a-3ubuntu5 (hardy)] libnetcdf-dev [1:3.6.2-2 (hardy)] libnetcdf4 [1:3.6.2-2 (hardy)] libodbcinstq1c2 [2.2.11-16build1 (hardy)] libogdi3.2 [3.2.0~beta1-3ubuntu1 (hardy)] libopencdk10-dev [0.6.6-1ubuntu1 (hardy)] libqt3-mt [3:3.3.8-b-0ubuntu3 (hardy)] libsqlite3-dev [3.4.2-2 (hardy)] libtasn1-3-dev [1.1-1 (hardy)] libxerces27 [2.7.0-5 (hardy)] libxerces27-dev [2.7.0-5 (hardy)] netcdf-doc [1:3.6.2-2 (hardy)] netcdfg-dev [1:3.6.2-2 (hardy)] odbcinst1debian1 [2.2.11-16build1 (hardy)] unixodbc [2.2.11-16build1 (hardy)] unixodbc-dev [2.2.11-16build1 (hardy)] Keep the following packages at their current version: python-gdal [Not Installed] Downgrade the following packages: libjasper1 [1.900.1-3ubuntu0.8.04.1 (hardy-security, now) -> 1.900.1-3 (hardy)] libldap-2.4-2 [2.4.9-0ubuntu0.8.04.1 (hardy-updates, hardy-security, now) -> 2.4.7-6ubuntu3 (hardy)] Score is -270 Accept this solution? [Y/n/q/?] n Resolving dependencies... The following actions will resolve these dependencies: Install the following packages: libaudio2 [1.9.1-1 (hardy)] libcurl4-gnutls-dev [7.18.0-1ubuntu2.2 (hardy-security)] libgcrypt11-dev [1.2.4-2ubuntu7 (hardy)] libgdal1-1.4.0 [1.4.4-1ubuntu3 (hardy)] libgif-dev [4.1.6-4 (hardy)] libgif4 [4.1.6-4 (hardy)] libglu1-mesa [7.0.3~rc2-1ubuntu3 (hardy)] libgnutls-dev [2.0.4-1ubuntu2.6 (hardy-security)] libgnutlsxx13 [2.0.4-1ubuntu2.6 (hardy-security)] libgpg-error-dev [1.4-2ubuntu7 (hardy)] libhdf4g [4.1r4-21 (hardy)] libhdf4g-dev [4.1r4-21 (hardy)] libhdf5-serial-1.6.5-0 [1.6.5-5.2build1 (hardy)] libhdf5-serial-dev [1.6.5-5.2build1 (hardy)] libidn11-dev [1.1-1 (hardy)] libjasper-dev [1.900.1-3ubuntu0.8.04.1 (hardy-security)] libldap2-dev [2.4.9-0ubuntu0.8.04.1 (hardy-updates, hardy-security)] liblzo2-dev [2.02-3 (hardy)] libmng1 [1.0.9-1 (hardy)] libmysqlclient15-dev [5.0.51a-3ubuntu5.4 (hardy-updates, hardy-security)] libnetcdf-dev [1:3.6.2-2 (hardy)] libnetcdf4 [1:3.6.2-2 (hardy)] libodbcinstq1c2 [2.2.11-16build1 (hardy)] libogdi3.2 [3.2.0~beta1-3ubuntu1 (hardy)] libopencdk10-dev [0.6.6-1ubuntu1 (hardy)] libqt3-mt [3:3.3.8-b-0ubuntu3 (hardy)] libsqlite3-dev [3.4.2-2 (hardy)] libtasn1-3-dev [1.1-1 (hardy)] libxerces27 [2.7.0-5 (hardy)] libxerces27-dev [2.7.0-5 (hardy)] netcdf-doc [1:3.6.2-2 (hardy)] netcdfg-dev [1:3.6.2-2 (hardy)] odbcinst1debian1 [2.2.11-16build1 (hardy)] python-numeric [24.2-8ubuntu2 (hardy)] unixodbc [2.2.11-16build1 (hardy)] unixodbc-dev [2.2.11-16build1 (hardy)] Score is -288 Accept this solution? [Y/n/q/?] The following NEW packages will be automatically installed: libaudio2 libcurl4-gnutls-dev libdbd-pg-perl libgcrypt11-dev libgdal1-1.4.0 libgif-dev libgif4 libglu1-mesa libgnutls-dev libgnutlsxx13 libgpg-error-dev libhdf4g libhdf4g-dev libhdf5-serial-1.6.5-0 libhdf5-serial-dev libidn11-dev libjasper-dev libldap2-dev liblzo2-dev libmng1 libmysqlclient15-dev libnetcdf-dev libnetcdf4 libodbcinstq1c2 libogdi3.2 libopencdk10-dev libossp-uuid15 libqt3-mt libsqlite3-dev libtasn1-3-dev libxerces27 libxerces27-dev netcdf-doc netcdfg-dev odbcinst1debian1 python-numeric unixodbc unixodbc-dev The following NEW packages will be installed: libaudio2 libcurl4-gnutls-dev libdbd-pg-perl libgcrypt11-dev libgdal1-1.4.0 libgdal1-dev libgif-dev libgif4 libglu1-mesa libgnutls-dev libgnutlsxx13 libgpg-error-dev libhdf4g libhdf4g-dev libhdf5-serial-1.6.5-0 libhdf5-serial-dev libidn11-dev libjasper-dev libldap2-dev liblzo2-dev libmng1 libmysqlclient15-dev libnetcdf-dev libnetcdf4 libodbcinstq1c2 libogdi3.2 libopencdk10-dev libossp-uuid15 libqt3-mt libsqlite3-dev libtasn1-3-dev libxerces27 libxerces27-dev netcdf-doc netcdfg-dev odbcinst1debian1 postgresql-contrib-8.3 postgresql-server-dev-8.3 python-gdal python-numeric unixodbc unixodbc-dev 0 packages upgraded, 42 newly installed, 0 to remove and 0 not upgraded. Need to get 32.6MB of archives. After unpacking 114MB will be used. Do you want to continue? [Y/n/?] $ sudo aptitude install libxslt1.1 libxslt1-dev libxml2-dev libxml2 The following NEW packages will be installed: libxslt1-dev 0 packages upgraded, 1 newly installed, 0 to remove and 0 not upgraded. === Compilation à partir des sources === $ cd ~/download $ wget http://download.berlios.de/mapnik/mapnik-0.6.1.tar.bz2 $ tar xvjf mapnik-0.6.1.tar.bz2 $ cd mapnik-0.6.1 $ python scons/scons.py configure INPUT_PLUGINS=all \ OPTIMIZATION=3 PREFIX=/home/maposmatic/apps/stow/mapnik-0.6.1 \ PYTHON_PREFIX=/home/maposmatic/apps/stow/mapnik-0.6.1/ \ SYSTEM_FONTS=/usr/share/fonts/truetype/ttf-dejavu/ Note: will build without these optional dependencies: - boost system - ociei Python 2.5 prefix... /usr Python bindings will install in... /home/maposmatic/apps/stow/mapnik-0.6.1/lib64/python2.5/site-packages $ python scons/scons.py $ python scons/scons.py install $ cd ~/apps/stow $ stow mapnik-0.6.1 $ export PYTHONPATH="/home/maposmatic/apps/lib64/python2.5/site-packages" $ export LD_LIBRARY_PATH="/home/maposmatic/apps/lib64/" == Vérification == $ python Python 2.5.2 (r252:60911, Jul 22 2009, 15:33:10) [GCC 4.2.4 (Ubuntu 4.2.4-1ubuntu3)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import mapnik >>> ==== Mapnik-OSM ==== $ cd ~/download $ svn checkout http://svn.openstreetmap.org/applications/rendering/mapnik mapnik-osm $ cd mapnik-osm/ $ cp set-mapnik-env set-mapnik-env.orig $ emacs set-mapnik-env $ diff -u set-mapnik-env.orig set-mapnik-env --- set-mapnik-env.orig 2009-08-28 20:03:23.000000000 +0200 +++ set-mapnik-env 2009-08-28 20:07:09.000000000 +0200 @@ -30,26 +30,26 @@ # This is the name of the *local* version of the Mapnik map file after it has # been run through the cutomize-mapnik-map script. -export MAPNIK_MAP_FILE=~/mapnik/osm.xml +export MAPNIK_MAP_FILE=~/download/mapnik-osm/osm.xml # This is the directory where the icons and symbols for Mapnik are. If # you have checked out the OSM subversion directory into a directory # called ~/svn.openstreetmap.org, the symbols will be in # ~/svn.openstreetmap.org/applications/rendering/mapnik/symbols -export MAPNIK_SYMBOLS_DIR=~/mapnik/symbols +export MAPNIK_SYMBOLS_DIR=~/download/mapnik-osm/symbols # This is the directory where you upacked the world_boundaries.tar.bz2 # file you got from # http://artem.dev.openstreetmap.org/files/world_boundaries.tar.bz2 -export MAPNIK_WORLD_BOUNDARIES_DIR=~/mapnik/world_boundaries +export MAPNIK_WORLD_BOUNDARIES_DIR=~/download/mapnik-osm/world_boundaries # Directory where the created map tiles should be stored. Must end with # a slash (/) -export MAPNIK_TILE_DIR=~/mapnik/tiles/ +export MAPNIK_TILE_DIR=~/download/mapnik-osm/tiles/ # This is the name of the server running the PostgreSQL database. Leave # this empty if your database is on the local machine. -export MAPNIK_DBHOST="" +export MAPNIK_DBHOST="localhost" # This is the TCP port where the PostgreSQL server is listening. The # default port for PostgreSQL is 5432. Leave this empty if your database @@ -57,13 +57,13 @@ export MAPNIK_DBPORT="" # This is the name of the database where the OSM data is stored. -export MAPNIK_DBNAME='osm' +export MAPNIK_DBNAME='maposmatic' # This is the username we should use to log into the PostgreSQL database. -export MAPNIK_DBUSER=`whoami` +export MAPNIK_DBUSER='maposmatic' # This is the password we should use to log into the PostgreSQL database. -export MAPNIK_DBPASS="" +export MAPNIK_DBPASS="yyyyyyyyyyyyyyyy" # This is the prefix used in the table names. Matches the -p option in osm2pgsql # Unspecified defaults to "planet_osm" $ . ./set-mapnik-env $ ./customize-mapnik-map >$MAPNIK_MAP_FILE === Données constantes === $ cd ~/download $ wget http://tile.openstreetmap.org/world_boundaries-spherical.tgz $ cd ~/download/mapnik-osm/ $ tar xzf ~/download/world_boundaries-spherical.tgz $ cd ~/download $ wget http://tile.openstreetmap.org/processed_p.zip $ unzip -j processed_p.zip -d ~/download/mapnik-osm/world_boundaries $ wget http://tile.openstreetmap.org/shoreline_300.tar.bz2 $ tar xjf ~/download/shoreline_300.tar.bz2 -C ~/download/mapnik-osm/world_boundaries === Installation de xauth === Pour voir les images à distance. $ sudo aptitude install xauth ==== Django ==== Installation de Django 1.1 à partir des sources. Selon http://www.djangoproject.com/download/ $ cd ~/download/ $ wget http://media.djangoproject.com/releases/1.1/Django-1.1.tar.gz $ tar xzvf Django-1.1.tar.gz $ cd Django-1.1 En tant que root (pour simplifier la vie à Apache). $ sudo python setup.py install ===== 2009-08-28 ===== ==== Git ==== $ sudo aptitude install git-core The following NEW packages will be automatically installed: curl libdigest-sha1-perl liberror-perl The following NEW packages will be installed: curl git-core libdigest-sha1-perl liberror-perl 0 packages upgraded, 4 newly installed, 0 to remove and 0 not upgraded. ==== Sources ocitysmap ==== Récupération du code de ocitysmap par le dépôt provisoire. $ cd ~/download $ git clone git://lehobey.net/git/ocitysmap.git $ cd ocitysmap ==== Initialisation PostgreSQL ==== Ajout d'une fonction utile. $ psql -h localhost -U maposmatic -f /home/maposmatic/download/ocitysmap/ocitysmap-init.sql -d maposmatic Password for user maposmatic: yyyyyyyyyyyyyyyy CREATE VIEW CREATE AGGREGATE ==== Dépendances ocitysmap ==== $ sudo aptitude install python-pygresql The following NEW packages will be automatically installed: python-egenix-mxdatetime python-egenix-mxtools The following NEW packages will be installed: python-egenix-mxdatetime python-egenix-mxtools python-pygresql 0 packages upgraded, 3 newly installed, 0 to remove and 0 not upgraded. $ sudo aptitude install python-gdal $ PYTHONPATH="/home/maposmatic/apps/lib64/python2.5/site-packages" LD_LIBRARY_PATH="/home/maposmatic/apps/lib64/" ./ocitysmap-render -f png Sanguinet ==== Tests (sur dépôt fdl) ==== $ cd ~/download $ git clone git://lehobey.net/git/ocitysmap-fdl.git $ cd ocitysmap-fdl $ ~/download/ocitysmap-fdl$ PYTHONPATH="/home/maposmatic/apps/lib64/python2.5/site-packages" LD_LIBRARY_PATH="/home/maposmatic/apps/lib64/" ./ocitysmap-render -f png -c Sanguinet ==== Fichier de configuration ==== $ cp ocitysmap.conf ~/.ocitysmap.conf $ vi ~/.ocitysmap.conf [datasource] host=localhost user=maposmatic password=yyyyyyyyyyyyyyyy dbname=maposmatic [mapnik] map=/home/maposmatic/download/mapnik-osm/osm.xml [ocitysmap] copyright_logo=/home/maposmatic/download/ocitysmap/Openstreetmap_logo.png === Test === $ cd ~download/ocitysmap/ $ PYTHONPATH="/home/maposmatic/apps/lib64/python2.5/site-packages" LD_LIBRARY_PATH="/home/maposmatic/apps/lib64/" ./ocitysmap-render -f png -c Sanguinet ==== Installation mapOSMatic ==== === Dépendances === $ sudo aptitude install python-psycopg2 === À partir des sources === $ cd $ mkdir -p apache/maposmatic-prod/ $ cd apache/maposmatic-prod/ $ git clone git://lehobey.net/git/maposmatic.git websrv $ vi ~/apache/maposmatic-prod/websrv/www/maposmatic.wsgi import os, sys sys.path.append("/home/maposmatic/apache/maposmatic-prod/websrv/www") os.environ["DJANGO_SETTINGS_MODULE"] = 'settings' import django.core.handlers.wsgi application = django.core.handlers.wsgi.WSGIHandler() $ sudo vi /etc/apache2/sites-available/maposmatic_org ServerAdmin postmaster@maposmatic.org ServerName www.maposmatic.org ServerAlias maposmatic.org DocumentRoot /home/maposmatic/apache/maposmatic-prod/websrv/www WSGIScriptAlias / /home/maposmatic/apache/maposmatic-prod/websrv/www/maposmatic.wsgi Options FollowSymLinks AllowOverride None Alias /smedia /home/maposmatic/apache/maposmatic-prod/websrv/www/media/ Options FollowSymlinks +Indexes Order allow,deny Allow from all LogLevel warn ServerSignature On CustomLog /var/log/apache2/maposmatic_org/access.log combined ErrorLog /var/log/apache2/maposmatic_org/error.log $ sudo da2ensite maposmatic_org $ sudo aptitude install libapache2-mod-wsgi $ emacs ~/apache/maposmatic-prod/websrv/www/settings_local.py import logging DEBUG = True ADMINS = ( ('MapOSMatic admin', 'contact@maposmatic.org'), ) DATABASE_ENGINE = 'postgresql_psycopg2' # 'postgresql_psycopg2', 'pos\tgresql', 'mysql', 'sqlite3' or 'oracle'. DATABASE_NAME = 'maposmatic' # Or path to database file if using sq\lite3. DATABASE_USER = 'maposmatic' # Not used with sqlite3. DATABASE_PASSWORD = 'yyyyyyyyyyyyyyyy' # Not used with sqlite3. DATABASE_HOST = 'localhost' # Set to empty string for localhost. No\t used with sqlite3. DATABASE_PORT = '' # Set to empty string for default. Not used with\ sqlite3. RENDERING_RESULT_PATH = '/home/maposmatic/apache/maposmatic-prod/rendering' RENDERING_RESULT_URL = 'http://maposmatic.org/rendered/' WWW_LOGFILE = '/tmp/maposmatic-www.log' WWW_LOGLEVEL = logging.INFO DAEMON_LOGFILE = '/tmp/maposmaticd.log' DAEMON_LOGLEVEL = logging.INFO ==== Archives d2 ==== sudo aptitude install libapache2-mod-wsgi fichier maposmatic.wsgi dans le www/ du git maposmatic : ------------------------------ import os, sys print >>sys.stderr, "SALUT MON POTE" sys.path.append("/home/maposmatic/apache/maposmatic-prod/websrv/www") print >>sys.stderr, "HELLO MON POTE", sys.path os.environ["DJANGO_SETTINGS_MODULE"] = 'settings' import django.core.handlers.wsgi application = django.core.handlers.wsgi.WSGIHandler() ------------------------------ /etc/apache2/sites-available/maposmatic_org ------------------------------ ServerAdmin postmaster@maposmatic.org ServerName www.maposmatic.org ServerAlias maposmatic.org DocumentRoot /home/maposmatic/apache/maposmatic-prod/websrv/www WSGIScriptAlias / /home/maposmatic/apache/maposmatic-prod/websrv/www/maposmatic.wsgi Options FollowSymLinks AllowOverride None Alias /smedia /home/maposmatic/apache/maposmatic-prod/websrv/www/media/ Options FollowSymlinks +Indexes Order allow,deny Allow from all LogLevel warn ServerSignature On CustomLog /var/log/apache2/maposmatic_org/access.log combined ErrorLog /var/log/apache2/maposmatic_org/error.log ------------------------------ shell> mkdir /var/log/apache2/maposmatic_org shell> sudo a2ensite maposmatic_org suivre le INSTALL de maposmatic ==== Paramétrage démon ==== $ mkdir /home/maposmatic/apache/maposmatic-prod/rendering À compléter par d2. ==== Le service ==== $ sudo cp /etc/init.d/skeleton /etc/init.d/maposmaticd $ sudo emacs -nw /etc/init.d/maposmaticd #! /bin/sh ### BEGIN INIT INFO # Provides: maposmaticd # Required-Start: $local_fs $remote_fs # Required-Stop: $local_fs $remote_fs # Default-Start: 2 3 4 5 # Default-Stop: S 0 1 6 # Short-Description: maposmatic job scheduler # Description: This script starts the mapOSMaticd job scheduler and # rendering daemon ### END INIT INFO # Author: mapOSMatic authors # Do NOT "set -e" # PATH should only include /usr/* if it runs after the mountnfs.sh script PATH=/usr/sbin:/usr/bin:/sbin:/bin DESC="Starts the mapOSMaticd job scheduler and rendering daemon" NAME=maposmaticd DAEMON=/home/maposmatic/apache/maposmatic-prod/websrv/scripts/$NAME.sh DAEMON_ARGS="" PIDFILE=/var/run/$NAME.pid SCRIPTNAME=/etc/init.d/$NAME # Exit if the package is not installed [ -x "$DAEMON" ] || exit 0 # Read configuration variable file if it is present [ -r /etc/default/$NAME ] && . /etc/default/$NAME # Load the VERBOSE setting and other rcS variables [ -f /etc/default/rcS ] && . /etc/default/rcS # Define LSB log_* functions. # Depend on lsb-base (>= 3.0-6) to ensure that this file is present. . /lib/lsb/init-functions # # Function that starts the daemon/service # do_start() { # Return # 0 if daemon has been started # 1 if daemon was already running # 2 if daemon could not be started start-stop-daemon --start --quiet --background --pidfile $PIDFILE --make-pidfile --chuid maposmatic:maposmatic --exec $DAEMON --test > /dev/null \ || return 1 start-stop-daemon --start --quiet --background --pidfile $PIDFILE --make-pidfile --chuid maposmatic:maposmatic --exec $DAEMON -- \ $DAEMON_ARGS \ || return 2 # Add code here, if necessary, that waits for the process to be ready # to handle requests from services started subsequently which depend # on this one. As a last resort, sleep for some time. } # # Function that stops the daemon/service # do_stop() { # Return # 0 if daemon has been stopped # 1 if daemon was already stopped # 2 if daemon could not be stopped # other if a failure occurred start-stop-daemon --stop --quiet --retry=TERM/30/KILL/5 --pidfile $PIDFILE RETVAL="$?" [ "$RETVAL" = 2 ] && return 2 # Wait for children to finish too if this is a daemon that forks # and if the daemon is only ever run from this initscript. # If the above conditions are not satisfied then add some other code # that waits for the process to drop all resources that could be # needed by services started subsequently. A last resort is to # sleep for some time. start-stop-daemon --stop --quiet --oknodo --retry=0/30/KILL/5 --exec $DAEMON [ "$?" = 2 ] && return 2 # Many daemons don't delete their pidfiles when they exit. rm -f $PIDFILE return "$RETVAL" } # # Function that sends a SIGHUP to the daemon/service # do_reload() { # # If the daemon can reload its configuration without # restarting (for example, when it is sent a SIGHUP), # then implement that here. # #start-stop-daemon --stop --signal 1 --quiet --pidfile $PIDFILE --name $NAME echo "$SCRIPTNAME: reload not supported" >&2 return 0 } case "$1" in start) [ "$VERBOSE" != no ] && log_daemon_msg "Starting $DESC" "$NAME" do_start case "$?" in 0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;; 2) [ "$VERBOSE" != no ] && log_end_msg 1 ;; esac ;; stop) [ "$VERBOSE" != no ] && log_daemon_msg "Stopping $DESC" "$NAME" do_stop case "$?" in 0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;; 2) [ "$VERBOSE" != no ] && log_end_msg 1 ;; esac ;; #reload|force-reload) # # If do_reload() is not implemented then leave this commented out # and leave 'force-reload' as an alias for 'restart'. # #log_daemon_msg "Reloading $DESC" "$NAME" #do_reload #log_end_msg $? #;; restart|force-reload) # # If the "reload" option is implemented then remove the # 'force-reload' alias # log_daemon_msg "Restarting $DESC" "$NAME" do_stop case "$?" in 0|1) do_start case "$?" in 0) log_end_msg 0 ;; 1) log_end_msg 1 ;; # Old process is still running *) log_end_msg 1 ;; # Failed to start esac ;; *) # Failed to stop log_end_msg 1 ;; esac ;; *) #echo "Usage: $SCRIPTNAME {start|stop|restart|reload|force-reload}" >&2 echo "Usage: $SCRIPTNAME {start|stop|restart|force-reload}" >&2 exit 3 ;; esac : $ sudo update-rc.d maposmaticd defaults Adding system startup for /etc/init.d/maposmaticd ... /etc/rc0.d/K20maposmaticd -> ../init.d/maposmaticd /etc/rc1.d/K20maposmaticd -> ../init.d/maposmaticd /etc/rc6.d/K20maposmaticd -> ../init.d/maposmaticd /etc/rc2.d/S20maposmaticd -> ../init.d/maposmaticd /etc/rc3.d/S20maposmaticd -> ../init.d/maposmaticd /etc/rc4.d/S20maposmaticd -> ../init.d/maposmaticd /etc/rc5.d/S20maposmaticd -> ../init.d/maposmaticd $ sudo chmod 755 /etc/init.d/maposmaticd