문서의 선택한 두 판 사이의 차이를 보여줍니다.
centos_설정 [2019/10/21 03:12] 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 | ||
- | </ | ||
- | ==== timezone ==== | ||
- | < | ||
- | [ec2-user@ip-172-31-7-180 ~]$ date | ||
- | Fri Aug 8 06:41:49 UTC 2014 | ||
- | |||
- | [ec2-user@ip-172-31-7-180 ~]$ sudo date | ||
- | Fri Aug 8 06:42:01 UTC 2014 | ||
- | |||
- | [ec2-user@ip-172-31-7-180 ~]$ sudo cat / | ||
- | TZif2UTCTZif2UTC | ||
- | UTC0 | ||
- | |||
- | [ec2-user@ip-172-31-7-180 ~]$ sudo rm / | ||
- | |||
- | [ec2-user@ip-172-31-7-180 ~]$ sudo ln -s / | ||
- | |||
- | [ec2-user@ip-172-31-7-180 ~]$ date | ||
- | Fri Aug 8 15:48:27 KST 2014 | ||
- | |||
- | [ec2-user@ip-172-31-7-180 ~]$ sudo date | ||
- | Fri Aug 8 15:48:40 KST 2014 | ||
- | </ | ||
- | 출처: https:// | ||
- | |||
- | ==== 원격설정 ==== | ||
- | === 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 개발환경 ===== | ||
- | skmob bash | ||
- | < | ||
- | |||
- | </ | ||
- | ==== 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> | ||
- | </ | ||
- | |||
- | < | ||
- | nohup jupyter lab > my.log 2>&1 & | ||
- | echo $! > save_pid.txt | ||
- | |||
- | kill -9 `cat save_pid.txt` | ||
- | rm save_pid.txt | ||
- | </ | ||
- | |||
- | < | ||
- | # | ||
- | # 파이썬 3.7 설치 | ||
- | sudo apt update | ||
- | sudo apt install software-properties-common | ||
- | sudo add-apt-repository ppa: | ||
- | sudo apt update | ||
- | sudo apt install python3.7 | ||
- | |||
- | python3.7 --version | ||
- | </ | ||
- | < | ||
- | # **/ | ||
- | alias python=python3.7 | ||
- | alias pip=pip3 | ||
- | |||
- | sudo apt install python3-pip | ||
- | sudo apt install python3.7-venv | ||
- | python -m venv venv | ||
- | source venv/ | ||
- | </ | ||
- | |||
- | 우분투 미러 | ||
- | < | ||
- | #!/bin/sh | ||
- | |||
- | SL=/ | ||
- | |||
- | PARAM=" | ||
- | |||
- | KAKAO=mirror.kakao.com | ||
- | NEOWIZ=ftp.neowiz.com | ||
- | HARU=ftp.harukasan.org | ||
- | |||
- | function | ||
- | echo " | ||
- | echo -e " | ||
- | echo " | ||
- | echo " | ||
- | echo "-k : use kakao mirror (${KAKAO})" | ||
- | echo "-n : use neowiz mirror (${NEOWIZ})" | ||
- | echo "-a : use harukasan mirror (${HARU})" | ||
- | |||
- | exit 0; | ||
- | } | ||
- | |||
- | REPOS=${KAKAO} | ||
- | |||
- | while getopts $PARAM opt; do | ||
- | case $opt in | ||
- | r) | ||
- | echo "-r option was supplied. OPTARG: $OPTARG" | ||
- | SL=$OPTARG; | ||
- | ;; | ||
- | m) | ||
- | echo "Using mirror repository(${OPTARG})." | ||
- | REPOS=${OPTARG} | ||
- | ;; | ||
- | k) | ||
- | echo "Using Kakao repository(${KAKAO})." | ||
- | REPOS=${KAKAO} | ||
- | ;; | ||
- | n) | ||
- | echo "Using neowiz repository(${NEOWIZ})." | ||
- | REPOS=${NEOWIZ} | ||
- | ;; | ||
- | a) | ||
- | echo "Using harukasan repository(${HARU})." | ||
- | REPOS=${HARU} | ||
- | ;; | ||
- | h) | ||
- | usage; | ||
- | ;; | ||
- | esac | ||
- | done | ||
- | |||
- | echo "using repository(${REPOS})" | ||
- | |||
- | ## change mirror | ||
- | sed -i.bak -re " | ||
- | |||
- | ## check | ||
- | apt update | ||
- | |||
- | </ | ||
- | http:// | ||
- | html, body 100% | ||
- | |||
- | < | ||
- | I deleted a file called " | ||
- | </ |