当前版本:v0.3.5
一站式搭建离线地图服务器,支持多种地图离线发布;提供快速WEB应用、WMTS、TMS等服务;支持二次开发调用;
Bigemap Server 支持以下操作系统:
* 部署到 Windows 系统直接下载安装程序。部署到 Linux 系统按照以下步骤。
在安装Bigemap Server之前,需要安装一下依赖项:
Wget、OpenSSL及unzip都是Bigemap Server安装脚本所需,Docker和Docker Compose是服务运行、集成容器。
# Most of these commands need to be run by the root user
$ sudo su
$ yum check-update
$ yum install -y epel-release
$ yum install -y wget openssl python-pip unzip
# Install Docker
$ curl -fsSL https://get.docker.com/ | sh
# Add your user to the Docker group. i.e. centos
$ usermod -aG docker <your-user-name>
# Enable the Docker daemon to start at system boot
$ systemctl enable docker.service
# Start the Docker daemon
$ systemctl start docker.service
# Install Docker Compose
$ pip install docker-compose
# Update the package database
$ sudo apt-get update
# Install Docker and Server dependencies
$ sudo apt-get install \
linux-image-extra-$(uname -r) \
linux-image-extra-virtual \
apt-transport-https \
ca-certificates \
curl \
software-properties-common \
docker-ce \
wget \
openssl \
unzip
# Add the Docker repository to APT sources
$ curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
$ sudo add-apt-repository \
"deb [arch=amd64] https://download.docker.com/linux/ubuntu \
$(lsb_release -cs) \
stable"
# Update the package database with the Docker packages
$ sudo apt-get update
# Install Docker
$ sudo apt-get install -y docker-ce
# Add your user to the Docker group. i.e. ubuntu
$ sudo usermod -aG docker <your-user-name>
# Check the current release and, if necessary, update it in the command below
$ sudo curl -L \
https://github.com/docker/compose/releases/download/1.18.0/docker-compose-`uname -s`-`uname -m` \
-o /usr/local/bin/docker-compose
# Set execute permissions on docker-compose
$ sudo chmod +x /usr/local/bin/docker-compose
# Update the package database
$ sudo apt-get update
# Install Docker and Server dependencies
$ sudo apt-get install -y wget openssl unzip
# Add the Docker repository to APT sources
$ curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
$ sudo add-apt-repository \
"deb [arch=amd64] https://download.docker.com/linux/ubuntu \
$(lsb_release -cs) \
stable"
# Update the package database with the Docker packages
$ sudo apt-get update
# Make sure you are about to install from the Docker repo
$ sudo apt-cache policy docker-ce
# Install Docker
$ sudo apt-get install -y docker-ce
# Add your user to the docker group. i.e. ubuntu
$ sudo usermod -aG docker <your-user-name>
# Check the current release and, if necessary, update it in the command below
$ sudo curl -L \
https://github.com/docker/compose/releases/download/1.18.0/docker-compose-`uname -s`-`uname -m` \
-o /usr/local/bin/docker-compose
# Set execute permissions on docker-compose
$ sudo chmod +x /usr/local/bin/docker-compose
# Update the package database
$ sudo apt-get update
# Install Docker and Server dependencies
$ sudo apt-get install -y wget openssl unzip
# Install Docker
$ curl -fsSL https://get.docker.com/ | sh
# Add your user to the docker group. i.e. ubuntu
$ sudo usermod -aG docker <your-user-name>
# Enable the Docker daemon to start at system boot
$ sudo systemctl enable docker
# Start the Docker daemon
$ sudo systemctl start docker
# Check the current release and, if necessary, update it in the command below
$ sudo curl -L \
https://github.com/docker/compose/releases/download/1.18.0/docker-compose-`uname -s`-`uname -m` \
-o /usr/local/bin/docker-compose
# Set execute permissions on docker-compose
$ sudo chmod +x /usr/local/bin/docker-compose
Bigemap Server installer是命令行脚本(CLI)程序用于下载、安装Bigemap Server。
命令 | 需要联网 | 描述 |
---|---|---|
install |
是 | 自动下载并安装Bigemap Server |
download |
是 | 下载Bigemap Server |
setup |
否 | 安装Bigemap Server |
list |
是 | 查看发布的历史版本 |
settings |
否 | 配置Bigemap Server |
remove |
否 | 卸载Bigemap Server |
* 使用./bm-server-installer help <command>
查看命令详细帮助。
wget http://downloads.bigemap.com/bm-server/linux/bm-server-installer.zip
(点击下载)unzip bm-server-installer.zip
chmod +x ./bm-server-installer
./bm-server-installer help
一步安装将自动下载并安装最新发布本版,需本机联网部署。
# Install Bigemap server, 'bm-server' is the installation path.
$ sudo ./bm-server-installer install bm-server
# Enter installation path
$ cd bm-server
# Start Bigemap server
$ ./bm-server.sh start
# Restart Bigemap server
$ ./bm-server.sh restart
# Stop Bigemap server
$ ./bm-server.sh stop
# Show logs
$ ./bm-server.sh logs
离线部署首先需手动下载并安装依赖项,才进行此离线安装步骤。按以下步骤进行,首先下载所需文件,然后将bm-server-installer
以及下载目录bm-server-files
一并拷贝到离线服务器上,最后执行setup
命令安装。
download
命令将Bigemap Server所需文件下载一个指定目录,后续将在setup
命令中使用。
# Download Bigemap Server, 'bm-server-files' is the directory where the downloaded files will be saved。
$ ./bm-server-installer download bm-server-files
# Since v0.3.4
# Spectify target architecture.
$ ./bm-server-installer download bm-server-files --arch arm64
# Package into a .zip file.
$ ./bm-server-installer download bm-server-files --zip
--version
(可选) 下载Bigemap Server指定的版本,可通过list
命令查看可用版本--arch
(可选) 指定要下载的架构,目前支持amd64
arm64
mips64el
。在将运行Bigemap Server的服务器上执行setup
命令。其中参数bm-server-files
是download
命令下载所需的文件;参数bm-server
是目标安装目录。
$ ./bm-server-installer setup bm-server-files bm-server
安装完成后,执行bm-server.sh
启动服务:
$ (cd bm-server && ./bm-server.sh start)
list
命令列出了所有可下载的Bigemap Server版本。
通过bm-server.sh
查看当前安装的版本:
$ ./bm-server.sh version
查看所有可下载版本:
$ ./bm-server-installer list
通过download
命令并指定--version
参数下载指定的Bigemap Server版本。
$ ./bm-server-installer download bm-server-files --version <bm-server-version>
Bigemap Server采用JSON文件配置,默认配置文件在bm-server-installer
目录中。Linux默认配置如下:
{
"URL": "http://localhost:3000",
"Port": 3000,
"AuthPort": 4388,
"Password": "password",
"TilesetPath": "./tilesets"
}
URL
服务URL,默认http://localhost:3000
。Port
服务端口,默认3000
。AuthPort
授权服务端口,默认4388
。Password
登录服务管理密码,远程访问服务管理需登录,建议修改密码。TilesetPath
地图瓦片服务根目录,添加离线地图服务可浏览该目录下文件。修改配置文件后,通过settings
命令应用配置。
$ ./bm-server-installer settings <target> --config <path to JSON file>
<target>
目标安装目录,例如bm-server
。--config
配置文件路径。# Update the server config
$ ./bm-server-installer settings bm-server --config ./config.json
# Restart Bigemap Server
$ (cd bm-server && ./bm-server.sh restart)
可以将BIgemap Server配置为使用Https进行通信以提高安全性。 在生产中,证书文件应由受信任的证书颁发机构签名。为了便于测试,提供了一个脚本来生成自签名证书。
$ ./bm-server-installer settings <target> --ssl-key <path to pkey file> --ssl-cert <path to cert file>
<target>
目标安装目录,例如bm-server
。--ssl-key
证书的私钥文件。--ssl-cert
证书文件。--ssl-ca
(可选) CA证书文件。# Use the certificate file
$ ./bm-server-installer settings bm-server --ssl-key ./cert/pri.key --ssl-cert ./cert/cert.crt
# Use self-signed certificate
$ ./bm-server-installer settings bm-server --self-signed
# Switch to HTTP
$ ./bm-server-installer settings bm-server --http
# Restart Bigemap Server
$ (cd bm-server && ./bm-server.sh restart)
配置离线地图服务器授权服务,仅适用于特定终端授权程序。
docker
目录中;如bm-server/docker
中。settings
命令$ ./bm-server-installer settings bm-server --init-auth
$ (cd bm-server && ./bm-server.sh restart)
删除授权服务,删除后重启服务生效。
$ ./bm-server-installer settings bm-server --remove-auth
$ ./bm-server-installer settings <target> --network <mode>
<target>
目标安装目录,例如bm-server
。--network
网络模式,host
或bridge
# Switch to host mode
$ ./bm-server-installer settings bm-server --network host
# Switch to bridge mode
$ ./bm-server-installer settings bm-server --network bridge
# Restart Bigemap Server
$ (cd bm-server && ./bm-server.sh restart)
配置加密锁权限,非root
用户可访问加密锁设备。配置后需重启服务器应用规则。
$ sudo ./bm-server-installer device --inst
# Install udev rules for dongle device.
$ sudo ./bm-server-installer device --inst
# Install udev rules and service when using Docker Stack
$ sudo ./bm-server-installer device --inst-stack
# Uninstall udev rules and service
$ sudo ./bm-server-installer device --uninst