install_geoserver.rst 8.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273
  1. .. _extensions_wps_remote_install_geoserver:
  2. Deployment And Setup Of GeoServer With WPS Remote Plugin
  3. ========================================================
  4. The following commands will prepare a CentOS 7 Minimal ISO machine for the deployment of:
  5. * GeoServer with the following plugins:
  6. * GeoServer WPS
  7. * GeoServer Remote WPS Orchestrator
  8. * GeoServer Importer
  9. The OS iso has been downloaded from:::
  10. http://isoredirect.centos.org/centos/7/isos/x86_64/CentOS-7-x86_64-Minimal-1503-01.iso
  11. Preparation of the system: standard and basic OS packages
  12. ---------------------------------------------------------
  13. Hostname and other useful packages
  14. ++++++++++++++++++++++++++++++++++
  15. Update the file ``/etc/hosts`` making sure that the ip addresses matches the name of the machine.
  16. .. code-block:: bash
  17. # as root
  18. $> yum -y install man vim openssh-clients mc zip unzip wget net-tools
  19. Configure the Java Virtual Environment
  20. ++++++++++++++++++++++++++++++++++++++
  21. .. code-block:: bash
  22. # as root
  23. $> wget --no-check-certificate --no-cookies --header "Cookie: oraclelicense=accept-securebackupcookie" http://download.oracle.com/otn-pub/java/jdk/8u65-b17/jdk-8u74-linux-x64.tar.gz
  24. $> tar xzvf jdk-8u65-linux-x64.tar.gz
  25. $> mkdir /usr/java
  26. $> mv jdk1.8.0_65/ /usr/java/
  27. $> alternatives --install /usr/bin/java java /usr/java/jdk1.8.0_65/bin/java 20000
  28. $> alternatives --install /usr/bin/javac javac /usr/java/jdk1.8.0_65/bin/javac 20000
  29. $> alternatives --install /usr/bin/jar jar /usr/java/jdk1.8.0_65/bin/jar 20000
  30. $> alternatives --install /usr/bin/javaws javaws /usr/java/jdk1.8.0_65/bin/javaws 20000
  31. $> alternatives --set java /usr/java/jdk1.8.0_65/bin/java
  32. $> alternatives --set javac /usr/java/jdk1.8.0_65/bin/javac
  33. $> alternatives --set jar /usr/java/jdk1.8.0_65/bin/jar
  34. $> alternatives --set javaws /usr/java/jdk1.8.0_65/bin/javaws
  35. # Verify the proper installation on the JDK
  36. $> java -version
  37. java version "1.8.0_65"
  38. Java(TM) SE Runtime Environment (build 1.8.0_65-b17)
  39. Java HotSpot(TM) 64-Bit Server VM (build 25.65-b01, mixed mode)
  40. $> javac -version
  41. javac 1.8.0_65
  42. Installing Apache Tomcat
  43. ++++++++++++++++++++++++
  44. .. code-block:: bash
  45. # as root
  46. $> yum -y install tomcat-webapps
  47. $> systemctl disable tomcat.service
  48. $> cp /etc/sysconfig/tomcat /etc/sysconfig/geoserver
  49. $> ln -s /usr/share/tomcat/ /opt/tomcat
  50. **Creating apache tomcat HOME context**
  51. Creating base template directory
  52. .. code-block:: bash
  53. # as root
  54. $> mkdir -p /var/lib/tomcat/geoserver/{bin,conf,logs,temp,webapps,work}
  55. $> cp -Rf /opt/tomcat/conf/* /var/lib/tomcat/geoserver/conf/
  56. **Creating geoserver apache tomcat BASE context**
  57. Make sure you already:
  58. * installed tomcat (Installing apache tomcat)
  59. * created the base catalina template (Creating apache tomcat HOME context)
  60. Edit ``server.xml`` file
  61. GeoServer is the first tomcat instance we are installing in this VM, so we can keep the default ports:
  62. - 8005 for commands to catalina instance
  63. - 8009 for the AJP connection port
  64. - 8080 for the HTTP connection port
  65. Remember that you may change these ports in the file ``/var/lib/tomcat/geoserver/conf/server.xml``
  66. **Final configurations**
  67. Set the ownership of the ``geoserver/`` related directories to user tomcat
  68. .. code-block:: bash
  69. # as root
  70. $> chown tomcat: -R /var/lib/tomcat/geoserver
  71. $> cp /etc/tomcat/tomcat.conf /etc/tomcat/geoserver.conf
  72. $> vi /etc/tomcat/geoserver.conf
  73. # This variable is used to figure out if config is loaded or not.
  74. TOMCAT_CFG_LOADED="1"
  75. # In new-style instances, if CATALINA_BASE isn't specified, it will
  76. # be constructed by joining TOMCATS_BASE and NAME.
  77. TOMCATS_BASE="/var/lib/tomcats/"
  78. # Where your java installation lives
  79. #JAVA_HOME="/usr/lib/jvm/jre"
  80. JAVA_HOME="/usr/java/jdk1.7.0_71"
  81. # Where your tomcat installation lives
  82. CATALINA_HOME="/usr/share/tomcat"
  83. CATALINA_BASE="/var/lib/tomcat/geoserver"
  84. CATALINA_PID=$CATALINA_BASE/work/pidfile.pid
  85. # System-wide tmp
  86. CATALINA_TMPDIR="/var/cache/tomcat/temp"
  87. # You can pass some parameters to java here if you wish to
  88. #JAVA_OPTS="-Xminf0.1 -Xmaxf0.3"
  89. # Use JAVA_OPTS to set java.library.path for libtcnative.so
  90. #JAVA_OPTS="-Djava.library.path=/usr/lib"
  91. JAVA_OPTS="-server -XX:SoftRefLRUPolicyMSPerMB=36000 -Xms1024m -Xmx2048m
  92. -XX:PermSize=64m -XX:+UseConcMarkSweepGC -XX:NewSize=48m -DGEOSERVER_DATA_DIR=/storage/data/
  93. -DENABLE_ADVANCED_PROJECTION=false -Dorg.geotools.shapefile.datetime=true -Duser.timezone=GMT
  94. -Dorg.geotools.filter.function.simplify=true -DGEOMETRY_COLLECT_MAX_COORDINATES=50000"
  95. # You can change your tomcat locale here
  96. #LANG="en_US"
  97. # Run tomcat under the Java Security Manager
  98. SECURITY_MANAGER="false"
  99. $> cp /usr/lib/systemd/system/tomcat.service /usr/lib/systemd/system/geoserver.service
  100. $> vi /usr/lib/systemd/system/geoserver.service
  101. EnvironmentFile=/etc/tomcat/geoserver.conf
  102. $> systemctl enable geoserver.service
  103. $> systemctl restart geoserver.service
  104. # Follow the server startup procedure and make sure everything goes smoothly through the following command
  105. $> tail -F /var/lib/tomcat/geoserver/logs/catalina.YYYY-MM-DD.log
  106. Deploy And Configure GeoServer
  107. ++++++++++++++++++++++++++++++
  108. **First deployment**
  109. .. code-block:: bash
  110. # as root
  111. # Git and Maven must be installed on the system
  112. $> yum -y install git
  113. $> yum -y install maven
  114. # Verify the Maven installation and double check that the JDK recognized is the Java Sun 1.7+
  115. $> mvn -version
  116. Apache Maven 3.0.5 (Red Hat 3.0.5-16)
  117. Maven home: /usr/share/maven
  118. Java version: 1.8.0_65, vendor: Oracle Corporation
  119. Java home: /usr/java/jdk1.8.0_65/jre
  120. Default locale: en_US, platform encoding: UTF-8
  121. OS name: "linux", version: "3.10.0-229.el7.x86_64", arch: "amd64", family: "unix"
  122. # The following procedures allow to collect and compile the source code from the GIT repository.
  123. $> cd
  124. $> git clone https://github.com/geosolutions-it/geoserver.git geoserver.src
  125. $> cd geoserver.src/src
  126. $> git checkout wps-remote
  127. $> git pull
  128. $> mvn clean install -Pwps,wps-remote,importer,security,rest-ext -DskipTests
  129. $> mv web/app/target/geoserver.war /var/lib/tomcat/geoserver/webapps/
  130. $> chown -Rf tomcat: /var/lib/tomcat/geoserver
  131. $> mv /var/lib/tomcat/geoserver/webapps/geoserver/data/ /storage/
  132. $> chown -Rf tomcat: /storage
  133. $> vim /storage/data/remoteProcess.properties
  134. # Default Properties
  135. remoteProcessStubCycleSleepTime = 100
  136. # Base path where uploaded files are stored
  137. # . This is used only when a remote uploader is enabled on the Python
  138. # . WPS Agent. This property represents the local base path (on the filesystem
  139. # . of GeoServer) where to search for uploaded files.
  140. # . If not file has been found here (or this option is not enabled), GeoServer
  141. # . looks for absolute path and/or paths relative to the GEOSERVER DATA DIR.
  142. #uploadedFilesBasePath = /tmp
  143. # Full path to the template used to generate the OWS WMC Json output
  144. # . This property is used only when a "application/owc" output type on
  145. # . the Python WPS Agent.
  146. #owc_wms_json_template = absolute_path/to/wmc_template.json
  147. # Specific kvps for {@link RemoteProcessClient) implementations
  148. xmpp_server = localhost
  149. xmpp_server_embedded = false
  150. xmpp_server_embedded_secure = true
  151. xmpp_server_embedded_certificate_file = bogus_mina_tls.cert
  152. xmpp_server_embedded_certificate_password = boguspw
  153. xmpp_port = 5222
  154. xmpp_manager_username = admin
  155. xmpp_manager_password = R3m0T3wP5
  156. # domain and MUC service name of the XMPP Server
  157. xmpp_domain = geoserver.org
  158. xmpp_bus = conference
  159. # name, user and password of the management room
  160. xmpp_management_channel = management
  161. xmpp_management_channel_user = admin
  162. xmpp_management_channel_pwd = R3m0T3wP5
  163. # comma separated list of available rooms for services. Those rooms'names will be equal to the service and WPS Process namespace
  164. # Avoid spaces
  165. xmpp_service_channels = default,geosolutions
  166. # millis
  167. xmpp_packet_reply_timeout = 500
  168. # connection keep alive
  169. xmpp_connection_ping_interval = 30000
  170. xmpp_connection_ping_timeout = 10000
  171. xmpp_connection_ping_initial_delay = 20000
  172. # Thresholds indicating overloaded resources
  173. xmpp_cpu_perc_threshold = 82.5
  174. xmpp_mem_perc_threshold = 84.6
  175. # Restart GeoServer
  176. $> service geoserver restart
  177. .. warning:: GeoServer won't connect to XMPP Server until it has been correctly configured and started as explained in the next section :ref:`extensions_wps_remote_install_xmpp`.