라벨이 ubuntu인 게시물 표시

아마존 클라우드, 우분투 터미널에서 한글 사용

$ locale $ sudo apt-get install language-pack-ko $ sudo locale-gen ko_KR.UTF-8 $ sudo dpkg-reconfigure locales $ vi /etc/default/locale — LANG="ko_KR.UTF-8” LANGUAGE="ko_KR:ko:en_US:en” —

ubuntu,모든 uwsgi 프로세스 죽이기

sudo pkill -f uwsgi -9

구름IDE 무료계정으로 Python, Flask+UWSGI+Supervisor, MySQL 연동하기 (1)

1. 구름 IDE 무료계정 가입 2. '새 컨테이너 생성' - 소스: 템플릿 - 이름: 마음에 드는 이름으로 - 설명: 비워도 됨 - 소프트웨어 스택 선택: Python -> Pyton 프로젝트 3. 생성하기 4. 생성된 컨테이너 '실행' 버튼 클릭 5. IDE 페이지로 이동 6. 왼쪽 상단 (+) '서브 프로젝트 추가' 버튼 클릭 7. 서브 프로젝트 이름을 'service_flask'로 입력 8. IDE 브라우저 맨 상단의 '창' > '새 터미널 창' 선택 9. 프로젝트 루트 폴더 이동 -> $ cd /workspace 명령어 입력. 10. 깃허브 소스 복사 -> $ git clone https://github.com/gyunseul9/service_flask.git 11. 독립적 가상의 파이썬 실행환경 만들기 -> $ pip3 install virtualenv 12. 독립적 가상의 파이썬 실행환경 만들기 -> $ virtualenv service_flask 13.  프로젝트 폴더 이동 -> $ cd service_flask 14. 가상환경으로 접근 -> $ . bin/activate 15. 플러그인 설치 -> $ pip3 install flask, mixpanel, pymysql, newrelic, uwsgi 16. 프로세스 모니터링 관리 프로그램 설치 -> $ apt-get install supervisor * 구름IDE 무료계정으로 Python, Flask+UWSGI+Supervisor, MySQL 연동하기 (2) 에서 계속.

ubuntu, goormide nginx+uwsgi

$ vi app.py --- app.run('0.0.0.0',5000,debug=True) --- $ sudo -i $ service nginx stop $ service uwsgi stop $ vi /etc/nginx/sites-available/default --- server { ## listen 80 default_server; ## listen [::]:80 default_server ipv6only=on; listen 5000; root /usr/share/nginx/html; index index.html index.htm; # Make site accessible from http://localhost/ ## server_name localhost; server_name 0.0.0.0; location / { # First attempt to serve request as file, then # as directory, then fall back to displaying a 404. ##try_files $uri $uri/ =404; try_files $uri @app; # Uncomment to enable naxsi on this location # include /etc/nginx/naxsi.rules } location @app { include uwsgi_params; uwsgi_pass unix:/tmp/uwsgi.sock; } } --- $ vi /etc/uwsgi/apps-available/uwsgi.ini --- [uw...

ubuntu, supervisor 설치 및 설정

$ supervisord --version $ sudo apt-get remove supervisor $ easy_install supervisor (apt-get install supervisor) $ python  setup.py  install $ supervisord --version $ sudo service supervisor start $ sudo apt-get install supervisor $ sudo supervisorctl start web $ sudo supervisord -c /etc/supervisor/supervisord.conf $ sudo supervisorctl -c /etc/supervisor/supervisord.conf $ sudo supervisorctl reread $ sudo supervisorctl update $ sudo supervisorctl start all $ ps -ef | grep supervisord $ kill -s SIGTERM 2503 $ watch -n 1 'ps -ef | grep python | grep -v grep'

ubuntu, reinstall apache2

$ sudo apt-get -o DPkg::Options::="--force-confmiss" --reinstall install apache2 $ sudo apt-get purge apache2 $ sudo apt-get install apache2 $ netstat -ntlp | grep apache2

macOS, ubuntu 설치

1. 부팅이미지 다운로드 및 설치 http://refit.sourceforge.net/#download 2. 부팅이미지 등록 명령어 $ sudo sh / efi/refit/enable-aways.sh 3.우분투 이미지 usb 삽입 4. 재부팅 후 command + R 5. Boot EFI \boot\gubx64.efi from 선택 6. Install ubuntu 선택

command, ubuntu, crontab nano를 vim으로 변경

$cd /bin $ mv nano nano_must_die $ ln -s /usr/bin/vim nano

command, ubuntu, ssh서버설치

$ dpkg -l $ dpkg -l |grep ssh $ sudo apt-get install openssh-server $ netstat -ntl $ sudo /etc/init.d/ssh restart $ sudo vi /etc/ssh/sshd_config --- #Port 22 -> Port 22 ---

Docker Ubuntu+NGINX+uWSGI+flask

$ docker run -p 8080:8080 -it --name flask -v /home/docks/flask:/var/www/html ubuntu # apt-get update # apt-get upgrade # apt-get install vim # apt-get install net-tools # apt-get install nginx # Nginx # apt-get install uwsgi # uWSGI # apt-get install uwsgi-plugin-python # python과 uWSGI를 연결하는 플러그인 # apt-get install python3 # apt-get install python3-pip python3-dev # pip3 install -U pip # pip3 install virtualenv # cd /var/www/html # virtualenv service # cd service # . bin/activate # pip3 install flask # pip3 install uwsgi # cd /var/www/html/service # vi app.py --- from flask import Flask app = Flask(__name__) @app.route('/') def hello_world(): return 'Hello World!' if __name__ == '__main__': app.run() --- # vi /etc/nginx/sites-available/default --- server { listen 8080; # 연결할 포트 server_name 0.0.0.0; location / { try_files $uri @app; } location @app { include uwsgi_params; uwsgi_pass unix:/tmp/uwsgi.sock; } } --- # vi /etc/uwsgi/ap...