Skip to content

Instantly share code, notes, and snippets.

@AsgerPetersen
Last active January 2, 2016 19:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AsgerPetersen/8351812 to your computer and use it in GitHub Desktop.
Save AsgerPetersen/8351812 to your computer and use it in GitHub Desktop.
MapCache installation på Ubuntu
# Se https://code.google.com/p/ala-citizenscience/wiki/MapServerAndMapCacheSetup
# Se http://mapserver.org/trunk/mapcache/install.html#linux-instructions
# Se https://github.com/mapserver/mapcache/blob/master/INSTALL
# ubuntugis er ikke nødvendig, hvis kun mapcache skal installeres
# sudo add-apt-repository ppa:ubuntugis/ubuntugis-unstable
sudo apt-get update
# ----------------------------------------------------------------------
# Apache
# ----------------------------------------------------------------------
sudo apt-get install apache2
# Find ud af hvilken MPM er installeret for at kunne installere rette dev-pakke
/usr/sbin/apache2 -V
# I 13.04 finder man:
# ...
# Server MPM: Worker
# ...
# altså "worker" (= IKKE "prefork")
# Hvis "worker"
sudo apt-get install apache2-threaded-dev
# Hvis prefork
# sudo apt-get install apache2-prefork-dev
# ----------------------------------------------------------------------
# MapCache deps
# ----------------------------------------------------------------------
# required
sudo apt-get install libpng12-dev libjpeg62-dev libcurl4-gnutls-dev
# Not required, but recommended
sudo apt-get install libpixman-1-dev
# sudo apt-get install libpcre3-dev # Slower. you don't need this if you aren't planning on using WMS
dimension support with regex validation, or if your validation needs are covered by posix REs
# Required for seeding geografical areas
# sudo apt-get install libgdal1-dev libgeos-dev
# Required for sqlite backends
sudo apt-get install libsqlite3-dev
# ----------------------------------------------------------------------
# Build tools
# ----------------------------------------------------------------------
sudo apt-get install cmake build-essential
# ----------------------------------------------------------------------
# Build & install
# ----------------------------------------------------------------------
mkdir ~/mapcache
cd ~/mapcache
wget -O - "https://github.com/mapserver/mapcache/archive/rel-1-2-1.tar.gz" | tar -xvzf -
cd mapcache-rel-1-2-1
# Now follow mapcache instal instructions
mkdir build
cd build
cmake -DWITH_OGR=0 -DWITH_GEOS=0 -DWITH_FCGI=0 ..
make
sudo make install-module # Only install apache module (not cgi, fcgi etc)
sudo ldconfig
# ----------------------------------------------------------------------
# Activate
# ----------------------------------------------------------------------
sudo sh -c 'echo LoadModule mapcache_module /usr/lib/apache2/modules/mod_mapcache.so > /etc/apache2/mods-available/mapcache.load'
sudo cp /etc/apache2/mods-available/mapcache.load /etc/apache2/mods-enabled/mapcache.load
# ----------------------------------------------------------------------
# Demo in /mapcache
# ----------------------------------------------------------------------
sudo -p mkdir /mapcache/config
sudo chmod -R 777 /mapcache
# Copy demo service config
cp ~/mapcache/mapcache-rel-1-2-1/mapcache.xml /mapcache/config
sudo nano /etc/apache2/sites-enabled/mapcache-demo
#<IfModule mapcache_module>
# <Directory /mapcache/config>
# Order Allow,Deny
# Allow from all
# </Directory>
# MapCacheAlias /mapcache "/mapcache/config/mapcache.xml"
#</IfModule>
sudo apachectl restart
# Nu er demo klar på http://myserver/mapcache/demo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment