This commit is contained in:
scossa 2024-08-18 00:20:40 +02:00
parent 8ac3b98d3a
commit 4264948355
2 changed files with 92 additions and 8 deletions

92
appunti.md Normal file
View file

@ -0,0 +1,92 @@
# APPUNTI
## INIZIALIZZA DB
```
# da fare solo la prima volta
cd pathgit; mysql < intdb.sql
```
## INSTALLA NODE
Curl da sito ufficiale [qui](https://github.com/nvm-sh/nvm?tab=readme-ov-file#install--update-script) <br>
_trobleshooting: cerca nvm in .bashrc_
```
#usa la versione spcificata nel file .nvmrc
cd pathgit; nvm use (e legge in .nvmrc)
```
## CANCELLA UN RECORD DEL DB
```
mariadb -u ruscone -p
show databases;
use ruscomap;
show tables;
select * from markers;
DELETE FROM markers WHERE filename = '0a9f02167f85c845db2d4b81bbeef9d5';
```
## SERVIZIO ruscomap.service
Dentro a <code>etc/systemsystem/</code>
```
[Unit]
Description=Ruscomap Service
After=network.target
[Service]
User=
WorkingDirectory=/var/www/html/leaflet/ruscomap/
ExecStart=/bin/bash -c "node index.js"
Restart=always
RestartSec=5
[Install]
WantedBy=multi-user.target
```
## APACHE CONF
```
#PORT 80 RUSCOMAP
<VirtualHost ruscomap.accol.li:80>
DocumentRoot /var/www/html/leaflet/ruscomap/public
ServerName ruscomap.accol.li
ProxyPass / http://localhost:3000/
ProxyPassReverse / http://localhost:3000/
RewriteEngine on
RewriteCond %{HTTP:Upgrade} =websocket
RewriteRule /(.*) ws://localhost:3000/$1 [P,L]
#Redirect permanent / https://pad.accol.li/
ErrorLog ${APACHE_LOG_DIR}/ruscomap.log
CustomLog ${APACHE_LOG_DIR}/ruscomap-access.log combined
</VirtualHost>
```
## Script AggiornaRuscoGit.sh
```
echo -e "Stoppo ruscomap..."
systemctl stop ruscomap.service
sleep 1
cd /var/www/html/leaflet/ruscomap
echo -e "\nEseguo git pull..."
git pull
sleep 1
echo -e "Do permessi www-data..."
chown -R www-data:www-data /var/www/html/leaflet/ruscomap/public
echo -e "restarto apache e ruscmap"...
systemctl restart apache2.service
systemctl start ruscomap.service
echo -e "Aggiornamento completato!\n"
```

View file

@ -1,8 +0,0 @@
## CANCELLA UN RECORD DEL DB
mariadb -u ruscone -p
show databases;
use ruscomap;
show tables;
select * from markers;
DELETE FROM markers WHERE filename = '0a9f02167f85c845db2d4b81bbeef9d5';