
hans@900: \section{Installationguide}
hans@900: 
hans@900: This section describes preconditions for the entire system and an
hans@900: installation on a Debian 5.0.x (Lenny) for the GNV-System without an
hans@900: running X-Environment.
hans@900: 
hans@900: For installing and operating the GNV-system access with {\bf root
hans@900: rights} is needed.  If other permissions are needed, there will be a
hans@900: hint in this manual.
hans@900: 
hans@900: % FIXME: Schreibweise bei Zeilen + und -
hans@900: 
hans@900: \subsection{Preconditions}
hans@900: 
hans@900: \subsubsection{System}
hans@900: 
hans@900: \begin{itemize}
hans@900:   \item Storage for the delivered software: 100 MB
hans@900:   \item Current processor on a 32-bit Architecture (Beginning
hans@900:     2010)\footnote{Running on a 64-bit system should work out of the box
hans@900:     and improve scalibility issues.}
hans@900:   \item RAM: 1 GB for production as minimum.\footnote{This value depends
hans@900:     mainly on the amount of connected users.}
hans@900:   \item Network access to Database Backend
hans@900:   \item RW-Access to the filesystem for logging, shapefile-export,
hans@900:     caching
hans@900: \end{itemize}
hans@900: 
hans@900: \subsubsection{Database: Software and Data}
hans@900: 
hans@900: The software has been developed for the following system:
hans@900: 
hans@900: \begin{itemize}
hans@900:   \item ESRI ArcSDE 9.3.1 on Oracle 10.2\footnote{The development
hans@900:     started in ESRI ArcSDE 9.2. There are known
hans@900:     problems with this version.}
hans@900:   \item ArcMarineBSH, model package "Time Series and Measurements"
hans@900:   \item ArcMarineBSH, model package " MeshFeature"
hans@900:   \item ArcMarineBSH, model package "Marine Feature"
hans@900:   \item ArcS57 -- International Hydrographic Organization (IHO) S-57 for
hans@900:     ENC Data Model. - ESRI Data Models. http://support.esri.com/datamodels
hans@900:   \item CONTIS -- Federal Maritime and Hydrographic Agency (BSH). Continental 
hans@900:     Shelf Information System --
hans@900:     http://www.bsh.de/en/Marine\_uses/Industry/CONTIS\_maps/index.jsp
hans@900:   \item GNV specific schema MapViewer interface -- Schema for integrating with MapViewer and
hans@900:     their WMS services
hans@900:   \item GNV specific schema for managing the cache -- The central
hans@900:     dataware house is updated regulary. To keep the cache up-to-date,
hans@900:     needs to cleaned after database updates.
hans@900: \end{itemize}
hans@900: 
hans@900: 
hans@900: \subsection{Operating System}
hans@900: 
hans@900: {\em Hint}: Configuring of partitions, firewalls, etc. for the system is out of
hans@900: the scope of this project.
hans@900: 
hans@900: \subsection{Java Environment}
hans@900: 
hans@900: \subsubsection*{Installation Sun Java 6}
hans@900: 
hans@900: This GNV-system is developed for Sun Java 6. 
hans@900: 
hans@900: Add non-free packages of the Debian distribution to the system in
hans@900: \verb+/etc/apt/sources.list+:
hans@900: 
hans@900: \begin{lstlisting}
hans@900:   [...]
hans@900:   deb http://ftp.de.debian.org/debian/ lenny main non-free
hans@900:   deb-src http://ftp.de.debian.org/debian/ lenny main
hans@900: 
hans@900:   deb http://security.debian.org/ lenny/updates main
hans@900:   deb-src http://security.debian.org/ lenny/updates main
hans@900:   [...]
hans@900: \end{lstlisting}
hans@900: 
hans@900: 
hans@900: Install Sun Java 6 and its dependencies by executing the following:
hans@900: 
hans@900: \verb+ apt-get install sun-java6-jdk+
hans@900: 
hans@900: 
hans@900: \subsubsection*{Install Native Components for Java6 (optional)}
hans@900: 
hans@900: This step is optional but recommended.
hans@900: 
hans@900: For a better support of the native server technologies, the package
hans@900: \verb+libtcnative+ can be installed.
hans@900: 
hans@900: \verb+ apt-get install libtcnative-1+
hans@900: 
hans@900: % FIXME: Setzen des softlink
hans@900: 
hans@900: \subsubsection*{Configuration}
hans@900: 
hans@900: To ensure that the Apache Tomcat and the GNV Artefact Server will use
hans@900: Sun Java 6 exclusively, switch to the default Java version
hans@900: globally\footnote{This manual assumes that there are no other packages
hans@900: depending to another Java version.}.
hans@900: 
hans@900: Use  \verb+update-alternatives+ mechanism of the Debian system, execute:
hans@900: 
hans@900: \verb+ update-alternatives --list java+
hans@900: 
hans@900: Lists all installed Java-Environments. E.g.:
hans@900:  
hans@900: \begin{lstlisting}
hans@900:   Auswahl      Alternative
hans@900:   -----------------------------------------------
hans@900:             1    /usr/bin/gij-4.3
hans@900:    +        2    /usr/lib/jvm/java-gcj/jre/bin/java
hans@900:             3    /usr/lib/jvm/java-1.5.0-sun/jre/bin/java
hans@900:    *        4    /usr/lib/jvm/java-6-sun/jre/bin/java
hans@900: \end{lstlisting}
hans@900: 
hans@900: 
hans@900: \verb+update-alternatives --config java+
hans@900: 
hans@900: Opens a dialog to reconfigure the java version which should be used as default.
hans@900: Type the Number of the the java which should be used.
hans@900: For the example above, type "4".
hans@900: 
hans@900: \subsubsection*{Test of the Installation}
hans@900: 
hans@900: Execute \verb+ java -version+
hans@900: 
hans@900: Check if a version of 1.6.0* has been set. Check:
hans@900: 
hans@900: \begin{lstlisting}
hans@900:   java version  "1.6.0_12"
hans@900:   Java(TM) SE Runtime Environment (build 1.6.0_12-b04)
hans@900:   Java HotSpot(TM) Server VM (build 11.2-b01, mixed mode)
hans@900: \end{lstlisting}
hans@900: 
hans@900: 
hans@900: \subsubsection*{Uninstalling}
hans@900: 
hans@900: For removing Sun Java from the operating system, use:
hans@900: 
hans@900: \verb+apt-get --purge remove sun-java6-jdk+
hans@900: 
hans@900: 
hans@900: \subsection{Tomcat Application Server}
hans@900: To run the GNV-System a Apache Tomcat Server Version 5.5 is required.
hans@900: This section describes the steps for installing and configuring
hans@900: Apache Tomcat.
hans@900: 
hans@900: \subsubsection*{Installation}
hans@900: 
hans@900: To install the Tomcat Application-Server and its dependencies, execute:
hans@900: 
hans@900: \verb+ apt-get install tomcat5.5+
hans@900: % FIXME: check for depencenies
hans@900: 
hans@900: \subsubsection{Configuration}
hans@900: 
hans@900: Adapt some run-time specific properties in
hans@900: \verb+/etc/default/tomcat5.5+:
hans@900: 
hans@900: \begin{lstlisting}
hans@900:    - #JAVA_OPTS="-Djava.awt.headless=true -Xmx128M"
hans@900:    + JAVA_OPTS="-Djava.awt.headless=true -Xmx1024m -server"
hans@900: 
hans@900:    - #TOMCAT5_SECURITY=yes
hans@900:    + TOMCAT5_SECURITY=no
hans@900: \end{lstlisting}
hans@900: 
hans@900: {\bf Hint: As there is no Java security policy for the GNV WebClient,
hans@900: Java Security Management is switched off.}
hans@900: 
hans@900: The Apache Tomcat is integrate with Apache WebServer just via the Apache
hans@900: JServ Protocoll (AJP). To secure the connection, just local connections
hans@900: are allowed for AJP on Tomcat.
hans@900: 
hans@900: Modify the \verb+ /etc/tomcat5.5/server.xml+:
hans@900: \begin{lstlisting}
hans@900: 
hans@900:     # Deactivate Standard HTTP Connector:
hans@900: 
hans@900:     +<!--
hans@900:      <Connector port="8180" maxHttpHeaderSize="8192" address="127.0.0.1"
hans@900:                 maxThreads="150" minSpareThreads="25" maxSpareThreads="75"
hans@900:                 enableLookups="false" redirectPort="8443" acceptCount="100"
hans@900:                 connectionTimeout="20000" disableUploadTimeout="true" />
hans@900:     +-->
hans@900:  
hans@900:      - <Connector port="8009" 
hans@900:      -           enableLookups="false" redirectPort="8443" protocol="AJP/1.3" />
hans@900:  
hans@900:      + <Connector port="8009" 
hans@900:      +           enableLookups="false" redirectPort="8443" protocol="AJP/1.3" address="127.0.0.1"/>
hans@900: \end{lstlisting}
hans@900:  
hans@900: To activate these changes, restart  Apache Tomcat:
hans@900:  
hans@900: \verb+ /etc/init.d/tomcat5.5 restart+
hans@900: 
hans@900:  \subsubsection*{Test of the Installation}
hans@900: 
hans@900: Check if the port 8009 is opened via:
hans@900: \verb+ netstat -nltp | grep 8009+
hans@900: 
hans@900: A possible listing looks like this:
hans@900: \begin{lstlisting}
hans@900:   tcp        0      0 127.0.0.1:8009          0.0.0.0:*  LISTEN      19252/jsvc
hans@900: \end{lstlisting}
hans@900:  
hans@900: So fare, there is no commandline client for AJP to test the connection.
hans@900: If there are problems, setup \verb+ mod_jk+ module in Apache WebServer
hans@900: and check its according log files.
hans@900: 
hans@900: \subsubsection*{Uninstalling Apache Tomcat}
hans@900: 
hans@900: To uninstall the Apache Tomcat, use the following:
hans@900: \verb+ apt-get --purge remove tomcat5.5+
hans@900: 
hans@900: 
hans@900: \subsection{Apache Webserver}
hans@900: This section describes the required steps for the installation and configuration 
hans@900: of the Apache Webserver Version 2.2.
hans@900: 
hans@900: \subsubsection*{Installation}
hans@900: 
hans@900: To install the Apache Webserver you have to execute the following command:
hans@900: 
hans@900: * apt-get install apache2
hans@900: 
hans@900: - Additional Modules
hans@900: To establish the Connection between the Tomcat Application Server and the 
hans@900: Apache Webserver we have to install an additional Module named Mod-JK
hans@900: 
hans@900: * apt-get install libapache2-mod-jk
hans@900: 
hans@900: - Configuration
hans@900: 
hans@900: -- Edit the Settings for mod-jk
hans@900: 
hans@900: Edit the Settings for mod-jk in File /etc/libapache2-mod-jk/workers.propertie
hans@900: as follows:
hans@900: 
hans@900: \begin{lstlisting}
hans@900:   - workers.java_home= /usr/lib/jvm/java-gcj/
hans@900:   + workers.java_home=/usr/lib/jvm/java-6-sun
hans@900: \end{lstlisting}
hans@900: 
hans@900: -- Enable mod-jk in Apache Webserver
hans@900: 
hans@900: For this add the follwing Lines to File /etc/apache2/httpd.conf:
hans@900: 
hans@900: \begin{lstlisting}
hans@900:   + JkWorkersFile "/etc/libapache2-mod-jk/workers.properties"
hans@900:   + JkLogFile "/var/log/mod_jk.log"
hans@900: \end{lstlisting}
hans@900: 
hans@900: --Disable default Site of Apache Webserver
hans@900: 
hans@900: * a2dissite default
hans@900: 
hans@900: --Enable the specific Site of GNV
hans@900: 
hans@900: * Copy File FIXME/gnv to /etc/apache2/sites-available
hans@900: 
hans@900: %FIXME: Configure contact address for Webserver
hans@900: 
hans@900: * a2ensite gnv
hans@900: 
hans@900: --Reload the Configuration of Apache Webserver
hans@900: 
hans@900: * /etc/init.d/apache2 reload
hans@900: 
hans@900: \subsubsection*{Test of the Installation}
hans@900: 
hans@900: You can test the Installation by executing the follwing url
hans@900: 
hans@900: * http://localhost/gnv/start.do
hans@900: 
hans@900: 
hans@900: \subsubsection*{Uninstalling the Apache Webserver}
hans@900: 
hans@900: To uninstall the Apache Webserver you can use the following Command:
hans@900: * apt-get --purge remove apache2
hans@900: 
hans@900: 
hans@900: \subsection{Installation of UMN MapServer}
hans@900: 
hans@900: \subsubsection*{Installation}
hans@900: -- Remove the installed old mapserver-Version from the System
hans@900: 
hans@900: * apt-get remove cgi-mapserve
hans@900: 
hans@900: -- Installing required Libraries
hans@900: 
hans@900: * apt-get install ttf-freefont
hans@900: * apt-get install libming0 libfribidi0
hans@900: 
hans@900: 
hans@900: -- Installing mapserver-gp
hans@900: 
hans@900: At first you have to configure the source for the Gispatcher-server where
hans@900: the Mapserverpackes are hosted by the Intevation.
hans@900: For this we have to add the followin line to File /etc/apt/sources.list
hans@900: 
hans@900:   deb http://apt.gispatcher.com/ lenny gispatcher
hans@900: 
hans@900: Then it is necessary to import the Key which is used to sign the Packages:
hans@900: 
hans@900:   TODO: gpg --keyserver hkp://keys.gnupg.net --recv-keys EC70B1B8
hans@900:   TODO: gpg --export EC70B1B8 | apt-key add -
hans@900: 
hans@900: Then install the mapserver-gp executing the follwong command
hans@900: 
hans@900: * apt-get install cgi-mapserv-gp
hans@900: 
hans@900: -- Installing mapserv-gp withou access to the Internet
hans@900: 
hans@900: If there is no access to the Internet it is possible to install the Mapserver
hans@900: manually.
hans@900: For this do the following steps:
hans@900: 
hans@900: \begin{lstlisting}
hans@900: * Copy the Packages of mapserver-gp via scp onto the Server
hans@900: * http://apt.gispatcher.com/dists/lenny/gispatcher/binary-i386/cgi-mapserver-gp_5.6.3-1~gp+1_i386.deb 
hans@900: * dpkg -i cgi-mapserver-gp_5.6.3-1~gp+1_i386.deb
hans@900: \end{lstlisting}
hans@900: 
hans@900: -- Make the Wrapper-Script available
hans@900: 
hans@900: To use the UMN-Mapserver without putting the Mapfile-Path into each URL it is
hans@900: possible to use a Script which will do that.
hans@900: 
hans@900: For this you have to copy TODO FIXME to /usr/lib/cgi-bin
hans@900: 
hans@900: You also have to edit the Script and set the PATH where the Mapfile is stored
hans@900: by the Artifact-Server into the Script.
hans@900: \begin{lstlisting}
hans@900: - export MS_MAPFILE=/opt/artifacts/mapfiles/mapfile.map
hans@900: + export MS_MAPFILE=/opt/artefact-server/mapfiles/mapfile.map // TODO FIXME
hans@900: \end{lstlisting}
hans@900: 
hans@900: %FIXME ERROR_LOGGING
hans@900: 
hans@900: % FIXME: Adapting contact data
hans@900: 
hans@900: \subsubsection*{Test of installation}
hans@900: You can chack if the Installation was sucsessful executing the following URl:
hans@900: 
hans@900: * curl http://localhost/cgi-bin/mapserv-gp
hans@900: 
hans@900: The response should look like this:
hans@900: 
hans@900: No query information to decode. \verb+QUERY_STRING+ is set, but empty.
hans@900: 
hans@900: \subsubsection*{Uninstall UMN- Mapserver}
hans@900: 
hans@900: To uninstall the UMN-mapserver you have to execute the following commands.
hans@900: 
hans@900: * rm TODO FIXME wrapperscript
hans@900: *  apt-get --purge remove cgi-mapserv-gp




