Installing MapServer on Ubuntu
2014-02-25 09:35
453 查看
Posted: January 10, 2008
Categories: GIS, devs, MapServer, Ubuntu, Apache, Uncategorized
Feedback: 4
Comments
With this post I will show hot to install MapServer 4.10.3 in Ubuntu 7.10 (but this procedure should work
also for previous Ubuntu versions) from repositories.
1) set Ubuntu sources needed for this software
Add universe ( http://archive. href="http://www.ubuntu.com/" target=_blank>Ubuntu.com/gutsy/universe ) and multiverse repositories to your sources (by default are not in Ubuntu)
and uncomment this two lines:
save the sources.list file and then then update your sources:
2) Install MapServer
now download and install MapServer:
MapServer 4.10.3 will be installed (latest of MapServer 4.x serie, the actual MapServer is at 5.0.0), as indicated by typing:
This is where packages have been installed:
mapserv is installed from cgi-MapServer package in /usr/lib/cgi-bin
command line utilities (like shp2img) are installed by the mapserver-bin package in /usr/bin
some documentations is installed by the mapserver-cod package in /usr/share/doc/mapserver-doc
Test mapserv for cgi by typing (it should work as far you have left the default web site in Apache 2.2): http://localhost/cgi-bin/mapserv
Make sure your MapServer instance is now working before continuing with the other installation steps of this tutorial.
Having this instance correctly working is as much important as to have an updated version of your browser when you go to free poker sites, or when you make a connectivity check to
a freshly installed RDBMS.
3) Download MapServer Demo
Download the MapServer 4.x Demo Application from the MapServer web site: http://maps.dnr.state.mn.us/mapserver_demos/workshop.zip
extract the zip file wherever you like, for example i have extracted it here: /home/corti/public_html/mapserverdemo
4) Configure Apache httpd
Configure an httpd virtual host for MapServer. For example we will create a mapserverdemo virtual host editing the default file
this is how I created this virtual host (you may need to change path according to where you have extracted the demo zip file):
</VirtualHost>
now let's add a mapserverdemo host:
and add this line: 127.0.0.1 mapserverdemo
save the file and restart Apache:
create a tmp directory in your mapserverdemo root, with writing permissions for the Apache user
Now if you go to http://mapserverdemo/workshop/ you will see a form, but after that it will not work as far we need to add the html form settings to our settings. If you go at: http://mapserverdemo/cgi-bin/mapserv you should get this response:
5) Configure the MapServerDemo
Now let's configure the demo with our settings. Edit this section in index.html file (wherever you have extracted the demo), according to your settings:
go to: http://mapserverdemo/workshop/ and the demo should work. Enjoy!
转贴:http://www.paolocorti.net/2008/01/10/installing-mapserver-in-ubuntu/
Categories: GIS, devs, MapServer, Ubuntu, Apache, Uncategorized
Feedback: 4
Comments
With this post I will show hot to install MapServer 4.10.3 in Ubuntu 7.10 (but this procedure should work
also for previous Ubuntu versions) from repositories.
1) set Ubuntu sources needed for this software
Add universe ( http://archive. href="http://www.ubuntu.com/" target=_blank>Ubuntu.com/gutsy/universe ) and multiverse repositories to your sources (by default are not in Ubuntu)
sudo gedit /etc/apt/sources.list
and uncomment this two lines:
deb http://archive.ubuntu.com/ubuntu/ gutsy-security main restricted universe multiverse deb-src http://archive.ubuntu.com/ubuntu/ gutsy-security main restricted universe multiverse
save the sources.list file and then then update your sources:
sudo apt-get update
2) Install MapServer
now download and install MapServer:
sudo apt-get install cgi-mapserver mapserver-bin mapserver-doc php5-mapscript python-mapscript
MapServer 4.10.3 will be installed (latest of MapServer 4.x serie, the actual MapServer is at 5.0.0), as indicated by typing:
/usr/lib/cgi-bin/mapserv -v MapServer version 4.10.3 OUTPUT=GIF OUTPUT=PNG OUTPUT=JPEG OUTPUT=WBMP OUTPUT=SVG SUPPORTS=PROJ SUPPORTS=FREETYPE SUPPORTS=WMS_SERVER SUPPORTS=WMS_CLIENT SUPPORTS=WFS_SERVER SUPPORTS=WFS_CLIENT SUPPORTS=WCS_SERVER SUPPORTS=THREADS SUPPORTS=GEOS INPUT=EPPL7 INPUT=POSTGIS INPUT=OGR INPUT=GDAL INPUT=SHAPEFILE DEBUG=MSDEBUG
This is where packages have been installed:
mapserv is installed from cgi-MapServer package in /usr/lib/cgi-bin
command line utilities (like shp2img) are installed by the mapserver-bin package in /usr/bin
some documentations is installed by the mapserver-cod package in /usr/share/doc/mapserver-doc
Test mapserv for cgi by typing (it should work as far you have left the default web site in Apache 2.2): http://localhost/cgi-bin/mapserv
Make sure your MapServer instance is now working before continuing with the other installation steps of this tutorial.
Having this instance correctly working is as much important as to have an updated version of your browser when you go to free poker sites, or when you make a connectivity check to
a freshly installed RDBMS.
3) Download MapServer Demo
Download the MapServer 4.x Demo Application from the MapServer web site: http://maps.dnr.state.mn.us/mapserver_demos/workshop.zip
extract the zip file wherever you like, for example i have extracted it here: /home/corti/public_html/mapserverdemo
4) Configure Apache httpd
Configure an httpd virtual host for MapServer. For example we will create a mapserverdemo virtual host editing the default file
sudo gedit /etc/apache2/sites-available/default
this is how I created this virtual host (you may need to change path according to where you have extracted the demo zip file):
<VirtualHost *:80> ServerName mapserverdemo DocumentRoot /home/corti/public_html/mapserverdemo <Directory /> Options FollowSymLinks AllowOverride All </Directory>
[code]ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/ <span class="nt"><Directory</span> <span class="err">"/usr/lib/cgi-bin"</span><span class="nt">></span> AllowOverride None Options ExecCGI -MultiViews +SymLinksIfOwnerMatch Order allow,deny Allow from all <span class="nt"></Directory></span> ErrorLog /var/log/apache2/mapserverdemo_error.log. LogLevel warn CustomLog /var/log/apache2/mapserver_access.log combined ServerSignature On
</VirtualHost>
now let's add a mapserverdemo host:
sudo gedit /etc/hosts
and add this line: 127.0.0.1 mapserverdemo
save the file and restart Apache:
sudo /etc/init.d/apache2 restart
create a tmp directory in your mapserverdemo root, with writing permissions for the Apache user
Now if you go to http://mapserverdemo/workshop/ you will see a form, but after that it will not work as far we need to add the html form settings to our settings. If you go at: http://mapserverdemo/cgi-bin/mapserv you should get this response:
No query information to decode. QUERY_STRING is set, but empty.
5) Configure the MapServerDemo
Now let's configure the demo with our settings. Edit this section in index.html file (wherever you have extracted the demo), according to your settings:
<!-- EDIT THE FORM ACTION --> <form name="demo" method="GET" action="/cgi-bin/mapserv" onSubmit="submit_form()"> ....... <!-- EDIT THESE HIDDEN VARIABLES --> <input type="hidden" name="map" value="/home/corti/public_html/mapserverdemo/workshop/itasca.map"> <input type="hidden" name="program" value="/cgi-bin/mapserv"> <input type="hidden" name="root" value="/mapserver_demos/workshop"> <input type="hidden" name="map_web_imagepath" value="/home/corti/public_html/mapserverdemo/tmp/"> <input type="hidden" name="map_web_imageurl" value="/tmp/">
go to: http://mapserverdemo/workshop/ and the demo should work. Enjoy!
转贴:http://www.paolocorti.net/2008/01/10/installing-mapserver-in-ubuntu/
相关文章推荐
- Installing Flash Media Server 3.5 on Ubuntu
- Installing node.js on ubuntu server 15.10
- Installing Django on an Ubuntu Linux Server
- Installing Zend Server Community Edition (CE) on Ubuntu 10.04.3 LTS
- Installing PHP5 on Ubuntu Server
- installing-git-on-a-server-ubuntu-or-debian
- Installing Git on a server (Ubuntu or Debian)
- Compiling Xen-4.4 From Source And Installing It On Ubuntu Server (Amd-64)
- 在AWS平台上的ubuntu系统中安装Geoserver(Installing a headless GeoServer on Ubuntu 10.4 on Amazon Web Services)
- Installing Webmin on Ubuntu Server 10.04 LTS (Lucid)
- Installing Xen On An Ubuntu 8.04 (Hardy Heron) Server From The Ubuntu Repositories
- Installing Robocup 3D simulation server on Ubuntu
- 在 Ubuntu 12.04 Server 上安装部署 Ruby on Rails 应用
- Install MySQL Server 5.1 On Ubuntu 10.04 Lucid Lynx
- SQL Server on Ubuntu
- Cannot install ubuntu or other linux flavours on citrix Xen server
- svn server with dav_svn and ssl on ubuntu
- Installing Oracle Database 10g Express Edition on Ubuntu 9.10 (Karmic Koala) x86_64 (amd64)
- Apache 2 Web Server on Ubuntu 10.10 (Maverick)
- Setting up Telnet server on Ubuntu