Ubuntu 18.04 sever version 64bit 설치
Node.js 설치
# Using Ubuntu
curl -sL https://deb.nodesource.com/setup_11.x | sudo -E bash -
sudo apt-get install -y nodejs
sudo apt-get install build-essential
Nginx php mysql 설치
sudo apt update
sudo apt install nginx
sudo apt install mysql-server
sudo mysql_secure_installation
sudo apt install php-fpm php-mysql
sudo vi /etc/nginx/sites-available/nanbean.net
sudo ln -s /etc/nginx/sites-available/nanbean.net /etc/nginx/sites-enabled/
sudo unlink /etc/nginx/sites-enabled/default
sudo nginx -t
sudo service nginx restart
FTP 설치
sudo apt-get install vsftpd
sudo vi /etc/vsftpd.conf
# enable write permission
write_enable=YES
Node.js app configuration with pm2
npm install pm2 -g
pm2 start myapp -n name
# start pm2 on boot
pm2 startup
# excute the last printed sentence
# save current process list
pm2 save
HTTPS 설정
sudo add-apt-repository ppa:certbot/certbot
sudo apt-get update
sudo apt-get install python-certbot-nginx
sudo certbot --nginx -d nanbean.net
# check auto renewal
sudo certbot renew --dry-run
crontab 설정
기타
oracle cloud
$ sudo fallocate -l 4G /swapfile
$ sudo chmod 600 /swapfile
$ sudo mkswap /swapfile
$ sudo swapon /swapfile
$ sudo vi /etc/fstab
// add below
/swapfile swap swap defaults 0 0