This commit is contained in:
scossa 2024-11-24 14:43:46 +01:00
parent e88741331b
commit 51c9457a58

View file

@ -149,7 +149,7 @@ Commit a casa di cek [[commit 89019f168c](https://git.lattuga.net/RuscoMap/rusco
## Installazione dipendenze
#### Installa mariadb e jq
#### Installa mariadb, jq e npm
<code>sudo apt update && sudo apt install mariadb jq npm</code>
#### Clona il git
@ -189,7 +189,7 @@ mysql < initDb.sql
<code>nano /var/www/html/leaflet/ruscomap/server/config/default.json</code>
#### Apri porta sul firewall
<code>sudo iptables -A INPUT -p tcp --dport 3232 -j ACCEPT</code>
<code>sudo iptables -A INPUT -p tcp --dport 3000 -j ACCEPT</code>
#### Cre l'utente
sudo adduser ruscone
@ -241,19 +241,18 @@ sudo systemctl status ruscomap.service
#PORT 80
<VirtualHost ruscomap.myserver:80>
DocumentRoot /var/www/html/leaflet/ruscomap/public
ServerName ruscomap.myserver
DocumentRoot /var/www/html/leaflet/ruscomap/public
ProxyPass / http://localhost:3232/
ProxyPassReverse / http://localhost:3232/
ProxyPass / http://127.0.0.1:3000/
ProxyPassReverse / http://127.0.0.0.1:3000/
RewriteEngine on
RewriteCond %{HTTP:Upgrade} =websocket
RewriteRule /(.*) ws://localhost:3232/$1 [P,L]
#RewriteCond %{HTTP:Upgrade} =websocket
#RewriteRule /(.*) ws://localhost:3000/$1 [P,L]
RewriteCond %{SERVER_NAME} =ruscomap.myserver
RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]
</VirtualHost>
```
@ -276,34 +275,32 @@ RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]
</VirtualHost>
#443
<VirtualHost _default_:443>
DocumentRoot /var/www/html/leaflet/ruscomap/public
ServerName ruscomap.myserver
Protocols h2 http/2
#Protocols h2 http/2
ProxyPass / http://localhost:3000/
ProxyPassReverse / http://localhost:3000/
RewriteEngine on
RewriteCond %{HTTP:Upgrade} =websocket
RewriteRule /(.*) ws://localhost:3000/$1 [P,L]
#RewriteCond %{HTTP:Upgrade} =websocket
#RewriteRule /(.*) ws://localhost:3000/$1 [P,L]
LogFormat "%t %h \"%r\" %>s \"%{User-Agent}i\"" custom
ErrorLog ${APACHE_LOG_DIR}/ruscomap.log
CustomLog ${APACHE_LOG_DIR}/ruscomap-access.log custom
SSLEngine on
SSLCertificateFile /etc/letsencrypt/live/ruscomap.myserver/fullchain.pem
SSLCertificateKeyFile /etc/letsencrypt/live/ruscomap.myserver/privkey.pem
SSLCertificateKeyFile /etc/letsencrypt/live/ruscomap.amyserver/privkey.pem
# HSTS una settimana, per settare un anno: max-age=31536000
Header always set Strict-Transport-Security "max-age=31536000; includeSubDomains"
# HSTS una settimana 604800, per settare un anno: max-age=31536000
#Header always set Strict-Transport-Security "max-age=1,; includeSubDomain>
</VirtualHost>
```
##### restarta apache
```