-
-
Save beebase/f3dbfea2a3bfa9c0f4f7d918e841033c to your computer and use it in GitHub Desktop.
OVH VPS setup
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | |
# } | |
#} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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