|
| 1 | + |
| 2 | + |
| 3 | += Setting up the WCS test server on GNU/Linux = |
| 4 | + |
| 5 | +**Requires:** Ubuntu / Debian derived distro |
| 6 | + |
| 7 | +These notes are for Ubuntu - other versions and Debian derived distros may |
| 8 | +require slight variations in package names. |
| 9 | + |
| 10 | +== Preparation == |
| 11 | + |
| 12 | +Note the git repo below will change to the default QGIS repo once this work |
| 13 | +is integrated into master. |
| 14 | + |
| 15 | + git remote add blazek git://github.com/blazek/Quantum-GIS.git |
| 16 | + git fetch blazek |
| 17 | + git branch --track wcs2 blazek/wcs2 |
| 18 | + git checkout wcs2 |
| 19 | + cd /var/www/ |
| 20 | + sudo mkdir wcs |
| 21 | + sudo chown timlinux wcs |
| 22 | + cd wcs/ |
| 23 | + mkdir cgi-bin |
| 24 | + cd cgi-bin/ |
| 25 | + |
| 26 | +== Setup mapserver == |
| 27 | + |
| 28 | +```sudo apt-get install cgi-mapserver``` |
| 29 | + |
| 30 | +Set the contents of cgi-bin/wcstest-1.9.0 to: |
| 31 | + |
| 32 | +``` |
| 33 | + #! /bin/sh |
| 34 | + MS_MAPFILE=/var/www/wcs/testdata/qgis-1.9.0/raster/wcs.map |
| 35 | + export MS_MAPFILE |
| 36 | + /usr/lib/cgi-bin/mapserv |
| 37 | +``` |
| 38 | + |
| 39 | +Then do: |
| 40 | + |
| 41 | +``` |
| 42 | + chmod +x cgi-bin/wcstest-1.9.0 |
| 43 | + mkdir -p /var/www/wcs/testdata/qgis-1.9.0/raster/ |
| 44 | + cd /var/www/wcs/testdata/qgis-1.9.0/raster/ |
| 45 | + cp -r /home/timlinux/Quantum-GIS/tests/testdata/raster/* . |
| 46 | +``` |
| 47 | + |
| 48 | +Edit wcs.map and set the shapepath to this: |
| 49 | + |
| 50 | +``` |
| 51 | + SHAPEPATH "/var/www/wcs/testdata/qgis-1.9.0/raster" |
| 52 | +``` |
| 53 | + |
| 54 | +Then create /var/www/wcs/7-wcs.qgis.org.conf setting the contents to this: |
| 55 | + |
| 56 | +``` |
| 57 | + <VirtualHost *:80> |
| 58 | + ServerName wcs.qgis.org |
| 59 | + ServerAdmin tim@linfiniti.com |
| 60 | + |
| 61 | + LogLevel warn |
| 62 | + LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" \"%{forensic-id}n\"" combined |
| 63 | + CustomLog /var/log/apache2/wcs_qgis.org/access.log combined |
| 64 | + ErrorLog /var/log/apache2/wcs_qgis.org/error.log |
| 65 | + |
| 66 | + DocumentRoot /var/www/wcs/html |
| 67 | + |
| 68 | + ScriptAlias /cgi-bin/ /var/www/wcs/cgi-bin/ |
| 69 | + <Directory "/var/www/wcs/cgi-bin"> |
| 70 | + AllowOverride None |
| 71 | + Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch |
| 72 | + Order allow,deny |
| 73 | + Allow from all |
| 74 | + </Directory> |
| 75 | + |
| 76 | + RewriteEngine on |
| 77 | + RewriteRule /1.9.0/wcs /cgi-bin/wcstest-1.9.0 [PT] |
| 78 | + |
| 79 | + </VirtualHost> |
| 80 | +``` |
| 81 | + |
| 82 | +== Create a home page == |
| 83 | + |
| 84 | +``` |
| 85 | + mkdir html |
| 86 | + vim html/index.html |
| 87 | +``` |
| 88 | + |
| 89 | +Set the contents to: |
| 90 | + |
| 91 | +``` |
| 92 | + This is the test platform for QGIS' wcs client. You can use these services |
| 93 | + from QGIS directly (to try out WCS for example) by pointing your QGIS to: |
| 94 | + http://wcs.qgis.org/1.9.0/wcs |
| 95 | +``` |
| 96 | + |
| 97 | + |
| 98 | +== Now deploy it == |
| 99 | + |
| 100 | +``` |
| 101 | + sudo mkdir /var/log/apache2/wcs_qgis.org |
| 102 | + sudo chown www-data /var/log/apache2/wcs_qgis.org |
| 103 | + cd /etc/apache2/sites-available/ |
| 104 | + sudo ln -s /var/www/wcs/7-wcs.qgis.org.conf . |
| 105 | + cd /var/www/wcs/ |
| 106 | + sudo a2ensite 7-wcs.qgis.org.conf |
| 107 | + sudo /etc/init.d/apache2 reload |
| 108 | +``` |
| 109 | + |
| 110 | +== Debugging == |
| 111 | + |
| 112 | +``` |
| 113 | + sudo tail -f /var/log/apache2/wcs_qgis.org/error.log |
| 114 | +``` |
0 commit comments