Changes between Version 3 and Version 4 of PHPMapScriptRH72
- Timestamp:
- Jan 27, 2009, 8:49:58 AM (15 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
PHPMapScriptRH72
v3 v4 5 5 == Objective == 6 6 7 Configure a brand new RedHat? 7.2 server to hostMapServer-based apps:8 9 - MapServer 3.6 (WMS)7 Configure a brand new !RedHat 7.2 server to host !MapServer-based apps: 8 9 - !MapServer 3.6 (WMS) 10 10 - PHPMapScript 3.6 11 11 - GMap … … 13 13 == Server Information == 14 14 15 We start with a clean RedHat?7.2 install, configured with Apache preinstalled but no PHP.15 We start with a clean !RedHat 7.2 install, configured with Apache preinstalled but no PHP. 16 16 17 17 Source packages will be compiled under "/home/src" and installed in /usr/local 18 18 19 19 Web Server installed under /var/www: 20 21 DocRoot ?= /var/www/html20 {{{ 21 DocRoot = /var/www/html 22 22 CGI dir = /var/www/cgi-bin 23 23 Config = /etc/httpd/conf 24 24 }}} 25 25 MapServer apps will be installed under /home/msapps using a logical link from /var/www/html/ -> /home/msapps/ 26 26 … … 75 75 76 76 ... 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 {{{ 78 78 $ tar xzvf ~/arch/libwww-5.3.2-20011211.tar.gz 79 79 $ cd libwww … … 83 83 $ cd .. 84 84 $ sudo /sbin/ldconfig 85 85 }}} 86 86 == COMPILE/INSTALL GD-1.8.4 (with GIF and TTF) == 87 87 88 88 RH7.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 {{{ 90 90 $ sudo rpm -e gd-devel-1.8.4-4 91 91 92 92 $ tar xzvf ~/arch/gd-1.8.4gif.tar.gz 93 93 $ cd gd-1.8.4 94 94 }}} 95 95 ... edit Makefile to compile with Freetype1... MapServer seems to have problem loading fonts when using gd compiled with Freetype2 on RH7.x 96 96 {{{ 97 97 CFLAGS=-O -DHAVE_LIBXPM -DHAVE_LIBPNG -DHAVE_LIBJPEG -DHAVE_LIBTTF 98 98 LIBS=-lgd -lpng -lz -ljpeg -lm -lttf … … 102 102 $ sudo make install 103 103 $ cd .. 104 104 }}} 105 105 == COMPILE/INSTALL PHP 4 == 106 106 107 107 Note: 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 {{{ 109 109 $ cd /usr/include 110 110 $ sudo ln -s freetype1/freetype freetype … … 123 123 $ sudo cp php.ini-dist /etc/httpd/conf/php.ini 124 124 $ cd .. 125 125 }}} 126 126 ... edit /etc/httpd/conf/php.ini to set: 127 127 {{{ 128 128 ... 129 129 log_errors = On … … 131 131 extension_dir = /usr/local/lib/php/extensions/ 132 132 ... 133 133 }}} 134 134 ... edit /etc/httpd/conf/httpd.conf 135 135 {{{ 136 136 # 137 137 # And for PHP 4.x, use: … … 154 154 AddType application/x-httpd-php4 .php4 .php3 .phtml .php 155 155 Action application/x-httpd-php4 /cgi-bin/php 156 156 }}} 157 157 Then restart the server using 158 158 {{{ 159 159 $ sudo /etc/rc.d/init.d/httpd restart 160 160 }}} 161 161 == COMPILE/INSTALL MAPSERVER == 162 162 {{{ 163 163 $ tar xzvf ~/arch/mapserver-3.6.3.tar.gz 164 164 $ cd mapserver-3.6.3 … … 169 169 $ cp mapserv /var/www/cgi-bin/mapserv_36 170 170 $ sudo cp mapscript/php3/php_mapscript.so /usr/local/lib/php/extensions/php_mapscript_36.so 171 171 }}} 172 172 == Setup MapServer IMAGEDIR and cleanup script == 173 173 {{{ 174 174 $ sudo mkdir /tmp/ms_tmp 175 175 $ sudo chmod 777 /tmp/ms_tmp 176 176 }}} 177 177 ... 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... 178 178 179 179 ... create a logical link for the ms_tmp directory on the web server 180 180 {{{ 181 181 $ cd /var/www/html 182 182 $ ln -s /tmp/ms_tmp ms_tmp 183 183 }}} 184 184 ... create "/etc/cron.daily/ms_clear_tmp.sh" ... you can also place the file in /etc/cron.hourly/ for busier sites... 185 185 {{{ 186 186 #! /bin/sh 187 187 # … … 192 192 find /tmp/ms_tmp -name "*.*" -amin +360 -exec rm -f {} \; 193 193 exit 0 194 194 }}} 195 195 == SETUP GMAP DEMO == 196 196 197 197 Install a copy of the latest GMap demo to test our installation: 198 198 {{{ 199 199 $ cd /home/msapps 200 200 $ tar xzvf ~/arch/gmap-ms36.tar.gz 201 201 }}} 202 202 ... create a link from the htdocs directory to the application's htdoc: 203 203 {{{ 204 204 $ cd /var/www/html/ 205 205 $ ln -s /home/msapps/gmap/htdocs gmap 206 206 }}} 207 207 You should now be able to run GMap at 208 208