- https://zaat.to/feedback Your feedback is important
- https://zaat.to/DevOPS the article of which the session based on.
- https://zaat.to/session0 Session slides
chmod 400 path/file.pem
// to make the file.pem readonly
ssh -i filename.pem user@domain_NameORIpORPublic_DNS
// to ssh to the instance
sudo apt install nginx
nginx -v
// to make sure all is good, we used "1.8"
Reading Nginx access logs
cat /var/log/nginx/access.log
// can be changed in main configuration file.
Directoy of Nginx configuration.
/etc/nginx/nginx.conf
// main configuration, applies to all subsevers by default.
/etc/nginx/sites-enabled/default
// default ngnix server configuration
To edit sudo nano /path
To view cat /path
Reloading nginx after changing configuration:
sudo service nginx reload
//if you got no message back it means it's ok.
Installing node 12LTS
curl -sL https://deb.nodesource.com/setup_12.x | sudo -E bash -
sudo apt-get install -y nodejs
Installing pm2
sudo npm -g install pm2
Add proxy server in Nginx:
server{
server_name example.com
location /{
proxy_pass http://127.0.0.1:3000 #e.g. we have a localhost server running 1t port 3000
}
}
Intalling certbot
sudo snap install --classic certbot
Running certbot
sudo certbot --nginx
// we have to indicate our defualt server first time only
For Renewing licencse, adding domian names, or cnames in configuration
certbot