debian 安装mapserver
1.apt-get install apache22.apt-get install cgi-mapserver mapserver-bin perl-mapscript
3.查看并测试是否安装成功
1.cd /usr/lib/cgi-bin
2.mapserv -v
出现如下内容:
MapServer version 5.6.5 OUTPUT=GIF OUTPUT=PNG OUTPUT=JPEG OUTPUT=WBMP OUTPUT=SWF OUTPUT=SVG SUPPORTS=PROJ SUPPORTS=AGG SUPPORTS=FREETYPE SUPPORTS=ICONV SUPPORTS=FRIBIDI SUPPORTS=WMS_SERVER SUPPORTS=WMS_CLIENT SUPPORTS=WFS_SERVER SUPPORTS=WFS_CLIENT SUPPORTS=WCS_SERVER SUPPORTS=SOS_SERVER SUPPORTS=FASTCGI SUPPORTS=THREADS SUPPORTS=GEOS SUPPORTS=RGBA_PNG INPUT=EPPL7 INPUT=POSTGIS INPUT=OGR INPUT=GDAL INPUT=SHAPEFILE
表示mapserv安装成功。
4.配置apache
httpd.conf中添加配置如下内容:
<IfModule alias_module>
#
# Redirect: Allows you to tell clients about documents that used to
# exist in your server's namespace, but do not anymore. The client
# will make a new request for the document at its new location.
# Example:
# Redirect permanent /foo http://www.example.com/bar
#
# Alias: Maps web paths into filesystem paths and is used to
# access content that does not live under the DocumentRoot.
# Example:
# Alias /webpath /full/filesystem/path
#
# If you include a trailing / on /webpath then the server will
# require it to be present in the URL. You will also likely
# need to provide a <Directory> section to allow access to
# the filesystem path.
#
# ScriptAlias: This controls which directories contain server scripts.
# ScriptAliases are essentially the same as Aliases, except that
# documents in the target directory are treated as applications and
# run by the server when requested rather than as documents sent to the
# client. The same rules about trailing "/" apply to ScriptAlias
# directives as to Alias.
#
ScriptAlias /cgi-bin/ "/usr/lib/cgi-bin/"
ScriptAlias /fcgi-bin/ "/usr/lib/cgi-bin/"
##
## Alias for MapServer tmp directory
##
</IfModule>
5.重启apache,并测试
1.重启
apachectl restart
2.测试
http://192.168.1.101/cgi-bin/mapserv
出现如下内容:
No query information to decode. QUERY_STRING is set, but empty.
表示配置成功。
6.进一步测试
1.wget http://www.duif.net/postgis/world.map
2.测试得到此图层的capabilities
http://192.168.1.101/cgi-bin/mapserv?map=/usr/lib/cgi-bin/world.map&request=getcapabilities&service=wms
7.安装的默认目录及下载目录:
/usr/share/doc/cgi-mapserver
/usr/share/lintian/overrides/cgi-mapserver
/var/cache/apt/archives/cgi-mapserver_5.6.5-2+squeeze2_amd64.deb
/var/lib/dpkg/info/cgi-mapserver.list
/var/lib/dpkg/info/cgi-mapserver.md5sums
参考网址:
http://trac.osgeo.org/mapserver/wiki/DebianLinux
http://www.duif.net/postgis/