Skip to content

Instantly share code, notes, and snippets.

@beebase
Forked from derhuerst/.init-letsencrypt
Created June 6, 2018 11:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save beebase/f3dbfea2a3bfa9c0f4f7d918e841033c to your computer and use it in GitHub Desktop.
Save beebase/f3dbfea2a3bfa9c0f4f7d918e841033c to your computer and use it in GitHub Desktop.
OVH VPS setup
server {
listen 80;
listen [::]:80;
server_name example.org;
root /var/www/example.org;
location / {
try_files $uri $uri/ =404;
}
# return 301 https://$server_name$request_uri;
}
#server {
# listen 443 ssl;
# listen [::]:443;
# server_name example.org;
# ssl_certificate /etc/letsencrypt/live/example.org/fullchain.pem;
# ssl_certificate_key /etc/letsencrypt/live/example.org/privkey.pem;
# root /var/www/example.org;
# location / {
# proxy_pass http://localhost:3001;
# }
# location /.well-known {
# try_files $uri $uri/ =404;
# }
#}
ssh -o PreferredAuthentications=password -o PubkeyAuthentication=no root@<host>
# in SSH shell
passwd
nano /etc/ssh/sshd_config
# enable authorized_keys file
apt update && apt upgrade -y && apt install -y htop tree mosh nginx make g++
curl -sL https://deb.nodesource.com/setup_9.x | sudo -E bash -
apt install -y nodejs software-properties-common
add-apt-repository ppa:certbot/certbot
apt update && apt install -y python-certbot-nginx
reboot && exit
# exit SSH shell
ssh-copy-id -i ~/.ssh/<private-key> -o PreferredAuthentications=password -o PubkeyAuthentication=no root@<host>
ssh root@<host>
# in SSH shell
npm i -g npm@latest forever
# later, per domain
certbot certonly --webroot -w /var/www/example.org -d example.org
nano /etc/nginx/nginx.conf
# uncomment `gzip_types text/plain ...`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment