1.8 KiB
1.8 KiB
APPUNTI
INIZIALIZZA DB
# da fare solo la prima volta
cd pathgit; mysql < intdb.sql
INSTALLA NODE
Curl da sito ufficiale qui
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
<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"