WebFaction
Community site: login faq

I'm a bit of a newbie but I'm trying to install an open-source web map service such as geoserver or mapserver. The easiest way it seems would be to use yum or rpm but can't do that because of lack of root access. I understand that means that I have to compile from source. However I am having great difficulty in doing that and would really appreciate some help!

MapServer has "instructions" how to do so but there are so many dependencies that I keep getting stuck. Here's there instructions: http://mapserver.org/installation/unix.html I'm also confused about cmake. I installed cmake but don't know how to use it make the installation easier.

GeoServer seems to want you to compile with Maven but I can't figure out how to install Maven and use it to compile GeoServer. http://docs.geoserver.org/latest/en/developer/maven-guide/index.html

GeoServer and MapServer install so easily on Windows and I like them fine as an alternative to ArcGIS for Server. They just don't do me any good if I can't get them to work with webfaction. Thanks in advance!

asked 20 Nov '13, 15:16

dbradmit
111
accept rate: 0%

The best place to start would be looking at our guide for installing from source: http://docs.webfaction.com/software/home-install.html#installing-software-from-source

If you encounter issues at any point in that process then you can either post about it here, or feel free to log a support ticket from your WebFaction control panel.

(24 Nov '13, 17:18) waynek

I have successfully installed the mapserver WMS service on WebFaction. Like similar custom applications, mapserver must be installed from source. Then it can run on the local webhosting account as a "cgi application". But it's not too difficult.

As you mentioned, the newest version of MapServer 6.4 uses the cmake compiler. I also found the usage of cmake very confusing and poorly documented. So I decided to install an older version: MapServer 6.2.2. I don't think there are any critically important features in 6.4 that are not in 6.2.2.

Here are the commands that I did to make it work:

mkdir src
cd src
wget http://download.osgeo.org/mapserver/mapserver-6.2.2.tar.gz
tar -xf mapserver-6.2.2.tar.gz
cd mapserver-6.2.2
./configure --prefix=$HOME --with-gif=no --with-fastcgi=no --with-proj --with-gdal --with-ogr --with-postgis=/usr/bin/pg_config --with-wfs
make
make install

After completing the build from source, the $HOME/bin/mapserv executable file is created and mapserver has been installed.

To make the mapserver WMS service running:

  1. I create a new domain, website and a web app called mapserver_app with type "PHP/CGI application"
  2. I copy the executable to my web app's directory (cp $HOME/bin/mapserv $HOME/webapps/mapserver_app/mapserver.cgi)
  3. I create the mapserver.map configuration file and store it in a safe location. Here is an example .map file (You must change the url's and the database configuration according to your own settings)
MAP
  SIZE 600 300
  TRANSPARENT ON
  EXTENT 2820000 8600000 2880000 8650000

IMAGECOLOR 255 255 255
  IMAGEQUALITY 95
  IMAGETYPE agg

OUTPUTFORMAT
    NAME agg
    DRIVER AGG/PNG
    IMAGEMODE RGB
  END
  # Legend
  LEGEND
      IMAGECOLOR 255 255 255
    STATUS ON
    KEYSIZE 18 12
    LABEL
      TYPE BITMAP
      SIZE MEDIUM
      COLOR 0 0 89
    END
  END

WEB
    IMAGEPATH "/home/keskari/tmp/"
    IMAGEURL "http://kala.hydrodata.org/tmp/"
    METADATA
      "wms_title"     "My WMS Server"  ##required
      "wms_onlineresource" "http://kala.hydrodata.org/mapserver.cgi?"   ##required
      "wms_srs"       "EPSG:3857"  ##recommended
      "wms_enable_request" "*"   ##necessary
      "wms_feature_info_mime_type" "text/html"
    END
  END # Web

PROJECTION
    "init=epsg:3857"   ##required
  END

LAYER
    NAME "water_bodies"
    DUMP TRUE
    TEMPLATE "default.html"
    EXTENT 2840736.19 8603831.18 2877892.85 8637116.92
    METADATA
      "wms_title" "water_bodies"
      "wms_include_items" "all"
      "gml_include_items" "all"
      "gml_geometries" "geom"
      "gml_geom_type" "polygon"
    END
    CONNECTIONTYPE postgis
        CONNECTION "host=localhost dbname=KALA user=KALA_admin password=****** port=5432"
        DATA "the_geom3857 FROM water_bodies"
    TYPE POLYGON
    STATUS ON
    CLASS
      STYLE
        COLOR 0 0 255
        OUTLINECOLOR 0 0 0
        SYMBOL 0
      END
    END
  END
END

Finally, it is necessary to tell the mapserver.cgi executable which .map file to use. On a typical Apache Linux server, this is done by a SetEnv MS_MAPFILE=mapserver.map directive in the httpd.conf file but on WebFaction you can't edit httpd.conf but you can do the following workaround: First, I create an executable script called wrapper.cgi with the following content:

    #!/bin/sh
    export MS_MAPFILE=/home/keskari/config/mapserver.map
exec /home/keskari/webapps/kala_app$SCRIPT_URL

Then I create a file called .htaccess in my mapserver_app with the following content:

    RewriteEngine On
    RewriteCond %{SCRIPT_FILENAME} !wrapper.cgi
    RewriteRule ^.*.cgi /wrapper.cgi

Now my WMS hosted on WebFaction is running:

http://kala.hydrodata.org/mapserver.cgi?service=WMS&request=GetCapabilities

The following documents helped me to successfully install the MapServer WMS:

  1. http://docs.webfaction.com/software/home-install.html
  2. http://mapserver.org/installation/unix.html (you can ignore the "cmake" warning if you install 6.2.2)
  3. http://mapserver.org/ogc/wms_server.html (detailed info how to make the wms including the GetFeatureInfo request working properly on mapserver)

I hope my experience can help somebody who is stuck with installing mapserver on WebFaction.

permanent link

answered 28 Jan '14, 22:23

jirik
121812
accept rate: 66%

Thanks for sharing!

(28 Jan '14, 22:26) seanf

When I try the ./configure command I get an error saying: ./confugure no such directory exists... please help

-Shawn

permanent link

answered 23 Aug '14, 21:06

w7071016
111
accept rate: 0%

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×4
×4
×3
×2

question asked: 20 Nov '13, 15:16

question was seen: 3,761 times

last updated: 23 Aug '14, 21:06

WEBFACTION
REACH US
SUPPORT
AFFILIATE PROGRAM
LEGAL
© COPYRIGHT 2003-2020 SWARMA LIMITED - WEBFACTION IS A SERVICE OF SWARMA LIMITED
REGISTERED IN ENGLAND AND WALES 5729350 - VAT REGISTRATION NUMBER 877397162
5TH FLOOR, THE OLD VINYL FACTORY, HAYES, UB3 1HA, UNITED KINGDOM