Websocket Configuration and Installation
Firewall Configuration
Inbound Rules
| Type | Protocol | Port Range | Sources |
|---|---|---|---|
| All TCP | TCP | All ports | 131.226.32.251 |
| SSH | TCP | 22 | 141.98.24.21, 141.98.24.22, 152.89.76.109, 152.89.76.110, 152.89.76.111, 185.22.211.0/24, 185.69.56.208, 185.69.56.209, 185.69.56.210, 2a03:2800:0300::/64, Bastion (tag) |
| Custom TCP | TCP | 8080-8081 | 10.131.43.239, mg-ub-web-001, mg-ub-web-002, mg-ub-web-003, mg-ub-web-004, ProductionWebserver (tag), Webserver (tag) |
Outbound Rules
| Type | Protocol | Port Range | Destinations |
|---|---|---|---|
| ICMP | ICMP | All ports | All IPv4, All IPv6 |
| All TCP | TCP | All ports | All IPv4, All IPv6 |
| All UDP | UDP | All ports | All IPv4, All IPv6 |
Installation on Ubuntu 24.04
Install Node
Install NPM
Install Supervisor
Deploying from DeployHQ
Create a server deployment from the Method Grid app repository to the websocket server.
Follow DeployHQ's instructions for giving DeployHQ access to the server, then set the following options:
- Deployment path: /usr/src/app
- Environment: production
- Subdirectory to deploy from: websocket/
Deploy the code.
Note: The Gantt Scheduler and Gantt PDF Exporter are currently both installed on the same server as the websocket server. See the relevant documentation for setting those up: - Scheduler installation/configuration - Gantt PDF Server Setup
Configuration
Create Websocket Supervisor .conf File
Create log directory:
Create /etc/supervisor/conf.d/websocket.conf (replace IP addresses with private IPs of relevant servers):
[program:websocket]
command=/usr/bin/node /usr/src/app/server.mjs --app-url=https://app.methodgrid.com --port=8080 --log-path=/var/log/mg-websocket --cache-db-hostname={mongo-db-ip} --cache-db-username= --cache-db-password= --rabbit-mq-host={rabbit-mq-ip} --rabbit-mq-username=mg --rabbit-mq-password={rabbit-mq-password}
autostart=true
autorestart=true
stderr_logfile=/var/log/mg-websocket/websocket.error.log
stdout_logfile=/var/log/mg-websocket/websocket.log
Restart Supervisor
Verify that websocket server is running
Create Firewall Rules
The websocket server firewall must allow incoming connections to ports 8080 and 8081 from all web servers.