SlideShare uma empresa Scribd logo
1 de 6
Baixar para ler offline
INSTALLING MAPSERVER AND PHP MAPSCRIPT ON LINUX


Author    : Lorensius W. L. T
Email     : lorenz@londatiga.net
Website   : http://www.londatiga.net
Link       : http://www.londatiga.net/downloads/tutorial/mapserver_install_linux.pdf


Introduction

MapServer is an open source and free software for rendering maps, images, and vector data on the web.
MapServer was originally developed by the University of Minnesota (UMN) ForNet project in
cooperation with NASA and the Minnesota Department of Natural Resources. Presently, the MapServer
project is hosted by the TerraSIP, a NASA sponsored project between the UMN and consortium of land
management interests (http://mapserver.gis.umn.edu).

MapServer can be compiled on many platforms and operating systems, but in this tutorial, I will focus on
unix like system, especially Linux.

Prerequisites

Operating system used in this tutorial is Linux Fedora Core 7 with Apache (httpd-2.0.55), PHP (php-
5.2.3), and PostgreSQL(postgresql-8.2.4) already installed using manual source installation (not using
default rpm package). Required libraries that already installed are libpng, libjpeg, libtiff, and zlib.
Installation manual for those softwares and libraries are beyond the scope of this tutorial.

Required softwares and libraries:

    1. MapServer: is the main software.
       Source: http://download.osgeo.org/mapserver/mapserver-5.0.2.tar.gz
    2. GD: used by MapServer for rendering images, version 2.0.28 or greater is required.
       Source: http://www.libgd.org/releases/gd-2.0.35.tar.gz
    3. PROJ.4: provides projection support for MapServer (also needed by PostGIS), version 4.4.6 or
       greater is required.
       Source: ftp://ftp.remotesensing.org/proj/proj-4.6.0.tar.gz
    4. GEOS: enables MapServer to do spatial operation (within, touches, union, difference,
       intersection), also needed by PostGIS, version 4.10 or greater is required.
       Source: http://geos.refractions.net/downloads/geos-3.0.0.tar.bz2
    5. GDAL: provides access to at least 42 different raster formats.
       Source: http://download.osgeo.org/gdal/gdal-1.5.1.tar.gz
    6. OGR: provides access to at least 18 different vector formats.
       Source: http://download.osgeo.org/gdal/gdal-1.5.1.tar.gz
7. CURL: is the foundation of OGC (WFS, WMS, WCS) client and server support, requires version
       7.10 or greater.
       Source: http://curl.haxx.se/download/curl-7.18.1.tar.gz
    8. PostGIS: adds support for geographic objects to the PostgreSQL.
       Source: http://www.postgis.org/download/postgis-1.3.3.tar.gz

Note:
Apache was installed under /usr/local/apache
PostgreSQL was installed under /usr/local/pgsql
All previously installed libraries (libpng, libjpeg, libtiff, and zlib) were installed under /usr/lib
Apache root directory is /data/www/html, cgi-bin directory is /data/www/cgi-bin


Installation

    1. GD

        Installation steps:

                 [lorenz@devel>>installer]$ tar –xzvf gd-2.0.35.tar.gz
                 [lorenz@devel>>installer]$ cd gd-2.0.35
                 [lorenz@devel>>gd-2.0.35]$ ./configure
                 [lorenz@devel>>gd-2.0.35]$ make
                 [lorenz@devel>>gd-2.0.35]$ make install

        Note: default installation directory is /usr/local

    2. PROJ.4

        Installation steps:

                 [lorenz@devel>>installer]$ tar –xzvf proj-4.6.0.tar.gz
                 [lorenz@devel>>installer]$ cd proj-4.6.0
                 [lorenz@devel>>proj-4.6.0]$ ./configure
                 [lorenz@devel>> proj-4.6.0]$ make
                 [lorenz@devel>> proj-4.6.0]$ make install

        Note: default installation directory is /usr/local


    3. GEOS

        Installation steps:

                 [lorenz@devel>>installer]$ tar –xjvf geos-3.0.0.tar.bz2
                 [lorenz@devel>>installer]$ cd geos-3.0.0
[lorenz@devel>>geos-3.0.0]$ ./configure
           [lorenz@devel>>geos-3.0.0]$ make
           [lorenz@devel>>geos-3.0.0]$ make install

   Note: default installation directory is /usr/local


4. GDAL

   Installation steps:

           [lorenz@devel>>installer]$ tar –xzvf gdal-1.5.1.tar.gz
           [lorenz@devel>>installer]$ cd gdal-1.5.1
           [lorenz@devel>>gdal-1.5.1]$ ./configure
           [lorenz@devel>>gdal-1.5.1]$ make
           [lorenz@devel>>gdal-1.5.1]$ make install

   Note: default installation directory is /usr/local

5. CURL

   Installation steps:

           [lorenz@devel>>installer]$ tar –xzvf curl-7.18.1.tar.gz
           [lorenz@devel>>installer]$ cd curl-7.18.1
           [lorenz@devel>>curl-7.18.1]$ ./configure
           [lorenz@devel>>curl-7.18.1]$ make
           [lorenz@devel>>curl-7.18.1]$ make install

   Note: default installation directory is /usr/local

6. Update ld-config

           [lorenz@devel>>installer]$ cd /etc/ld.so.conf.d/
           [lorenz@devel>>ld.so.conf.d]$ echo /usr/local/lib > usrlocalib.conf
           [lorenz@devel>>ld.so.conf.d]$ /sbin/ldconfig


7. POSTGIS

   Installation steps:

           [lorenz@devel>>installer]$ tar –xzvf postgis-1.3.3.tar.gz
           [lorenz@devel>>installer]$ cd postgis-1.3.3
           [lorenz@devel>>postgis-1.3.3]$ ./configure --with-
           pgsql=/usr/local/pgsql/bin/pg_config --with-proj --with-geos
           [lorenz@devel>>postgis-1.3.3]$ make
[lorenz@devel>>postgis-1.3.3]$ make install



8. Recompile PHP as CGI

   Installation steps:

           [lorenz@devel>>installer]$ cd php-5.2.3
           [lorenz@devel> php-5.2.3 ]$ ./configure 
           > --enable-force-cgi-redirect 
           > --with-gd=/usr/local/ 
           > --with-jpeg-dir=/usr/lib 
           > --with-png-dir=/usr/lib 
           > --with-tiff-dir=/usr/lib 
           > --with-zlib-dir=/usr/lib 
           > --with-freetype-dir=/usr/lib 
           > --without-ttf 
           > --with-mysql=/usr/local/mysql/ 
           > --with-pgsql=/usr/local/pgsql/ 
           > --with-curl=/usr/local/ 
           > --with-gettext 
           > --enable-ftp 
           > --enable-xml 
           > --with-zlib 
           > --with-regex=system 
           > --enable-dbase 
           > --enable-dbx 
           > --with-config-file-path=/usr/local/lib
           [lorenz@devel>>php-5.2.3]$ make
           [lorenz@devel>>php-5.2.3]$ cp sapi/cgi/php-cgi /data/www/cgi-bin

       Note: DO NOT do a “make install”


9. MapServer

   Installation steps:

           [lorenz@devel>>installer]$ tar –xzvf mapserver-5.0.2.tar.gz
           [lorenz@devel>>installer]$ cd mapserver-5.0.2
           [lorenz@devel>>mapserver-5.0.2]$ ./configure --with-ogr=/usr/local/bin/gdal-config 
           --with-gdal=/usr/local/bin/gdal-config 
           --with-httpd=/usr/local/apache/bin/httpd 
           --with-wfsclient 
           --with-wmsclient 
           --enable-debug
--with-curl-config=/usr/local/bin/curl-config 
           --with-proj=/usr/local 
           --with-tiff 
           --with-gd=/usr/local 
           --with-jpeg 
           --with-freetype=/usr/ 
           --with-threads 
           --with-wcs 
           --with-postgis=/usr/local/pgsql/bin/pg_config 
           --with-libiconv=/usr 
           --with-geos=/usr/local/bin/geos-config 
           --with-xml2-config=/usr/bin/xml2-config 
           --with-sos 
           --with-php=../php-5.2.3/
           [lorenz@devel>>mapserver-5.0.2]$ make

   Note: DO NOT do a “make install”

   PHP MapScript installation steps;

           [lorenz@devel>>mapserver-5.0.2]$ cp mapserv legend scalebar /data/www/cgi-bin
           [lorenz@devel>>mapserver-5.0.2]$ mkdir /usr/local/lib/php/extensions
           [lorenz@devel>>mapserver-5.0.2]$ cp mapscript/php3/php_mapscript.so
           /usr/local/lib/php/extensions
           [lorenz@devel>>mapserver-5.0.2]$ cd /usr/local/lib
           Edit file php.ini and add two lines below:

           extension_dir = "/usr/local/lib/php/extensions"
           extension = "php_mapscript.so"

           Edit file /usr/local/apache/conf/httpd.conf and add two lines below:

           AddType application/x-httpd-php-cgi .phtml
           Action application/x-httpd-php-cgi /cgi-bin/php-cgi

           Restart apache (#/usr/local/apache/bin/apachectl restart)

10. Test PHP Mapscript

   To test PHP MapScript that already installed:

           Go into web root directory (/data/www/html)
           Create php file and add phpinfo() line into the file
           Save the file as info.phtml
           Open browser and point to http://localhost/info.phtml
           If installation is successful, the phpinfo page should contain part like this:
To test drawing map, you can download simple demo application from
http://www.londatiga.net/downloads/tutorial/phpmapscript-demo.tar.gz

Installation steps:

        [lorenz@devel>>installer]$ cp phpmapscript-demo.tar.gz /data/www/html
        [lorenz@devel>>installer]$ cd /data/www/html
        [lorenz@devel>>html]$ tar –xzvf phpmapscript-demo.tar.gz
        [lorenz@devel>>html]$ chmod 777 tmp
        Open browser and point to http://localhost/phpmapscript-demo
        If all things running well it should display a map

Mais conteúdo relacionado

Mais procurados

Gitosis on Mac OS X Server
Gitosis on Mac OS X ServerGitosis on Mac OS X Server
Gitosis on Mac OS X Server
Yasuhiro Asaka
 

Mais procurados (16)

Open Source Backup Conference 2014: Workshop bareos introduction, by Philipp ...
Open Source Backup Conference 2014: Workshop bareos introduction, by Philipp ...Open Source Backup Conference 2014: Workshop bareos introduction, by Philipp ...
Open Source Backup Conference 2014: Workshop bareos introduction, by Philipp ...
 
[ETHCon Korea 2019] Shin mansun 신만선
[ETHCon Korea 2019] Shin mansun 신만선[ETHCon Korea 2019] Shin mansun 신만선
[ETHCon Korea 2019] Shin mansun 신만선
 
Paver For PyWorks 2008
Paver For PyWorks 2008Paver For PyWorks 2008
Paver For PyWorks 2008
 
Gitosis on Mac OS X Server
Gitosis on Mac OS X ServerGitosis on Mac OS X Server
Gitosis on Mac OS X Server
 
Conquering the Command Line
Conquering the Command LineConquering the Command Line
Conquering the Command Line
 
First there was the command line
First there was the command lineFirst there was the command line
First there was the command line
 
Learning the command line
Learning the command lineLearning the command line
Learning the command line
 
Clojure + MongoDB on Heroku
Clojure + MongoDB on HerokuClojure + MongoDB on Heroku
Clojure + MongoDB on Heroku
 
Backups
BackupsBackups
Backups
 
Хокку про Heroku
Хокку про HerokuХокку про Heroku
Хокку про Heroku
 
Docker for data science
Docker for data scienceDocker for data science
Docker for data science
 
Postgresql 12 streaming replication hol
Postgresql 12 streaming replication holPostgresql 12 streaming replication hol
Postgresql 12 streaming replication hol
 
Installing Cacti openSUSE Leap 42.1
Installing Cacti openSUSE Leap 42.1Installing Cacti openSUSE Leap 42.1
Installing Cacti openSUSE Leap 42.1
 
Os Treat
Os TreatOs Treat
Os Treat
 
Linux-Fu for PHP Developers
Linux-Fu for PHP DevelopersLinux-Fu for PHP Developers
Linux-Fu for PHP Developers
 
The Puppet Debugging Kit: Building Blocks for Exploration and Problem Solving...
The Puppet Debugging Kit: Building Blocks for Exploration and Problem Solving...The Puppet Debugging Kit: Building Blocks for Exploration and Problem Solving...
The Puppet Debugging Kit: Building Blocks for Exploration and Problem Solving...
 

Destaque

Cracking Pseudorandom Sequences Generators in Java Applications
Cracking Pseudorandom Sequences Generators in Java ApplicationsCracking Pseudorandom Sequences Generators in Java Applications
Cracking Pseudorandom Sequences Generators in Java Applications
Positive Hack Days
 
'A View-Based Approach to Quality of Service Modelling in Service-Oriented En...
'A View-Based Approach to Quality of Service Modelling in Service-Oriented En...'A View-Based Approach to Quality of Service Modelling in Service-Oriented En...
'A View-Based Approach to Quality of Service Modelling in Service-Oriented En...
IIBA_Latvia_Chapter
 
Montando seu DataCenter Pessoal - Fernando Massen
Montando seu DataCenter Pessoal - Fernando MassenMontando seu DataCenter Pessoal - Fernando Massen
Montando seu DataCenter Pessoal - Fernando Massen
Tchelinux
 
User Profiles: I Didn't Know I Could Do That (Updated Demo)
User Profiles:  I Didn't Know I Could Do That (Updated Demo)User Profiles:  I Didn't Know I Could Do That (Updated Demo)
User Profiles: I Didn't Know I Could Do That (Updated Demo)
Stacy Deere
 
GlassFish, Maven, Cloud e Java EE
GlassFish, Maven, Cloud e Java EEGlassFish, Maven, Cloud e Java EE
GlassFish, Maven, Cloud e Java EE
Bruno Borges
 
Privilege Escalation
Privilege EscalationPrivilege Escalation
Privilege Escalation
Caleb Sima
 
Iliad or Seaside
Iliad or SeasideIliad or Seaside
Iliad or Seaside
Sho Yoshida
 

Destaque (20)

Cracking Pseudorandom Sequences Generators in Java Applications
Cracking Pseudorandom Sequences Generators in Java ApplicationsCracking Pseudorandom Sequences Generators in Java Applications
Cracking Pseudorandom Sequences Generators in Java Applications
 
Apresentação Multimídia Móveis
Apresentação Multimídia MóveisApresentação Multimídia Móveis
Apresentação Multimídia Móveis
 
企业级软件的组件化和动态化开发实践
企业级软件的组件化和动态化开发实践企业级软件的组件化和动态化开发实践
企业级软件的组件化和动态化开发实践
 
'A View-Based Approach to Quality of Service Modelling in Service-Oriented En...
'A View-Based Approach to Quality of Service Modelling in Service-Oriented En...'A View-Based Approach to Quality of Service Modelling in Service-Oriented En...
'A View-Based Approach to Quality of Service Modelling in Service-Oriented En...
 
Montando seu DataCenter Pessoal - Fernando Massen
Montando seu DataCenter Pessoal - Fernando MassenMontando seu DataCenter Pessoal - Fernando Massen
Montando seu DataCenter Pessoal - Fernando Massen
 
夏サミ2014 クラウドとCIツールで変わるエンタープライズJava開発
夏サミ2014 クラウドとCIツールで変わるエンタープライズJava開発 夏サミ2014 クラウドとCIツールで変わるエンタープライズJava開発
夏サミ2014 クラウドとCIツールで変わるエンタープライズJava開発
 
User Profiles: I Didn't Know I Could Do That (Updated Demo)
User Profiles:  I Didn't Know I Could Do That (Updated Demo)User Profiles:  I Didn't Know I Could Do That (Updated Demo)
User Profiles: I Didn't Know I Could Do That (Updated Demo)
 
Owasp top 10_-_2013
Owasp top 10_-_2013Owasp top 10_-_2013
Owasp top 10_-_2013
 
What's Next with Government Big Data
What's Next with Government Big Data What's Next with Government Big Data
What's Next with Government Big Data
 
Know Your PHY Types.
Know Your PHY Types.Know Your PHY Types.
Know Your PHY Types.
 
Tomcat Maven Plugin
Tomcat Maven PluginTomcat Maven Plugin
Tomcat Maven Plugin
 
GlassFish, Maven, Cloud e Java EE
GlassFish, Maven, Cloud e Java EEGlassFish, Maven, Cloud e Java EE
GlassFish, Maven, Cloud e Java EE
 
ORCID ED Report 10292013
ORCID ED Report 10292013ORCID ED Report 10292013
ORCID ED Report 10292013
 
Sistem keamanan komputer
Sistem keamanan komputerSistem keamanan komputer
Sistem keamanan komputer
 
El papel del vídeo en la Web 2.0
El papel del vídeo en la Web 2.0El papel del vídeo en la Web 2.0
El papel del vídeo en la Web 2.0
 
201501 gests423 s6_part_i
201501 gests423 s6_part_i201501 gests423 s6_part_i
201501 gests423 s6_part_i
 
S5L2010 datasheet
S5L2010 datasheetS5L2010 datasheet
S5L2010 datasheet
 
Privilege Escalation
Privilege EscalationPrivilege Escalation
Privilege Escalation
 
Iliad or Seaside
Iliad or SeasideIliad or Seaside
Iliad or Seaside
 
SoftwareAsia Product Profile
SoftwareAsia Product ProfileSoftwareAsia Product Profile
SoftwareAsia Product Profile
 

Semelhante a mapserver_install_linux

Globus toolkit4installationguide
Globus toolkit4installationguideGlobus toolkit4installationguide
Globus toolkit4installationguide
Adarsh Patil
 
Deploying with Super Cow Powers (Hosting your own APT repository with reprepro)
Deploying with Super Cow Powers (Hosting your own APT repository with reprepro)Deploying with Super Cow Powers (Hosting your own APT repository with reprepro)
Deploying with Super Cow Powers (Hosting your own APT repository with reprepro)
Simon Boulet
 
EF09-Installing-Alfresco-components-1-by-1.pdf
EF09-Installing-Alfresco-components-1-by-1.pdfEF09-Installing-Alfresco-components-1-by-1.pdf
EF09-Installing-Alfresco-components-1-by-1.pdf
DangGonz
 

Semelhante a mapserver_install_linux (20)

Hadoop single node installation on ubuntu 14
Hadoop single node installation on ubuntu 14Hadoop single node installation on ubuntu 14
Hadoop single node installation on ubuntu 14
 
[EXTENDED] Ceph, Docker, Heroku Slugs, CoreOS and Deis Overview
[EXTENDED] Ceph, Docker, Heroku Slugs, CoreOS and Deis Overview[EXTENDED] Ceph, Docker, Heroku Slugs, CoreOS and Deis Overview
[EXTENDED] Ceph, Docker, Heroku Slugs, CoreOS and Deis Overview
 
Hadoop installation on windows
Hadoop installation on windows Hadoop installation on windows
Hadoop installation on windows
 
Ruby and Rails Packaging to Production
Ruby and Rails Packaging to ProductionRuby and Rails Packaging to Production
Ruby and Rails Packaging to Production
 
PHP selber bauen
PHP selber bauenPHP selber bauen
PHP selber bauen
 
2017-03-11 02 Денис Нелюбин. Docker & Ansible - лучшие друзья DevOps
2017-03-11 02 Денис Нелюбин. Docker & Ansible - лучшие друзья DevOps2017-03-11 02 Денис Нелюбин. Docker & Ansible - лучшие друзья DevOps
2017-03-11 02 Денис Нелюбин. Docker & Ansible - лучшие друзья DevOps
 
Hadoop Installation
Hadoop InstallationHadoop Installation
Hadoop Installation
 
Globus toolkit4installationguide
Globus toolkit4installationguideGlobus toolkit4installationguide
Globus toolkit4installationguide
 
Deploying with Super Cow Powers (Hosting your own APT repository with reprepro)
Deploying with Super Cow Powers (Hosting your own APT repository with reprepro)Deploying with Super Cow Powers (Hosting your own APT repository with reprepro)
Deploying with Super Cow Powers (Hosting your own APT repository with reprepro)
 
EF09-Installing-Alfresco-components-1-by-1.pdf
EF09-Installing-Alfresco-components-1-by-1.pdfEF09-Installing-Alfresco-components-1-by-1.pdf
EF09-Installing-Alfresco-components-1-by-1.pdf
 
Installing odoo v8 from github
Installing odoo v8 from githubInstalling odoo v8 from github
Installing odoo v8 from github
 
Deploying PHP Applications with Ansible
Deploying PHP Applications with AnsibleDeploying PHP Applications with Ansible
Deploying PHP Applications with Ansible
 
Ansible : what's ansible & use case by REX
Ansible :  what's ansible & use case by REXAnsible :  what's ansible & use case by REX
Ansible : what's ansible & use case by REX
 
Write php deploy everywhere
Write php deploy everywhereWrite php deploy everywhere
Write php deploy everywhere
 
How to make debian package from scratch (linux)
How to make debian package from scratch (linux)How to make debian package from scratch (linux)
How to make debian package from scratch (linux)
 
Ef09 installing-alfresco-components-1-by-1
Ef09 installing-alfresco-components-1-by-1Ef09 installing-alfresco-components-1-by-1
Ef09 installing-alfresco-components-1-by-1
 
Run wordcount job (hadoop)
Run wordcount job (hadoop)Run wordcount job (hadoop)
Run wordcount job (hadoop)
 
Hadoop 2.4 installing on ubuntu 14.04
Hadoop 2.4 installing on ubuntu 14.04Hadoop 2.4 installing on ubuntu 14.04
Hadoop 2.4 installing on ubuntu 14.04
 
Dspace tutorial
Dspace tutorialDspace tutorial
Dspace tutorial
 
DSpace Tutorial : Open Source Digital Library
DSpace Tutorial : Open Source Digital LibraryDSpace Tutorial : Open Source Digital Library
DSpace Tutorial : Open Source Digital Library
 

Mais de tutorialsruby

<img src="../i/r_14.png" />
<img src="../i/r_14.png" /><img src="../i/r_14.png" />
<img src="../i/r_14.png" />
tutorialsruby
 
TopStyle Help & <b>Tutorial</b>
TopStyle Help & <b>Tutorial</b>TopStyle Help & <b>Tutorial</b>
TopStyle Help & <b>Tutorial</b>
tutorialsruby
 
The Art Institute of Atlanta IMD 210 Fundamentals of Scripting <b>...</b>
The Art Institute of Atlanta IMD 210 Fundamentals of Scripting <b>...</b>The Art Institute of Atlanta IMD 210 Fundamentals of Scripting <b>...</b>
The Art Institute of Atlanta IMD 210 Fundamentals of Scripting <b>...</b>
tutorialsruby
 
<img src="../i/r_14.png" />
<img src="../i/r_14.png" /><img src="../i/r_14.png" />
<img src="../i/r_14.png" />
tutorialsruby
 
<img src="../i/r_14.png" />
<img src="../i/r_14.png" /><img src="../i/r_14.png" />
<img src="../i/r_14.png" />
tutorialsruby
 
Standardization and Knowledge Transfer – INS0
Standardization and Knowledge Transfer – INS0Standardization and Knowledge Transfer – INS0
Standardization and Knowledge Transfer – INS0
tutorialsruby
 
0047ecaa6ea3e9ac0a13a2fe96f4de3bfd515c88f5d90c1fae79b956363d7f02c7fa060269
0047ecaa6ea3e9ac0a13a2fe96f4de3bfd515c88f5d90c1fae79b956363d7f02c7fa0602690047ecaa6ea3e9ac0a13a2fe96f4de3bfd515c88f5d90c1fae79b956363d7f02c7fa060269
0047ecaa6ea3e9ac0a13a2fe96f4de3bfd515c88f5d90c1fae79b956363d7f02c7fa060269
tutorialsruby
 
0047ecaa6ea3e9ac0a13a2fe96f4de3bfd515c88f5d90c1fae79b956363d7f02c7fa060269
0047ecaa6ea3e9ac0a13a2fe96f4de3bfd515c88f5d90c1fae79b956363d7f02c7fa0602690047ecaa6ea3e9ac0a13a2fe96f4de3bfd515c88f5d90c1fae79b956363d7f02c7fa060269
0047ecaa6ea3e9ac0a13a2fe96f4de3bfd515c88f5d90c1fae79b956363d7f02c7fa060269
tutorialsruby
 
BloggingWithStyle_2008
BloggingWithStyle_2008BloggingWithStyle_2008
BloggingWithStyle_2008
tutorialsruby
 
BloggingWithStyle_2008
BloggingWithStyle_2008BloggingWithStyle_2008
BloggingWithStyle_2008
tutorialsruby
 
cascadingstylesheets
cascadingstylesheetscascadingstylesheets
cascadingstylesheets
tutorialsruby
 
cascadingstylesheets
cascadingstylesheetscascadingstylesheets
cascadingstylesheets
tutorialsruby
 

Mais de tutorialsruby (20)

<img src="../i/r_14.png" />
<img src="../i/r_14.png" /><img src="../i/r_14.png" />
<img src="../i/r_14.png" />
 
TopStyle Help & <b>Tutorial</b>
TopStyle Help & <b>Tutorial</b>TopStyle Help & <b>Tutorial</b>
TopStyle Help & <b>Tutorial</b>
 
The Art Institute of Atlanta IMD 210 Fundamentals of Scripting <b>...</b>
The Art Institute of Atlanta IMD 210 Fundamentals of Scripting <b>...</b>The Art Institute of Atlanta IMD 210 Fundamentals of Scripting <b>...</b>
The Art Institute of Atlanta IMD 210 Fundamentals of Scripting <b>...</b>
 
<img src="../i/r_14.png" />
<img src="../i/r_14.png" /><img src="../i/r_14.png" />
<img src="../i/r_14.png" />
 
<img src="../i/r_14.png" />
<img src="../i/r_14.png" /><img src="../i/r_14.png" />
<img src="../i/r_14.png" />
 
Standardization and Knowledge Transfer – INS0
Standardization and Knowledge Transfer – INS0Standardization and Knowledge Transfer – INS0
Standardization and Knowledge Transfer – INS0
 
xhtml_basics
xhtml_basicsxhtml_basics
xhtml_basics
 
xhtml_basics
xhtml_basicsxhtml_basics
xhtml_basics
 
xhtml-documentation
xhtml-documentationxhtml-documentation
xhtml-documentation
 
xhtml-documentation
xhtml-documentationxhtml-documentation
xhtml-documentation
 
CSS
CSSCSS
CSS
 
CSS
CSSCSS
CSS
 
0047ecaa6ea3e9ac0a13a2fe96f4de3bfd515c88f5d90c1fae79b956363d7f02c7fa060269
0047ecaa6ea3e9ac0a13a2fe96f4de3bfd515c88f5d90c1fae79b956363d7f02c7fa0602690047ecaa6ea3e9ac0a13a2fe96f4de3bfd515c88f5d90c1fae79b956363d7f02c7fa060269
0047ecaa6ea3e9ac0a13a2fe96f4de3bfd515c88f5d90c1fae79b956363d7f02c7fa060269
 
0047ecaa6ea3e9ac0a13a2fe96f4de3bfd515c88f5d90c1fae79b956363d7f02c7fa060269
0047ecaa6ea3e9ac0a13a2fe96f4de3bfd515c88f5d90c1fae79b956363d7f02c7fa0602690047ecaa6ea3e9ac0a13a2fe96f4de3bfd515c88f5d90c1fae79b956363d7f02c7fa060269
0047ecaa6ea3e9ac0a13a2fe96f4de3bfd515c88f5d90c1fae79b956363d7f02c7fa060269
 
HowTo_CSS
HowTo_CSSHowTo_CSS
HowTo_CSS
 
HowTo_CSS
HowTo_CSSHowTo_CSS
HowTo_CSS
 
BloggingWithStyle_2008
BloggingWithStyle_2008BloggingWithStyle_2008
BloggingWithStyle_2008
 
BloggingWithStyle_2008
BloggingWithStyle_2008BloggingWithStyle_2008
BloggingWithStyle_2008
 
cascadingstylesheets
cascadingstylesheetscascadingstylesheets
cascadingstylesheets
 
cascadingstylesheets
cascadingstylesheetscascadingstylesheets
cascadingstylesheets
 

Último

Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Joaquim Jorge
 

Último (20)

Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Evaluating the top large language models.pdf
Evaluating the top large language models.pdfEvaluating the top large language models.pdf
Evaluating the top large language models.pdf
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 

mapserver_install_linux

  • 1. INSTALLING MAPSERVER AND PHP MAPSCRIPT ON LINUX Author : Lorensius W. L. T Email : lorenz@londatiga.net Website : http://www.londatiga.net Link : http://www.londatiga.net/downloads/tutorial/mapserver_install_linux.pdf Introduction MapServer is an open source and free software for rendering maps, images, and vector data on the web. MapServer was originally developed by the University of Minnesota (UMN) ForNet project in cooperation with NASA and the Minnesota Department of Natural Resources. Presently, the MapServer project is hosted by the TerraSIP, a NASA sponsored project between the UMN and consortium of land management interests (http://mapserver.gis.umn.edu). MapServer can be compiled on many platforms and operating systems, but in this tutorial, I will focus on unix like system, especially Linux. Prerequisites Operating system used in this tutorial is Linux Fedora Core 7 with Apache (httpd-2.0.55), PHP (php- 5.2.3), and PostgreSQL(postgresql-8.2.4) already installed using manual source installation (not using default rpm package). Required libraries that already installed are libpng, libjpeg, libtiff, and zlib. Installation manual for those softwares and libraries are beyond the scope of this tutorial. Required softwares and libraries: 1. MapServer: is the main software. Source: http://download.osgeo.org/mapserver/mapserver-5.0.2.tar.gz 2. GD: used by MapServer for rendering images, version 2.0.28 or greater is required. Source: http://www.libgd.org/releases/gd-2.0.35.tar.gz 3. PROJ.4: provides projection support for MapServer (also needed by PostGIS), version 4.4.6 or greater is required. Source: ftp://ftp.remotesensing.org/proj/proj-4.6.0.tar.gz 4. GEOS: enables MapServer to do spatial operation (within, touches, union, difference, intersection), also needed by PostGIS, version 4.10 or greater is required. Source: http://geos.refractions.net/downloads/geos-3.0.0.tar.bz2 5. GDAL: provides access to at least 42 different raster formats. Source: http://download.osgeo.org/gdal/gdal-1.5.1.tar.gz 6. OGR: provides access to at least 18 different vector formats. Source: http://download.osgeo.org/gdal/gdal-1.5.1.tar.gz
  • 2. 7. CURL: is the foundation of OGC (WFS, WMS, WCS) client and server support, requires version 7.10 or greater. Source: http://curl.haxx.se/download/curl-7.18.1.tar.gz 8. PostGIS: adds support for geographic objects to the PostgreSQL. Source: http://www.postgis.org/download/postgis-1.3.3.tar.gz Note: Apache was installed under /usr/local/apache PostgreSQL was installed under /usr/local/pgsql All previously installed libraries (libpng, libjpeg, libtiff, and zlib) were installed under /usr/lib Apache root directory is /data/www/html, cgi-bin directory is /data/www/cgi-bin Installation 1. GD Installation steps: [lorenz@devel>>installer]$ tar –xzvf gd-2.0.35.tar.gz [lorenz@devel>>installer]$ cd gd-2.0.35 [lorenz@devel>>gd-2.0.35]$ ./configure [lorenz@devel>>gd-2.0.35]$ make [lorenz@devel>>gd-2.0.35]$ make install Note: default installation directory is /usr/local 2. PROJ.4 Installation steps: [lorenz@devel>>installer]$ tar –xzvf proj-4.6.0.tar.gz [lorenz@devel>>installer]$ cd proj-4.6.0 [lorenz@devel>>proj-4.6.0]$ ./configure [lorenz@devel>> proj-4.6.0]$ make [lorenz@devel>> proj-4.6.0]$ make install Note: default installation directory is /usr/local 3. GEOS Installation steps: [lorenz@devel>>installer]$ tar –xjvf geos-3.0.0.tar.bz2 [lorenz@devel>>installer]$ cd geos-3.0.0
  • 3. [lorenz@devel>>geos-3.0.0]$ ./configure [lorenz@devel>>geos-3.0.0]$ make [lorenz@devel>>geos-3.0.0]$ make install Note: default installation directory is /usr/local 4. GDAL Installation steps: [lorenz@devel>>installer]$ tar –xzvf gdal-1.5.1.tar.gz [lorenz@devel>>installer]$ cd gdal-1.5.1 [lorenz@devel>>gdal-1.5.1]$ ./configure [lorenz@devel>>gdal-1.5.1]$ make [lorenz@devel>>gdal-1.5.1]$ make install Note: default installation directory is /usr/local 5. CURL Installation steps: [lorenz@devel>>installer]$ tar –xzvf curl-7.18.1.tar.gz [lorenz@devel>>installer]$ cd curl-7.18.1 [lorenz@devel>>curl-7.18.1]$ ./configure [lorenz@devel>>curl-7.18.1]$ make [lorenz@devel>>curl-7.18.1]$ make install Note: default installation directory is /usr/local 6. Update ld-config [lorenz@devel>>installer]$ cd /etc/ld.so.conf.d/ [lorenz@devel>>ld.so.conf.d]$ echo /usr/local/lib > usrlocalib.conf [lorenz@devel>>ld.so.conf.d]$ /sbin/ldconfig 7. POSTGIS Installation steps: [lorenz@devel>>installer]$ tar –xzvf postgis-1.3.3.tar.gz [lorenz@devel>>installer]$ cd postgis-1.3.3 [lorenz@devel>>postgis-1.3.3]$ ./configure --with- pgsql=/usr/local/pgsql/bin/pg_config --with-proj --with-geos [lorenz@devel>>postgis-1.3.3]$ make
  • 4. [lorenz@devel>>postgis-1.3.3]$ make install 8. Recompile PHP as CGI Installation steps: [lorenz@devel>>installer]$ cd php-5.2.3 [lorenz@devel> php-5.2.3 ]$ ./configure > --enable-force-cgi-redirect > --with-gd=/usr/local/ > --with-jpeg-dir=/usr/lib > --with-png-dir=/usr/lib > --with-tiff-dir=/usr/lib > --with-zlib-dir=/usr/lib > --with-freetype-dir=/usr/lib > --without-ttf > --with-mysql=/usr/local/mysql/ > --with-pgsql=/usr/local/pgsql/ > --with-curl=/usr/local/ > --with-gettext > --enable-ftp > --enable-xml > --with-zlib > --with-regex=system > --enable-dbase > --enable-dbx > --with-config-file-path=/usr/local/lib [lorenz@devel>>php-5.2.3]$ make [lorenz@devel>>php-5.2.3]$ cp sapi/cgi/php-cgi /data/www/cgi-bin Note: DO NOT do a “make install” 9. MapServer Installation steps: [lorenz@devel>>installer]$ tar –xzvf mapserver-5.0.2.tar.gz [lorenz@devel>>installer]$ cd mapserver-5.0.2 [lorenz@devel>>mapserver-5.0.2]$ ./configure --with-ogr=/usr/local/bin/gdal-config --with-gdal=/usr/local/bin/gdal-config --with-httpd=/usr/local/apache/bin/httpd --with-wfsclient --with-wmsclient --enable-debug
  • 5. --with-curl-config=/usr/local/bin/curl-config --with-proj=/usr/local --with-tiff --with-gd=/usr/local --with-jpeg --with-freetype=/usr/ --with-threads --with-wcs --with-postgis=/usr/local/pgsql/bin/pg_config --with-libiconv=/usr --with-geos=/usr/local/bin/geos-config --with-xml2-config=/usr/bin/xml2-config --with-sos --with-php=../php-5.2.3/ [lorenz@devel>>mapserver-5.0.2]$ make Note: DO NOT do a “make install” PHP MapScript installation steps; [lorenz@devel>>mapserver-5.0.2]$ cp mapserv legend scalebar /data/www/cgi-bin [lorenz@devel>>mapserver-5.0.2]$ mkdir /usr/local/lib/php/extensions [lorenz@devel>>mapserver-5.0.2]$ cp mapscript/php3/php_mapscript.so /usr/local/lib/php/extensions [lorenz@devel>>mapserver-5.0.2]$ cd /usr/local/lib Edit file php.ini and add two lines below: extension_dir = "/usr/local/lib/php/extensions" extension = "php_mapscript.so" Edit file /usr/local/apache/conf/httpd.conf and add two lines below: AddType application/x-httpd-php-cgi .phtml Action application/x-httpd-php-cgi /cgi-bin/php-cgi Restart apache (#/usr/local/apache/bin/apachectl restart) 10. Test PHP Mapscript To test PHP MapScript that already installed: Go into web root directory (/data/www/html) Create php file and add phpinfo() line into the file Save the file as info.phtml Open browser and point to http://localhost/info.phtml If installation is successful, the phpinfo page should contain part like this:
  • 6. To test drawing map, you can download simple demo application from http://www.londatiga.net/downloads/tutorial/phpmapscript-demo.tar.gz Installation steps: [lorenz@devel>>installer]$ cp phpmapscript-demo.tar.gz /data/www/html [lorenz@devel>>installer]$ cd /data/www/html [lorenz@devel>>html]$ tar –xzvf phpmapscript-demo.tar.gz [lorenz@devel>>html]$ chmod 777 tmp Open browser and point to http://localhost/phpmapscript-demo If all things running well it should display a map