// to Minify Javascript run: NODE_ENV=production webpack
//on server if mongo thow error run this command export LC_ALL=C mongo // to check status service mongod status/start/stop/restart
// Deployment pm2 deploy production -p [numnerOfPort]
// start
- run mongod instance: mongod
- nodemon bin/www
- open http://localhost:4000/
on server: sudo service nginx restart pm2 restart 0[number-id]
//for optimization image use: optipng 'name.png' or optipng -[o1-o6] 'name.png' jpegoptim --strip-all [name.jpg]
to generate ssl certificate:
- go to cd /opt/letsencrypt
- run ./letsencrypt-auto certonly --standalone
- to increas security sudo openssl dhparam -out /etc/ssl/certs/dhparam.pem 2048
to setup a cronjob sudo crontab -e 00 1 * * 1 /opt/letsencrypt/letsencrypt-auto renew >> /var/log/letsencrypt-renewal.log 30 1 * * 1 /bin/systemctl reload nginx
//check folder sizes du -sh /*