| 1 | = !RedHat9 and !MapServer40 |
| 2 | |
| 3 | The following are build notes for installing !MapServer 4.0 on a new installation of !RedHat 9. This is a slightly modified version of the [wiki:RedHat9AndMapserver40b] from Erich Schroeder, with the following changes: |
| 4 | |
| 5 | * Added Xerces for WFS client support |
| 6 | * Update to latest package versions |
| 7 | * Use 'sudo' instead of running everything as root |
| 8 | * Install PHP in /usr/local/php433 to allow multiple PHP installations to coexist |
| 9 | * Install MapServer binaries as mapserv_40 and php_mapscript_40.so to allow multiple versions to coexist on the same box |
| 10 | |
| 11 | The first steps of those instructions assume that you installed the port of "apt" for rpm-based distributions, available at http://freshrpms.net/apt/. You can download apt from http://shrike.freshrpms.net/rpm.html?id=650. |
| 12 | |
| 13 | Daniel M, 2003-10-09 |
| 14 | |
| 15 | == Build Notes == |
| 16 | |
| 17 | {{{ |
| 18 | # removed these and dependent rpms |
| 19 | sudo apt-get remove gd |
| 20 | sudo apt-get remove curl |
| 21 | sudo apt-get remove curl-devel |
| 22 | sudo apt-get remove php |
| 23 | |
| 24 | # already have following rpms installed |
| 25 | sudo apt-get install freetype freetype-devel |
| 26 | sudo apt-get install libpng libpng-devel |
| 27 | sudo apt-get install libtiff libtiff-devel zlib zlib-devel |
| 28 | sudo apt-get install libjpeg libjpeg-devel |
| 29 | # |
| 30 | # I'm assuming that you will be providing a non-commercial mapserver |
| 31 | # application, and then can use the PDFlib-Lite under their |
| 32 | # Alladin-type license. If not, you will need to either |
| 33 | # purchase the full PDFlib library or disable |
| 34 | wget http://www.pdflib.com/products/pdflib/download/PDFlib-Lite-5.0.2-Unix-src.tar.gz |
| 35 | tar xzf PDFlib-Lite-5.0.2-Unix-src.tar.gz |
| 36 | cd PDFlib-Lite-5.0.2-Unix-src |
| 37 | make clean |
| 38 | ./configure |
| 39 | make |
| 40 | sudo make install |
| 41 | cd .. |
| 42 | |
| 43 | # download and build ming |
| 44 | wget http://www.opaque.net/ming/ming-0.2a.tgz |
| 45 | tar xzf ming-0.2a.tgz |
| 46 | cd ming-0.2a |
| 47 | make clean |
| 48 | make |
| 49 | make static |
| 50 | sudo make install |
| 51 | |
| 52 | cd .. |
| 53 | |
| 54 | # download and build curl |
| 55 | wget http://curl.haxx.se/download/curl-7.10.7.tar.gz |
| 56 | tar xzf curl-7.10.7.tar.gz |
| 57 | cd curl-7.10.7 |
| 58 | make clean |
| 59 | ./configure |
| 60 | make |
| 61 | sudo make install |
| 62 | |
| 63 | cd .. |
| 64 | |
| 65 | # add /usr/local/lib to /etc/ld.so.conf ... |
| 66 | # and run ldconfig |
| 67 | sudo /sbin/ldconfig |
| 68 | |
| 69 | # download and install gd-2 into /usr/local |
| 70 | rm -f /usr/lib/libgd.* # to remove any potentially conflicts |
| 71 | wget http://www.boutell.com/gd/http/gd-2.0.15.tar.gz |
| 72 | tar xzf gd-2.0.15.tar.gz |
| 73 | cd gd-2.0.15 |
| 74 | make clean |
| 75 | ./configure |
| 76 | make |
| 77 | sudo make install |
| 78 | cd .. |
| 79 | |
| 80 | # download and build proj libraries |
| 81 | wget --passive-ftp ftp://ftp.remotesensing.org/pub/proj/proj-4.4.7.tar.gz |
| 82 | wget --passive-ftp ftp://ftp.remotesensing.org/pub/proj/proj-nad27-1.1.tar.gz |
| 83 | tar xzf proj-4.4.7.tar.gz |
| 84 | cd proj-4.4.7/nad |
| 85 | tar xzf ../../proj-nad27-1.1.tar.gz |
| 86 | cd .. |
| 87 | ./configure |
| 88 | make |
| 89 | sudo make install |
| 90 | |
| 91 | cd .. |
| 92 | |
| 93 | # if you are going to use WMS/WFS then you might want to download and install |
| 94 | # a new epsg file with custom canadian projections and esri projections codes |
| 95 | wget http://www.maptools.org/dl/proj4-epsg-with-42xxx-and-esri.zip |
| 96 | unzip proj4-epsg-with-42xxx-and-esri.zip |
| 97 | sudo mv epsg /usr/local/share/proj/ |
| 98 | |
| 99 | #download and install Xerces 1.6 (for GML support in OGR) |
| 100 | wget http://xml.apache.org/dist/xerces-c/stable/archives/Xerces-C_1_6_0/xerces-c-src1_6_0.tar.gz |
| 101 | tar xzf xerces-c-src1_6_0.tar.gz |
| 102 | cd xerces-c-src1_6_0 |
| 103 | #set SERCESROOT to the xerces source directory |
| 104 | export XERCESCROOT=`pwd` |
| 105 | cd src |
| 106 | # The configure file in the distribution is not executable! |
| 107 | chmod +x ./configure |
| 108 | ./configure |
| 109 | make |
| 110 | sudo make install |
| 111 | |
| 112 | sudo /sbin/ldconfig |
| 113 | |
| 114 | cd ../.. |
| 115 | |
| 116 | |
| 117 | # download and install gdal-1.1.9 |
| 118 | wget --passive-ftp ftp://ftp.remotesensing.org/pub/gdal/gdal-1.1.9.tar.gz |
| 119 | tar xzf gdal-1.1.9.tar.gz |
| 120 | cd gdal-1.1.9 |
| 121 | make clean |
| 122 | ./configure --with-ogr --without-python --with-xerces |
| 123 | make |
| 124 | sudo make install |
| 125 | cd .. |
| 126 | |
| 127 | sudo /sbin/ldconfig |
| 128 | |
| 129 | # download and build php |
| 130 | # |
| 131 | # Note that I install PHP under /usr/local/php433 in order to allow |
| 132 | # multiple versions of PHP to coexist on my server |
| 133 | # |
| 134 | wget http://ca.php.net/get/php-4.3.3.tar.gz/from/ca2.php.net/mirror |
| 135 | tar xzf php-4.3.3.tar.gz |
| 136 | cd php-4.3.3 |
| 137 | make clean |
| 138 | ./configure --enable-shared --with-regex=system --with-jpeg-dir=/usr --with-png-dir=/usr --with-zlib --with-gd=/usr/local --with-freetype-dir=/usr --enable-force-cgi-redirect --enable-dbase --with-pdflib --with-mysql --with-config-file-path=/usr/local/php433/ --prefix=/usr/local/php433 |
| 139 | make |
| 140 | sudo cp sapi/cgi/php /var/www/cgi-bin/php433 |
| 141 | sudo make install |
| 142 | sudo cp php.ini-dist /usr/local/php433/php.ini |
| 143 | |
| 144 | # note: include brackets in the following command to keep your shell in current directory |
| 145 | (cd /usr/local/php433; sudo ln -s lib/php/extensions/no-debug-non-zts-20020429/ extensions) |
| 146 | |
| 147 | # edit your php.ini: |
| 148 | #diff /usr/local/php433/php.ini php.ini-dist |
| 149 | #428c428 |
| 150 | #< extension_dir = "/usr/local/php433/extensions/" |
| 151 | #--- |
| 152 | #> extension_dir = "./" |
| 153 | |
| 154 | cd .. |
| 155 | |
| 156 | |
| 157 | # download and build mapserver |
| 158 | wget http://cvs.gis.umn.edu/dist/mapserver-4.0.tar.gz |
| 159 | tar xzf mapserver-4.0.tar.gz |
| 160 | cd mapServer-4.0 |
| 161 | rm -f config.cache |
| 162 | ./configure --without-tiff --without-eppl --with-threads --with-proj --with-gdal=/usr/local/bin/gdal-config --with-ogr --with-php=../php-4.3.3 --with-gd=/usr/local --with-freetype=/usr/bin --with-pdf --with-ming --with-wmsclient --with-wfs --with-wfsclient |
| 163 | |
| 164 | make clean |
| 165 | make |
| 166 | # DO NOT do a "make install" |
| 167 | |
| 168 | sudo cp mapserv /var/www/cgi-bin/mapserv_40 |
| 169 | sudo cp mapscript/php3/php_mapscript.so /usr/local/php433/extensions/php_mapscript_40.so |
| 170 | |
| 171 | cd .. |
| 172 | |
| 173 | # add to /etc/httpd/conf/httpd.conf |
| 174 | |
| 175 | # |
| 176 | # For PHP scripts as CGI-BIN |
| 177 | # |
| 178 | #AddType application/x-httpd-php-cgi .php .php4 .phtml |
| 179 | #Action application/x-httpd-php-cgi /cgi-bin/php433 |
| 180 | |
| 181 | sudo /sbin/service httpd restart |
| 182 | |
| 183 | # create /var/www/html/ms_info.php |
| 184 | #<?php |
| 185 | #dl("php_mapscript_40.so"); |
| 186 | #phpinfo(); |
| 187 | #?> |
| 188 | |
| 189 | # check the output of http://yourhost/ms_info.php |
| 190 | # for mapserver support |
| 191 | }}} |