Changes between Version 3 and Version 4 of PHPMapScriptRH72


Ignore:
Timestamp:
Jan 27, 2009, 8:49:58 AM (15 years ago)
Author:
jmckenna
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • PHPMapScriptRH72

    v3 v4  
    55== Objective ==
    66
    7 Configure a brand new RedHat? 7.2 server to host MapServer-based apps:
    8 
    9   - MapServer 3.6 (WMS)
     7Configure a brand new !RedHat 7.2 server to host !MapServer-based apps:
     8
     9  - !MapServer 3.6 (WMS)
    1010  - PHPMapScript 3.6
    1111  - GMap
     
    1313== Server Information ==
    1414
    15 We start with a clean RedHat? 7.2 install, configured with Apache preinstalled but no PHP.
     15We start with a clean !RedHat 7.2 install, configured with Apache preinstalled but no PHP.
    1616
    1717Source packages will be compiled under "/home/src" and installed in /usr/local
    1818
    1919Web Server installed under /var/www:
    20 
    21  DocRoot? = /var/www/html
     20{{{
     21 DocRoot = /var/www/html
    2222 CGI dir = /var/www/cgi-bin
    2323 Config  = /etc/httpd/conf
    24 
     24}}}
    2525MapServer apps will be installed under /home/msapps using a logical link from /var/www/html/ -> /home/msapps/
    2626
     
    7575
    7676... w3c-libwww version 5.3.2 with the latest fixes can be obtained only via CVS, but for this install, I've tared the copy that was previously downloaded and built on another server... it's simpler this way ;) (http://www2.dmsolutions.ca/mapserver/dl/misc/libwww-5.3.2-20011211.tar.gz)
    77 
     77{{{
    7878  $ tar xzvf ~/arch/libwww-5.3.2-20011211.tar.gz 
    7979  $ cd libwww
     
    8383  $ cd ..
    8484  $ sudo /sbin/ldconfig
    85 
     85}}}
    8686== COMPILE/INSTALL GD-1.8.4 (with GIF and TTF) ==
    8787
    8888RH7.2 comes with a copy of gd-1.8.4 (without GIF) preinstalled. Since we want gd-1.8.4 with GIF (http://www.rime.com.au/gd/), we have to uninstall gd-devel-1.8.4-4.rpm and then install our new copy of gd under /usr/local/lib. This won't affect or break existing applications because removing the RPM only removes /usr/lib/libgd.so (logical link) and /usr/lib/libgd.a and the associated headers, but the physical file (libgd.so.1.8.4) will remain there for applications that came preinstalled on the RH system.
    89 
     89{{{
    9090  $ sudo rpm -e gd-devel-1.8.4-4
    9191
    9292  $ tar xzvf ~/arch/gd-1.8.4gif.tar.gz 
    9393  $ cd gd-1.8.4
    94 
     94}}}
    9595... edit Makefile to compile with Freetype1... MapServer seems to have problem loading fonts when using gd compiled with Freetype2 on RH7.x
    96 
     96{{{
    9797  CFLAGS=-O -DHAVE_LIBXPM -DHAVE_LIBPNG -DHAVE_LIBJPEG -DHAVE_LIBTTF
    9898  LIBS=-lgd -lpng -lz -ljpeg -lm -lttf
     
    102102  $ sudo make install
    103103  $ cd ..
    104 
     104}}}
    105105== COMPILE/INSTALL PHP 4 ==
    106106
    107107Note: We want PHP to use our custom GD compiled with Freetype 1.3, but PHP won't detect freetype by default. PHP looks for freetype1 headers under /usr/include/freetype and $with_ttf/include/freetype, but RH7.2 has them under /usr/include/freetype1/freetype ... this has been filed as bug 17130 in the PHP bugs database. Until this is fixed, for PHP to detect the freetype1 headers, we have to create a logical link in /usr/include:
    108 
     108{{{
    109109  $ cd /usr/include
    110110  $ sudo ln -s freetype1/freetype freetype
     
    123123  $ sudo cp php.ini-dist /etc/httpd/conf/php.ini
    124124  $ cd ..
    125 
     125}}}
    126126... edit /etc/httpd/conf/php.ini to set:
    127 
     127{{{
    128128  ...
    129129  log_errors = On
     
    131131  extension_dir = /usr/local/lib/php/extensions/
    132132  ...
    133 
     133}}}
    134134... edit /etc/httpd/conf/httpd.conf
    135 
     135{{{
    136136    #
    137137    # And for PHP 4.x, use:
     
    154154 AddType application/x-httpd-php4 .php4 .php3 .phtml .php
    155155 Action  application/x-httpd-php4 /cgi-bin/php
    156 
     156}}}
    157157Then restart the server using
    158 
     158{{{
    159159  $ sudo /etc/rc.d/init.d/httpd restart
    160 
     160}}}
    161161== COMPILE/INSTALL MAPSERVER ==
    162 
     162{{{
    163163  $ tar xzvf ~/arch/mapserver-3.6.3.tar.gz
    164164  $ cd mapserver-3.6.3
     
    169169  $ cp mapserv /var/www/cgi-bin/mapserv_36
    170170  $ sudo cp mapscript/php3/php_mapscript.so /usr/local/lib/php/extensions/php_mapscript_36.so
    171 
     171}}}
    172172== Setup MapServer IMAGEDIR and cleanup script ==
    173 
     173{{{
    174174  $ sudo mkdir /tmp/ms_tmp
    175175  $ sudo chmod 777 /tmp/ms_tmp
    176 
     176}}}
    177177... also add the commands above to /etc/rc.d/rc.local as well to recreate the directory when the system reboots, after a /tmp cleanup...
    178178
    179179... create a logical link for the ms_tmp directory on the web server
    180 
     180{{{
    181181  $ cd /var/www/html
    182182  $ ln -s /tmp/ms_tmp ms_tmp
    183 
     183}}}
    184184... create "/etc/cron.daily/ms_clear_tmp.sh" ... you can also place the file in /etc/cron.hourly/ for busier sites...
    185 
     185{{{
    186186 #! /bin/sh
    187187 #
     
    192192 find /tmp/ms_tmp -name "*.*" -amin +360 -exec rm -f {} \;
    193193 exit 0
    194 
     194}}}
    195195== SETUP GMAP DEMO ==
    196196
    197197Install a copy of the latest GMap demo to test our installation:
    198 
     198{{{
    199199 $ cd /home/msapps
    200200 $ tar xzvf ~/arch/gmap-ms36.tar.gz
    201 
     201}}}
    202202... create a link from the htdocs directory to the application's htdoc:
    203 
     203{{{
    204204 $ cd /var/www/html/
    205205 $ ln -s /home/msapps/gmap/htdocs gmap
    206 
     206}}}
    207207You should now be able to run GMap at
    208208