Skip to content

Commit

Permalink
more docs
Browse files Browse the repository at this point in the history
  • Loading branch information
Paul Philion committed May 21, 2024
1 parent 23cfa2e commit 64e0000
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 14 deletions.
52 changes: 38 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,25 +9,20 @@ Now hosted on https://coverage.seattlecommunitynetwork.org/
To install this service, the fist time, you will need to:

1. Required tools and versions:
1. node
2. npm
1. Install `node` and `npm` according to the directions at https://nodejs.org/en/download/package-manager
2. Install `pm2` using: `npm install pm2 -g` (as per https://www.npmjs.com/package/pm2#installing-pm2)
2. Configure:
1. x
2. y
3. z
1. Edit `src/utils/config.ts` and set the correct URL for your API host (if you're testing or you're deploying to a new URL).
3. Deploy as below.

* What tools are needed and how are they installed?
* What configuration is needed?
* How is configuration set?


## Deploying
Once the service has been setup (as above), it can be deployed using the following process:
1. Login to the <coverage-host>
2. Pull the lastest version from github
3. Restart the server

The shell commands are:
```
ssh <coverage-host>
cd ccn-coverage-vis
Expand All @@ -43,28 +38,57 @@ When a problem occurs, there are several checks to determine where the failure i
3. Confirm nginx is operating as expected

### Checking HTTP errors in the browser
First, open your browser and go to: https://coverage.seattlecommunitynetwork.org/

Is it working?

If not, open up the browser **Web Developer Tools**, usually under the menu Tools > Developer Tools > Web Developer Tools.

With this panel open at the bottom of the screen select the **Network** tab and refresh the browser page.

Look in the first column, Status:
* 200: Ok
* 502: Error with the backend services (behind nginx)
* 500 errors: problem with nxginx. Look in `/var/log/nginx/error.log` for details.
* 400 errors: problem with the service. Check the service logs and nginx logs.
* Timeout or unreachable error: Something is broken in the network between your web browser and the coverage-vis host.


### Checking ccn-coverage-vis with pm2
Next, confirm ccn-coverage-vis is operating as expected. To do this, you will need to be able to log into the server hosting the coverage service.

Use `pm2 list` to confirm the "Vis Server" is **online**
```
ssh <coverage-host>
pm2 list
# expect "API" in the list, expect running, screenshot
```
![Online services under PM2](pm2-running-services.png "Online services under PM2")


Running? check pm2
If the "Vis Server" is not online as expected, restart it with:
```
pm2 restart Vis Server
```


### Checking nginx
If there appear problems with nginx, then check that the

Check service operation
Check service operation:
```
systemctl status nginx
```

Check nginx logs
Check nginx logs:
```
sudo tail /var/log/nginx/error.log
```

Sources of errors might include nginx configuration in `/etc/nginx/conf.d/01-ccn-coverage.conf`

If you need to restart nginx, use:
```
sudo systemctl restart nginx
```

## Testing

Expand Down
Binary file added pm2-running-services.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 64e0000

Please sign in to comment.