SlideShare a Scribd company logo
1 of 6
Download to read 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

More Related Content

What's hot

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
 

What's hot (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...
 

Viewers also liked

Viewers also liked (7)

<img src="../i/r_14.png" />
<img src="../i/r_14.png" /><img src="../i/r_14.png" />
<img src="../i/r_14.png" />
 
JavaScript-Core
JavaScript-CoreJavaScript-Core
JavaScript-Core
 
Tesi_Adamou
Tesi_AdamouTesi_Adamou
Tesi_Adamou
 
controlling_animations
controlling_animationscontrolling_animations
controlling_animations
 
xampp_server
xampp_serverxampp_server
xampp_server
 
LCI2009-Tutorial
LCI2009-TutorialLCI2009-Tutorial
LCI2009-Tutorial
 
Agenda
AgendaAgenda
Agenda
 

Similar to 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
 

Similar to 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
 

More from 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
 

More from 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
 

Recently uploaded

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

Recently uploaded (20)

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
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
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
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
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
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
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
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 

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