diff --git a/appunti.md b/appunti.md new file mode 100644 index 0000000..e846b9e --- /dev/null +++ b/appunti.md @@ -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)
+_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 etc/systemsystem/ + +``` +[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 + + +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 + + +``` + +## 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" +``` \ No newline at end of file diff --git a/appunti.txt b/appunti.txt deleted file mode 100644 index 5887e0d..0000000 --- a/appunti.txt +++ /dev/null @@ -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'; \ No newline at end of file