아래는 클라우드를 설정하기 위해 알아야 될 필독 사항이다.
또한 도메인 (예: www.domain.com)을 샀을 때, 어떻게 Let's Encrypt를 활용하여 무료 SSL을 설정하고,
또한 포트를 내부에서는 3001번을 쓰도록 하여 보안문제를 강화했는지에 대한 내용도 포함한다.
sudo apt update
adduser smhan
sudo usermod -a -G sudo smhan
sudo fdisk -l
디스크 확인 (연결한 디스크가 있을 때만)
mkfs.ext4 /dev/xvdb
Miniconda install
wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh (miniconda 설치)
Installation SSL
sudo apt install certbot python3-certbot-nginx
sudo certbot --nginx -d domain.com
sudo certbot renew --dry-run
Install Nginx
sudo apt install nginx -y
sudo systemctl start nginx
sudo systemctl enable nginx
sudo systemctl status nginx
Setup Nginx config
cd /etc/nginx/sites-available
sudo vim /etc/nginx/sites-available/domain.com
sudo ln -s /etc/nginx/sites-available/domain.com /etc/nginx/sites-enabled/
sudo nginx -t
sudo systemctl restart nginx
sudo systemctl enable nginx
sudo systemctl status nginx
Install jupyter and config
jupyter notebook --generate-config
jupyter notebook password
:/etc/letsencrypt/live/domain.com
server {
server_name domain.com;
location / {
proxy_pass http://127.0.0.1:3001;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
}
error_log /var/log/nginx/domain-error.log;
access_log /var/log/nginx/domain-access.log;
listen 443 ssl; # managed by Certbot
ssl_certificate /etc/letsencrypt/live/domain.com/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/domain.com/privkey.pem; # managed by Certbot
include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot
}
server {
if ($host = domain.com) {
return 301 https://$host$request_uri;
} # managed by Certbot
listen 80;
server_name domain.com;
return 404; # managed by Certbot
}
# Set options for certfile, ip, password, and toggle off
# browser auto-opening
c.NotebookApp.certfile = u'/absolute/path/to/your/certificate/mycert.pem'
c.NotebookApp.keyfile = u'/absolute/path/to/your/certificate/mykey.key'
# Set ip to '*' to bind on all interfaces (ips) for the public server
c.NotebookApp.ip = '*'
c.NotebookApp.password = u'sha1:bcd259ccf...<your hashed password here>'
c.NotebookApp.open_browser = False
c.ServerApp.root_dir = ‘/mnt/disk’
# It is a good idea to set a known, fixed port for server access
c.NotebookApp.port = 9999
위 설정이 완료되면, CursorAI에게는 "3001번 포트로 실행" 하는 서버를 제작하거나 실행 해 달라고 하면 된다.