官术网_书友最值得收藏!

  • Practical GIS
  • Gábor Farkas
  • 681字
  • 2021-07-02 22:49:08

Installing on Linux

Installing the packages on Linux distributions is pretty straightforward. The dependencies are installed with the packages, when there are any. We only have to watch out for three things prior to installing the packages. First of all, the package name of the Apache web server can vary between different distributions. On distros using RPM packages (for example--Fedora, CentOS, and openSUSE), it is called httpd, while on the ones using DEB packages (for example--Debian and Ubuntu), it is called apache2. On Arch Linux, it is simply called apache.

While Arch Linux is far from the best distribution for using GIS, you can get most of the packages from AUR (Arch User Repository). 

The second consideration is related to distributions which do not update their packages frequently, like Debian. GeoServer has a hard dependency of a specific JRE (Java Runtime Environment). We must make sure we have it installed and configured as the default. We will walk through the Debian JRE installation process as it is the most popular Linux distribution with late official package updates. Debian Jessie, the latest stable release of the OS when writing these lines, is packed with OpenJDK 7, while GeoServer 2.11 requires JRE 8:

You can check the JRE version of the latest GeoServer version uses at  http://docs.geoserver.org/latest/en/user/installation/index.html. You can check the JRE version installed on your OS with the terminal command  update-alternatives --list java.
  1. To install OpenJDK 8, we have to enable the Backports repository according to the official Debian guide at https://wiki.debian.org/Backports.
  2. If the repository is added, we can reload the packages and install the package openjdk-8-jre.
  3. The next step is to make this JRE the default one. We can do this by opening a terminal and typing the following command:
      update-alternatives --config java
  1. The next step is self-explanatory; we have to choose the new default environment by typing its ID and pressing enter.
Make sure to disable the Backports repository by commenting it out in /etc/apt/sources.list, or by checking out its checkbox in Synaptic after installing the required packages. It can boycott further updates in some cases.

The last consideration before installing the packages is related to the actual version of QGIS. Most of the distributions offer the latest version in a decent time after release; however, some of them like Debian do not. For those distros, we can use QGIS's repository following the official guide at http://www.qgis.org/en/site/forusers/alldownloads.html.

After all things are set, we can proceed and install the required packages. The order should not matter. If done, let's take a look at GeoServer, which doesn't offer Linux packages to install. It offers two methods for Linux: a WAR for already installed Java servlets (such as Apache Tomcat), and a self-containing platform independent binary. We will use the latter as it's easier to set up:

  1. Download GeoServer's platform independent binary from http://geoserver.org/release/stable/.
If there is absolutely no way to install OpenJDK 8 on your computer, you can use GeoServer 2.8, which depends on JRE 7. You can download it from  http://geoserver.org/release/2.8.5/.
  1. Extract the downloaded archive. It can be anywhere as long as we have a write permission to the destination.
  2. Start GeoServer with its startup script. To do this, we navigate into the extracted archive from a terminal and run startup.sh in its bin folder with the following command:
      cd <geoserver's folder>/bin
./startup.sh
  1. Optionally, we can detach GeoServer from the shell used by the terminal with the startup command nohup ./startup.sh > /dev/null &. This way, we can close the terminal. If we would like to shut down GeoServer manually, we can do so by running its shutdown.sh script.
By default, the shell closes every subprocess it started before terminating itself. By using nohup, we override this behavior for the GeoServer process, and by using & at the end of the command, we fork the process. This way, we regain control over the shell. The >/dev/null part prevents nohup from logging GeoServer's verbose startup messages.
主站蜘蛛池模板: 上饶市| 南岸区| 双桥区| 彭州市| 清镇市| 突泉县| 抚顺县| 西林县| 贵南县| 新巴尔虎左旗| 玛纳斯县| 赤壁市| 剑阁县| 若尔盖县| 朔州市| 金乡县| 聂荣县| 玉林市| 益阳市| 乌恰县| 鄂托克旗| 射阳县| 通州区| 达拉特旗| 东丰县| 乌审旗| 青田县| 昆山市| 威海市| 阿鲁科尔沁旗| 东台市| 墨脱县| 来凤县| 彰武县| 西乡县| 揭西县| 临海市| 泸水县| 丰县| 仁怀市| 景东|