GeoServer 下載安裝部署(一)


最近由於項目需求,需要用到GeoServer進行地圖發布。之前草草的學習過一段時間的GeoServer,但是都沒有記錄下來,到現在用的時候很多東西都需要重新查閱。所以現在將步驟記錄下來,以供查閱。

GeoServer簡介

GeoServer定義

是 OpenGIS Web 服務器規范的 J2EE 實現,利用 GeoServer 可以方便的發布地圖數據,允許用戶對特征數據進行更新、刪除、插入操作,通過 GeoServer 可以比較容易的在用戶之間迅速共享空間地理信息。

GeoServer 主要特性

兼容 WMS 和 WFS 特性;支持 PostgreSQL、 Shapefile 、 ArcSDE 、 Oracle 、 VPF 、 MySQL 、 MapInfo ;支持上百種投影;能夠將網絡地圖輸出為 jpeg 、 gif 、 png 、 SVG 、 KML 等格式;能夠運行在任何基於 J2EE/Servlet 容器之上;嵌入 MapBuilder 支持 AJAX 的地圖客戶端OpenLayers;除此之外還包括許多其他的特性。

一、GeoServer下載

GeoServer的下載地址:http://geoserver.org/release/stable/

下載頁面包括了GeoServer的安裝文件,war包和文檔及擴展。如下圖:

我這里下載好了這些文件,百度網盤:http://pan.baidu.com/s/1mi6bqkw 分享密碼:4d9w

二、GeoServer的安裝

 GeoServer的安裝方式有多種,幫助文檔中建議Windows和Mac OS采用獨立安裝方式。

這里需要注意的是:

Note

To run GeoServer as part of an existing servlet container such as Tomcat, please see the Web archive section.

Warning

GeoServer requires a Java 7 environment (JRE) to be installed on your system. This must be done prior to installation.

 Windows 安裝

The Windows installer provides an easy way to set up GeoServer on your system, as it requires no configuration files to be edited or command line settings.

  1. Make sure you have a Java Runtime Environment (JRE) installed on your system. GeoServer requires a Java 8 environment. The Oracle JRE is preferred, but OpenJDK has been known to work adequately. You can download JRE 8 from Oracle.

    Note

     

    Java 9 is not currently supported.

    Note

     

    For more information about Java and GeoServer, please see the section onJava Considerations.

  2. Navigate to the GeoServer Download page.

  3. Select the version of GeoServer that you wish to download. If you’re not sure, selectStable.

  4. Click the link for the Windows installer.

    ../_images/win_download.png

    Downloading the Windows installer

  5. After downloading, double-click the file to launch.

  6. At the Welcome screen, click Next.

    ../_images/win_welcome.png

    Welcome screen

  7. Read the License and click I Agree.

    ../_images/win_license.png

    GeoServer license

  8. Select the directory of the installation, then click Next.

    ../_images/win_installdir.png

    GeoServer install directory

  9. Select the Start Menu directory name and location, then click Next.

    ../_images/win_startmenu.png

    Start menu location

  10. Enter the path to a valid Java Runtime Environment (JRE). GeoServer requires a valid JRE in order to run, so this step is required. The installer will inspect your system and attempt to automatically populate this box with a JRE if it is found, but otherwise you will have to enter this path manually. When finished, click Next.

    Note

     

    A typical path on Windows would be C:\Program Files\Java\jre8.

    Note

     

    Don’t include the \bin in the JRE path. So if java.exe is located atC:\Program Files (x86)\Java\jre8\bin\java.exe, set the path to be C:\Program Files(x86)\Java\jre8.

    Note

     

    For more information about Java and GeoServer, please see the section onJava Considerations.

    ../_images/win_jre.png

    Selecting a valid JRE

  11. Enter the path to your GeoServer data directory or select the default. If this is your first time using GeoServer, select the Default data directory. When finished, click Next.

    ../_images/win_datadir.png

    Setting a GeoServer data directory

  12. Enter the username and password for administration of GeoServer. GeoServer’s Web administration interface requires authentication for management, and what is entered here will become those administrator credentials. The defaults are admin / geoserver. It is recommended to change these from the defaults. When finished, clickNext.

    ../_images/win_creds.png

    Setting the username and password for GeoServer administration

  13. Enter the port that GeoServer will respond on. This affects the location of the GeoServer Web administration interface, as well as the endpoints of the GeoServer services such as Web Map Service (WMS) and Web Feature Service (WFS). The default port is 8080, though any valid and unused port will work. When finished, click Next.

    ../_images/win_port.png

    Setting the GeoServer port

  14. Select whether GeoServer should be run manually or installed as a service. When run manually, GeoServer is run like a standard application under the current user. When installed as a service, GeoServer is integrated into Windows Services, and thus is easier to administer. If running on a server, or to manage GeoServer as a service, select Install as a service. Otherwise, select Run manually. When finished, clickNext.

    ../_images/win_service.png

    Installing GeoServer as a service

  15. Review your selections and click the Back button if any changes need to be made. Otherwise, click Install.

    ../_images/win_review.png

    Verifying settings

  16. GeoServer will install on your system. When finished, click Finish to close the installer.

  17. If you installed GeoServer as a service, it is already running. Otherwise, you can start GeoServer by going to the Start Menu, and clicking Start GeoServer in the GeoServer folder.

  18. Navigate to http://localhost:8080/geoserver (or wherever you installed GeoServer) to access the GeoServer Web administration interface.

If you see the GeoServer logo, then GeoServer is successfully installed.

../_images/success.png

GeoServer installed and running successfully

Windows binary 安裝

Note

 

For the wizard-based installer on Windows, please see the section on the Windows installer. For installing on Windows with an existing application server such as Tomcat, please see the Web archive section.

An alternate way of installing GeoServer on Windows is to use the platform-independent binary. This version is a GeoServer web application bundled inside Jetty, a lightweight and portable application server. It has the advantages of working very similarly across all operating systems and is very simple to set up.

Installation

  1. Make sure you have a Java Runtime Environment (JRE) installed on your system. GeoServer requires a Java 8 environment. The Oracle JRE is preferred, but OpenJDK has been known to work adequately. You can download JRE 8 from Oracle.

    Note

     

    Java 9 is not currently supported.

    Note

     

    For more information about Java and GeoServer, please see the section onJava Considerations.

  2. Navigate to the GeoServer Download page.

  3. Select the version of GeoServer that you wish to download. If you’re not sure, selectStable.

  4. Select Platform Independent Binary on the download page.

  5. Download the archive and unpack to the directory where you would like the program to be located.

    Note

     

    A suggested location would be C:\Program Files\GeoServer.

Setting environment variables

You will need to set the JAVA_HOME environment variable if it is not already set. This is the path to your JRE such that %JAVA_HOME%\bin\java.exe exists.

  1. Navigate to Control Panel ‣ System ‣ Advanced ‣ Environment Variables.
  2. Under System variables click New.
  3. For Variable name enter JAVA_HOME. For Variable value enter the path to your JDK/JRE.
  4. Click OK three times.

Note

 

You may also want to set the GEOSERVER_HOME variable, which is the directory where GeoServer is installed, and the GEOSERVER_DATA_DIR variable, which is the location of the GeoServer data directory (which by default is %GEOSERVER_HOME\data_dir). The latter is mandatory if you wish to use a data directory other than the default location. The procedure for setting these variables is identical to setting the JAVA_HOME variable.

Running

Note

 

This can be done either via Windows Explorer or the command line.

  1. Navigate to the bin directory inside the location where GeoServer is installed.
  2. Run startup.bat. A command-line window will appear and persist. This window contains diagnostic and troubleshooting information. This window must be left open, otherwise GeoServer will shut down.
  3. Navigate to http://localhost:8080/geoserver (or wherever you installed GeoServer) to access the GeoServer Web administration interface.

If you see the GeoServer logo, then GeoServer is successfully installed.

../_images/success.png

GeoServer installed and running successfully


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM