Install MapServer

Mapserver dapat dijalankan pada banyak platform Sistem Operasi. Ada beberapa Sistem Operasi dan prosesor yang dapat menjalankan Mapserver dengan baik. Beberapa Sistem Operasi tersebut adalah :

  • RedHat/SuSe/Debian/Mandrake Linux, versi 6 sampai 9

  • Solaris

  • Mac OS X

  • Vmware yang dijalankan di Windows dan Linux seperti Virtual Box

  • FreeBSD

  • SCO Open Server

  • SGI IRIX

  • Windows 2000, XP, 98, 95

Kecepatan prosesor minimal 120 MHz dengan memori paling tidak 64 MB.

Mandapatkan File Binary MapServer

Windows

MapServer menyediakan Paket file Binary untuk digunakan pada Sistem Operasi keluaran Microsoft. Paket file tersebut disimpan dalam bentuk kompres file dan dapat didownload pada websites MapServer (http://mapserver.gis.umn.edu/win32binaries.html) atau di MapTools.org di link berikut http://dl.maptools.org/dl.

Khusus MapTools.org ini memberikan paket yang mudah untuk digunakan dan sangat dianjurkan bagi yang baru ingin memulai MapServer menggunakan Windows. Paket di sini disebut dengan MapServer For Windows (MS4W) dapat didownload lokasi ini http://maptools.org/ms4w/ . MS4W ini dikembangkan oleh DM Solutions Group di Ottawa Canada. Sebuah perusahaan yang melibatkan diri dalam mengembangan, implementasi, dan support teknologi MapServer. Paket MS4W merupakan file ZIP yang sangat mudah digunakan karena satu paket dengan Apache Web Server. Tidak perlu banyak konfigurasi untuk menginstallnya cukup ekstrak file ZIP tersebut di hardisk misalnya C:\. Secara otomatis akan dibuat subfolder C:\MS4W\. Untuk memulai aplikasi webserver klik file exe Apache dari C:\ms4w\apache\bin\apache.exe. Buka browser masuk ke http://localhost kita akan disambut dengan halaman selamat datang ke MS4W. Artinya bahwa apache sudah aktif dan dan berjalan dengan baik. Komponen-komponen yang ada pada MS4W (MapServer For Windows) adalah :

Komponen

Gambaran

Apache

Web Server

PHP

Script

mapserv.exe

MapServer CGI program

php-mapscript.dll

PHP/ MapScript libraries

proj.exelcs2cs.exe

Utiliti dan libraries PROJ.4 proyeksi

shp2img.exelshptree.exelscalebar.exe

Utiliti MapServer command line

ogr2ogr.exelogrinfo.exeloggrtindex.exe

Utiliti OGR command line

Linux binary

Projectnya dikenal dengan Free Open Source Software GIS Suite (FGS) yang dapat dilihat di http://maptools.org/fgs/. Project ini memberikan paket-paket yang dibutuhkan seperti file binaries, libraries, dan file-file lain yang mendukung applikasi FGS. Applikasi-apliksi tersebut didesain untuk dapat bekerja dalam lingkungan Apache, PHP, dan MapServer. Ada sekitar empat Distro Linux yang memasukan MapServer sebagai applikasinya yakni :

DebianGIS

Applikasi GIS dengan support MapServer yang dikembangkan berdasarkan Distro dengan basis Debian dapat dilihat pada http://pkg-grass.alioth.debian.org/cgi-bin/wiki.pl

HostGIS

Applikasi ini memasukan MapServer, PostGIS, PHP, Phyton, Perl, dan beberapa standard Applikasi GNU/Linux. Applikasi ini bebasis distro Slackware Linux dapat dilihat di http://hostgis.com/linux.html

STARCD

Applikasi GIS berbasis pada distro Mandrake Linux yang mempaketkan MapServer, QGIS, dan applikasi GIS lainnya seperti GRASS GIS. Dapat dilihat di http://rslultra.star.ait.ac.th/~yann/starcd/.

GIS-Knoppix

Applikasi GIS yang berbasis pada distro Knoppix Linux. Dapat dilihat pada http://www.sourcepole.com/sources/software/gis-knoppix/.

Versi Linux RPM

File dalam bentuk RedHat Package Manager dapat diperoleh pada bebersa websites. Berikut adalah beberapa diantaranya :

LinGIS

LinGIS adalah paket RPM yang di khususkan untuk Suse. Dapat dilihat di http://lingis.org

Mapping Hack untuk Fedora

Merupakan file RPM yang dikhususkan untuk distro Fedora dapat dilihat di http://mappinghacks.com/rpm/.

Versi Debian Linux

Untuk paket MapServer versi file debian (.deb) dapat di lihat repository nya di http://agrogeomatic.educagri.fr/debian/.

Mac OS X

Instalasi paket MapServer untuk Mac OS X dapat dilihat di http://www.serverlogistics.com/mapserver.php. Informasi lebih lanjut juga dapat di lihat di link berikut http://webpages.charter.net/kyngchaos/macosx/mapservinstall.html.

Meng-Compile Source Code MapServer

Sebagai software opensource MapServer memungkinkan bagi kita untuk melakukan modifikasi source code sesuai dengan keinginan kita dan baru kemudian melakukan compile sendiri. Tapi jika ‘sulit’ melakukan modifikasi sendiri kita bisa saja langsung meng compile filenya dari source code. Berikut ini akan dicontohkan melakukan compile MapServer menggunakan Linux. Tools dan perintah dijalankan pada command line atau shell consule. Untuk beberapa Sistem Operasi lain tergantung dari tools yang digunakan pada Sistem Operasi tersebut. Disini diasumsikan dengan menggunakan compiler C seperti GCC dan tools configurasi seperti autoconf dan automake.

Download

Surce code yang dapat di download pada MapServer websites adalah di link http://mapserver.gis.umn.edu/dload.html. Setelah paket tersebut selesai di download maka ekstrak atau unzip isi file tersebut disini menggunakan perintah tar :

# tar -xzvf mapserver-4.4.0.tar.gz

File yang di Unzip akan membuat struktur subfolder yang berisi semua kode. Masuk kedirektori tersebut dan lakukan konfigurasi.

Konfigurasi Source

Dibutuhkan konfigurasi untuk mengkompile program MapServer. Diperlukan tahap persiapan untuk melakukan kompilasi source code. Disini kita menggunakan program configure tanpa menyebutkan beberapa pilihan dan menggunakan setting default. Jalankan perintah configure seperti pada contoh dibawah ini :

# ./configure

loading cache ./config.cache

checking for gcc… (cached) gcc

checking whether the C compiler (gcc ) works… yes

checking whether the C compiler (gcc ) is a cross-compiler… no

checking whether we are using GNU C… (cached) yes

checking whether gcc accepts -g… (cached) yes

checking for c++… (cached) c++

checking whether the C++ compiler (c++ ) works… yes

checking whether the C++ compiler (c++ ) is a cross-compiler… no

….

checking where PNG is installed…

checking for png_init_io in -lpng… no

PNG (libpng) library cannot be found, possibly needed for GD

checking where libXpm is installed…

checking for XpmFreeXpmImage in -lXpm… no

XPM (libXpm) library cannot be found, possibly needed for GD

checking where libiconv is installed…

checking for libiconv_open in -liconv… no

libiconv library cannot be found, possibly needed for GD

checking for GD 2.0.12 or higher…

checking for gdImageSetAntiAliased in -lgd… yes

using libgd 2.0.12 (or higher) from system libs

(-L/usr/lib -lgd -ljpeg -lfreetype -lz ).

….

checking whether we should include PROJ.4 support…

PROJ.4 support not requested.

checking whether we should include thread safe support…

thread safe support disabled.

checking whether we should include ESRI SDE support…

ESRI SDE support not requested.

checking whether we should compile in MPATROL support…

MPATROL support not requested.

checking whether we should include OGR support…

OGR support not requested.

checking if GDAL support requested… no

checking if PostGIS support requested… no

checking if MyGIS support requested… no

checking if OracleSpatial support requested… no

checking if MING/Flash support requested… no

checking whether we should include WMS Server support…

OGC WMS Compatibility not enabled (PROJ.4 is required for WMS).

checking whether we should include WFS Server support…

OGC WFS Server support not requested.

checking whether we shou install/erase scriptlets from package(s)

ld include WMS Client Connections support…

OGC WMS Client Connections not enabled (PROJ.4 and libcurl required).

checking whether we should include WFS Client Connections support…

OGC WFS Client Connections not enabled (PROJ.4, libcurl and OGR required).

….

updating cache ./config.cache

creating ./config.status

creating Makefile

Melakukan Kompilasi

Setelah proses konfigurasi selesai maka kita dapat memulai melakukan kompilasi program. Untuk melakukan kompilasi gunakna perintah make. Setelah menjalankan make kita akn melihat beberapa informasi pada layer. Setelah proses kompilasi selesai dan tidak ditemukan adanya pesan kesalahan maka kita akan kembali ke command prompt. Berikut ini adalah contoh mencompile dengan proses make.

# make

gcc -c -O2 -Wall -DIGNORE_MISSING_DATA -DUSE_TIFF -DUSE_JPEG -DUSE_GD_PNG

-DUSE_GD_JPEG -DUSE_GD_WBMP -DUSE_GD_FT -I/usr/include maptemplate.c -o maptemplate.o

gcc -c -O2 -Wall -DIGNORE_MISSING_DATA -DUSE_TIFF -DUSE_JPEG -DUSE_GD_PNG

-DUSE_GD_JPEG -DUSE_GD_WBMP -DUSE_GD_FT -I/usr/include mapbits.c -o mapbits.o

[ *………80+ lines removed………..* ]

gcc -O2 -Wall -DIGNORE_MISSING_DATA -DUSE_TIFF -DUSE_JPEG -DUSE_GD_PNG

-DUSE_GD_JPEG -DUSE_GD_WBMP -DUSE_GD_FT -I/usr/include sortshp.o

-L. -lmap -lgd -L/usr/lib -lgd -ljpeg -lfreetype -lz -ltiff -ljpeg

-lfreetype -lz -ljpeg -lm -lstdc++ -o sortshp

touch mapscriptvars

pwd > mapscriptvars

echo -DIGNORE_MISSING_DATA -DUSE_TIFF -DUSE_JPEG -DUSE_GD_PNG

-DUSE_GD_JPEG -DUSE_GD_WBMP -DUSE_GD_FT >> mapscriptvars

echo -I. -I/usr/include >> mapscriptvars

echo -L. -lmap -lgd -L/usr/lib -lgd -ljpeg -lfreetype -lz -ltiff -ljpeg

-lfreetype -lz -ljpeg -lm -lstdc++ >> mapscriptvars

echo >> mapscriptvars

gcc -c -O2 -Wall -DIGNORE_MISSING_DATA -DUSE_TIFF -DUSE_JPEG -DUSE_GD_PNG

-DUSE_GD_JPEG -DUSE_GD_WBMP -DUSE_GD_FT -I/usr/include tile4ms.c -o tile4ms.o

gcc -O2 -Wall -DIGNORE_MISSING_DATA -DUSE_TIFF -DUSE_JPEG -DUSE_GD_PNG

-DUSE_GD_JPEG -DUSE_GD_WBMP -DUSE_GD_FT -I/usr/include tile4ms.o

-L. -lmap -lgd -L/usr/lib -lgd -ljpeg -lfreetype -lz -ltiff -ljpeg

-lfreetype -lz -ljpeg -lm -lstdc++ -o tile4ms

#

Setelah kompilasi selesai maka lakukan instalasi dengan menggunakan perintah make install seperti pada contoh dibawah ini :

# make install

***** MapServer Installation *****

To install MapServer, copy the ‘mapserv’ file to your web server’s cgi-bin

directory.

If you use MapScript then see the documentation for your specific MapScript

version for installation instructions.

Perintah make akan menghasilkan file mapserv executable. Kita dapat mencoba file mapserv executable dengan menambahkan parameter –v seperti pada contoh dibawah ini :

# ./mapserv -v

MapServer version 4.4.0 OUTPUT=PNG OUTPUT=JPEG OUTPUT=WBMP

SUPPORTS=FREETYPE INPUT=TIFF INPUT=JPEG INPUT=SHAPEFILE

Contoh diatas menunjukan beberapa format input dan output data yang dipilih saat melakukan instalasi. Kita dapat menjalankan mapserv dengan mengetikan perintah ./mapserv tanpa memberikan parameter –v seperti pada contoh berikut :

# ./mapserv

This script can only be used to decode form results and

should be initiated as a CGI process via a httpd server

atau menjalankan program mapserv melalui browser dengan mengetikan perintah berikut :

http://localhost/cgi-bin/mapserv

akan muncul tampilan seperti berikut pada browser :

Tampilan seperti diatas menunjukan bahwa mapserv telah berhasil di install dan berjalan dengan baik.

One thought on “Install MapServer

Leave a comment