1
0
mirror of https://gitlab.com/comunic/comunicapiv2 synced 2024-11-22 05:19:22 +00:00

Update documentation

This commit is contained in:
Pierre HUBERT 2020-04-11 09:00:51 +02:00
parent e96633324a
commit 18dbc6fd9f

View File

@ -21,7 +21,13 @@ node_modules/.bin/webpack
6. Adapt the following command to test the server: `/usr/bin/node /home/comunic/comunicapiv2/build/index.js /home/comunic/comunicapiv2/config.private.json` 6. Adapt the following command to test the server: `/usr/bin/node /home/comunic/comunicapiv2/build/index.js /home/comunic/comunicapiv2/config.private.json`
7. Create Apache configuration, save it & restart Apache: 7. Enable required modules in Apache:
```bash
sudo a2enmod proxy_http
sudo a2enmod proxy_wstunnel
```
8. Create Apache configuration, save it & restart Apache:
```conf ```conf
<VirtualHost *:443> <VirtualHost *:443>
ServerName api.communiquons.org ServerName api.communiquons.org
@ -31,6 +37,12 @@ node_modules/.bin/webpack
ErrorLog ${APACHE_LOG_DIR}/error.log ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined CustomLog ${APACHE_LOG_DIR}/access.log combined
# Redirect user web socket
RewriteEngine On
RewriteCond %{REQUEST_URI} (.*)/ws$ [NC]
RewriteRule /ws ws://localhost:3005/ws [P,L]
ProxyPreserveHost On ProxyPreserveHost On
ProxyRequests off ProxyRequests off
AllowEncodedSlashes NoDecode AllowEncodedSlashes NoDecode
@ -43,7 +55,7 @@ node_modules/.bin/webpack
</VirtualHost> </VirtualHost>
``` ```
8. Create systemd configuration (in `/etc/systemd/system/comunic.service`): 9. Create systemd configuration (in `/etc/systemd/system/comunic.service`):
```conf ```conf
[Unit] [Unit]
Description=Comunic API Server Description=Comunic API Server
@ -70,7 +82,7 @@ HOME=/home/comunic
WantedBy=multi-user.target WantedBy=multi-user.target
``` ```
9. Enable new configuration: 10. Enable new configuration:
```bash ```bash
sudo systemctl enable comunic.service sudo systemctl enable comunic.service
sudo systemctl start comunic.service sudo systemctl start comunic.service