문서의 선택한 두 판 사이의 차이를 보여줍니다.
centos_설정 [2019/08/12 04:54] gsjung 만듦 |
centos_설정 [2021/04/13 06:54] |
||
---|---|---|---|
줄 1: | 줄 1: | ||
- | < | ||
- | ===== CentOS/ | ||
- | ==== 커널 업데이트 ==== | ||
- | [[http:// | ||
- | < | ||
- | rpm --import https:// | ||
- | rpm -Uvh http:// | ||
- | yum -y install yum-plugin-fastestmirror | ||
- | yum --enablerepo=elrepo-kernel install kernel-ml | ||
- | #after reboot | ||
- | grub2-set-default 0 | ||
- | </ | ||
- | ==== 원격설정 ==== | ||
- | === VNC === | ||
- | [[https:// | ||
- | 포트설정 방화벽해제 (영구) 5901-5910 | ||
- | < | ||
- | sudo yum install tigervnc-server | ||
- | vncserver | ||
- | vncserver -geometry 1920x1080 | ||
- | vncserver -kill :[port] | ||
- | |||
- | </ | ||
- | === Teamviewer === | ||
- | [[https:// | ||
- | < | ||
- | wget https:// | ||
- | yum install epel-release | ||
- | yum install ./ | ||
- | </ | ||
- | ==== selinux ==== | ||
- | 끄는 법 | ||
- | / | ||
- | SELINUX = disabled | ||
- | \\ | ||
- | [[http:// | ||
- | ==== nginx 설정 ==== | ||
- | === Certbot cron === | ||
- | < | ||
- | 43 6 * * * certbot renew --post-hook " | ||
- | </ | ||
- | ==== Proxy ==== | ||
- | === Resilio Sync === | ||
- | < | ||
- | #/ | ||
- | |||
- | location /btsync/ { | ||
- | | ||
- | | ||
- | | ||
- | | ||
- | | ||
- | | ||
- | } | ||
- | |||
- | location /gui/ { | ||
- | proxy_pass http:// | ||
- | proxy_buffering off; | ||
- | proxy_set_header Host $host; | ||
- | proxy_set_header X-Real-IP $remote_addr; | ||
- | } | ||
- | </ | ||
- | |||
- | setsebool httpd_can_network_connect 1 -P | ||
- | === ngnix rewriting === | ||
- | < | ||
- | location | ||
- | rewrite /foo/(.*) /$1 break; | ||
- | proxy_pass | ||
- | proxy_redirect | ||
- | proxy_set_header | ||
- | } | ||
- | </ | ||
- | For Jupyter [[https:// | ||
- | < | ||
- | # nginx config in server | ||
- | location /jupyter/ { | ||
- | proxy_pass http:// | ||
- | |||
- | proxy_set_header X-Real-IP $remote_addr; | ||
- | proxy_set_header Host $host; | ||
- | proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | ||
- | |||
- | proxy_set_header Origin ""; | ||
- | } | ||
- | |||
- | location ~* / | ||
- | proxy_pass http:// | ||
- | |||
- | proxy_set_header X-Real-IP $remote_addr; | ||
- | proxy_set_header Host $host; | ||
- | proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | ||
- | |||
- | proxy_http_version 1.1; | ||
- | proxy_set_header Upgrade $http_upgrade; | ||
- | proxy_set_header Connection " | ||
- | proxy_set_header Origin ""; | ||
- | } | ||
- | </ | ||
- | < | ||
- | #full nginx.conf | ||
- | user www-data; | ||
- | worker_processes auto; | ||
- | pid / | ||
- | |||
- | ## based on https:// | ||
- | |||
- | events { | ||
- | worker_connections | ||
- | } | ||
- | |||
- | http { | ||
- | |||
- | include / | ||
- | default_type application/ | ||
- | |||
- | map $http_upgrade $connection_upgrade { | ||
- | default upgrade; | ||
- | '' | ||
- | } | ||
- | |||
- | upstream jupyter { | ||
- | server localhost: | ||
- | } | ||
- | |||
- | |||
- | server { | ||
- | listen 80; | ||
- | server_name hands.art.cfa.cmu.edu; | ||
- | rewrite | ||
- | } | ||
- | |||
- | server { | ||
- | listen 443; | ||
- | |||
- | client_max_body_size 50M; | ||
- | server_name hands.art.cfa.cmu.edu; | ||
- | |||
- | ssl on; | ||
- | ssl_certificate / | ||
- | ssl_certificate_key / | ||
- | |||
- | ssl_ciphers " | ||
- | ssl_protocols TLSv1 TLSv1.1 TLSv1.2; | ||
- | ssl_prefer_server_ciphers on; | ||
- | ssl_session_cache shared: | ||
- | add_header Strict-Transport-Security " | ||
- | add_header X-Content-Type-Options nosniff; | ||
- | ssl_stapling on; # Requires nginx >= 1.3.7 | ||
- | ssl_stapling_verify on; # Requires nginx => 1.3.7 | ||
- | resolver_timeout 5s; | ||
- | |||
- | location / { | ||
- | proxy_pass http:// | ||
- | |||
- | proxy_set_header X-Real-IP $remote_addr; | ||
- | proxy_set_header Host $host; | ||
- | proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | ||
- | } | ||
- | | ||
- | proxy_pass http:// | ||
- | |||
- | proxy_set_header X-Real-IP $remote_addr; | ||
- | proxy_set_header Host $host; | ||
- | proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | ||
- | # WebSocket support | ||
- | proxy_http_version 1.1; | ||
- | proxy_set_header Upgrade $http_upgrade; | ||
- | proxy_set_header Connection $connection_upgrade; | ||
- | |||
- | } | ||
- | } | ||
- | } | ||
- | |||
- | </ | ||
- | < | ||
- | #jupyter settings | ||
- | c.NotebookApp.allow_origin = ' | ||
- | c.NotebookApp.base_url = '/ | ||
- | c.NotebookApp.open_browser = False | ||
- | c.NotebookApp.password = ' | ||
- | c.NotebookApp.port = 8888 | ||
- | c.NotebookApp.trust_xheaders = True | ||
- | </ | ||
- | === php setting === | ||
- | php conf 안에서\\ | ||
- | user, group | ||
- | listen --> 소켓으로 | ||
- | ==== https 설정 ===== | ||
- | https:// | ||
- | |||
- | Renewal | ||
- | < | ||
- | certbot renew --dry-run | ||
- | certbot renew | ||
- | </ | ||
- | ===== Remote 환경 (Windows 등) ===== | ||
- | ==== 배경색 ==== | ||
- | https:// | ||
- | 47, 79, 79 | ||
- | ===== Python 개발환경 ===== | ||
- | ==== Python 3.6버전 ==== | ||
- | < | ||
- | yum install -y https:// | ||
- | yum search python3 | ||
- | |||
- | yum install -y python36u python36u-devel python36u-libs python36u-pip | ||
- | </ | ||
- | ==== Jupyter ==== | ||
- | < | ||
- | #run | ||
- | nohup jupyter notebook & | ||
- | #kill | ||
- | lsof nohup.out | ||
- | kill -9 <PID> | ||
- | </ |