- GeoServer Beginner's Guide(Second Edition)
- Stefano Iacovella
- 662字
- 2021-07-08 09:21:09
Installing required components
Before you can use GeoServer on your machine, you need to install some required pieces of software. GeoServer is a Java application; therefore, one of the most important things you need to ensure is that a Java virtual machine is working on your machine.
There are two main packages of Java. Depending on what you are planning to do with Java, you may want to install a JDK (Java Development Kit) or JRE (Java Runtime Environment).
The former enables you to compile Java code, while the latter has all you need to run most Java applications. Starting from release 2.0, GeoServer does not need a full JDK installation, and you can go safely with JRE. The JDK is only required if you are planning to write and compile Java code. This is the case if you want to modify the GeoServer source code, to fix code, or add functionalities.
The current version of GeoServer requires Java 8 (see the last paragraph in this chapter for details about the release's schedule). Keep in mind that Java 9 is not supported, it may work on it, but you will not get support for any trouble you will find while using it.
In the 90s, Sun Microsystems started the development of Java. It has developed each new release until it merged into Oracle Corporation. While Oracle did not change the Java license to a commercial one, there are some license issues preventing Oracle Java from being available on Linux repositories, while you can obtain it directly from Oracle online resources.
In the current releases of Linux Mint, you will find OpenJDK already installed in the desktop edition; in the server, you need to choose it during setup. In the past releases, GeoServer was not intensively tested on OpenJDK; today, it has been known to work adequately with no issues, although the Oracle JRE is preferred.
Oracle Java should be your first choice unless you have some specific issues. In this chapter, we will use both. If you are using a Windows machine, then chances are that there is no Java runtime preinstalled. We will check and fix this.
After you have correctly installed the JRE, you can move on and install the servlet container. GeoServer is a web application, and it is built using frameworks such as Java servlet and JavaServer Pages technologies. The servlet container, or web container, is the component server that interacts with the servlets. It is responsible for managing the lifecycle of servlets, mapping a URL to a particular servlet, and ensuring access security.
As for the servlet container, you have a few choices here; a brief list is available at http://en.wikipedia.org/wiki/Web_container.
Apache Tomcat, GlassFish, and JBoss are most popular, and they are all available under open source licenses. You may wonder which one is the best choice to run GeoServer. According to the official documentation at http://docs.geoserver.org/stable/en/user/index.html:
In a production environment, usually, several web applications share the same container. In this scenario, you will not choose the container; the architects and system administrators made their choices and you have to conform to them.
As a beginner, you have the opportunity of selecting it! And, in this case, Apache Tomcat should be your first choice as it is widely adopted in the GeoServer developer's community. If you run into any issues, the answer is probably waiting for you in the mailing list archive.