Gateway Installation
# Prerequisites
- Have administrator privileges in the IDaaS Enterprise Center platform.
- Have already added a gateway and gateway Server in the IDaaS platform.
- Have operating permissions for the server.
- The server can access IDaaS services.
# Install Gateway
The following will explain how to complete the service installation and deployment of the Gateway on a Linux environment. To prevent unexpected issues, please perform the following operations with root privileges.
Ensure the gateway deployment server can access the external network, or at least can access the IDaaS server; otherwise, the gateway installation and deployment cannot be completed.
# 1. Create the runtime directory
mkdir -p /opt/gateway
cd /opt/gateway
2
# 2. Download and extract
# Download the latest gateway
wget https://idaas-prod.oss-cn-zhangjiakou.aliyuncs.com/gateway/server/gateway-24.6.1.0.tar.gz
# Extract
tar -zxvf gateway-24.6.1.0.tar.gz
# Move the gateway binary file to the /usr/bin directory for easy execution of the gateway command
mv -f gateway-24.6.1.0/gateway /usr/bin
# Test, success will output the current gateway version number
gateway version
# Delete the archive (optional)
rm -rf gateway-24.6.1.0.tar.gz
2
3
4
5
6
7
8
9
10
11
12
13
14
# Connect to IDaaS and start
## Move the configuration files to the current directory (current directory is /opt/gateway)
mv gateway-24.6.1.0/config /opt/gateway/
## Edit the configuration file
vim config/idaas.json
## After completing the configuration, execute the following command to install the gateway service
gateway service install --idaas-config=/opt/gateway/config/idaas.json
## Start the gateway service
gateway service start
## View service logs
journalctl -u GatewayServer -f
## Delete the invalid folder (optional)
rm -rf gateway-24.6.1.0
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
- Please configure the configuration file according to the configuration information provided when creating the gateway Server in IDaaS.
- After the gateway service is successfully installed, the system service will create a GatewayServer service. (Upon successful installation, the file /etc/systemd/system/GatewayServer.service is automatically generated.)
# Verify the gateway service
- By checking the IDaaS application security gateway Server list, if the gateway service status is online, congratulations on completing the gateway installation and deployment.
- Subsequently, you can complete application configuration and usage through the gateway guide.
# Gateway Command Introduction
- gateway [command] --help can view command help information
Gateway is an extensible server platform written in Go.
Usage:
gateway [command]
Examples:
$ gateway run --config config/gateway.json
$ gateway run --idaas-config config/idaas.json
$ gateway service
Available Commands:
encrypt Provide encryption tools, Used to encrypt configuration parameters
generate Automatically generate relevant data
help Help about any command
run Run the Gateway process and blocks indefinitely
service Administration Gateway Server System service, Administrator privileges are required to execute this Subcommands
version Prints gateway server version
Flags:
-h, --help help for gateway
Use "gateway [command] --help" for more information about a command.
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
- gateway run [flags] --help Run the Gateway
Execute the program using the run command. The program will automatically exit when the terminal closes. If you need to run the gateway program in the background, you can use the nohup command. You can also use the service command supported by the gateway to manage the gateway service, which perfectly solves running the application in the background and starting it automatically with the system.
Run the Gateway process and blocks indefinitely
Usage:
gateway run [flags]
Flags:
--config string Gateway Configuration file, default config/gateway.json
-h, --help help for run
--idaas-config string IDaaS Configuration file, default config/idaas.json
2
3
4
5
6
7
8
9
- gateway service [command] --help Gateway Service Operation Commands
Administration Gateway Server System service, Administrator privileges are required to execute this Subcommands
Usage:
gateway service [command]
Available Commands:
install install Gateway Server System service, specify config file (use --config)
restart restart Gateway Server System service
start start Gateway Server System service
status view Gateway Server System service status
stop stop Gateway Server System service
uninstall uninstall Gateway Server System service
Flags:
-h, --help help for service
Use "gateway service [command] --help" for more information about a command.
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
