맥을 기준으로 한 설치 및 설정입니다.

1.마인크래프트설치
-http://minecraft.net 에서 구입하여 설치합니다.

2.파이썬 3.5.6 설치 및 설정
-brew설치
$ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)”
-파이썬 설치 및 확인
$ brew install python3
$ python3 —version

3.JDK SE설치
-http://www.oracle.com/technetwork/java/javase/downloads/index.html 접속 후 1.8 이상 다운로드 및 설치
-자바 설치 확인
$ java -version

4.마인크래프트 파이썬 API, SPYGOT 설치
-https://nostarch.com/programwithminecraft 접속
-Download the setup files for Mac OS (Minecraft Tools Mac.zip) 다운로드 및 압축풀기
-Install_API.command 설치
$ ./Install_API.command
-server 폴더 이동 후 서버 실행
$ ./start.command


크레이그 리처드슨 저, ‘Learn to Program with Minecraft: Transform Your World with the Power of Python’ 원서 및 번역서를 기반으로 한 포스팅 게시물임을 알려드립니다.


https://play.google.com/store/apps/details?id=vdream.vd.com.vdream

Posted by 앤비
,

$ /workspace/service_flask/run.sh

ctrl + c

$ service mysql restart
$ service nginx restart
$ service supervisor restart

$ supervisorclt

URL 브라우저에서 실행 -> http://gyunseul10-smmpt.run.goorm.io

Posted by 앤비
,

$ apt-get update
$ apt-get install mysql-server

 

$ mysql -uroot -p

 

use mysql;
create database dbname default character set utf8;
grant all privileges on dbname* to userid@localhost identified by 'password';
flush privileges;
quit;

create table status_log (
seq int(11) not null auto_increment,

status varchar(50) not null,

name varchar(50) not null,
primary key(seq)
)charset=utf8;

insert into status_log(status,name) values('check','gyunseul9');

 

 

$ cd /workspacce

 

$ mkdir env

$ cd ..

$ mkdir log

$ cd log

$ mkdir uwsgi

$ vi ./env/uwsgi_servie.ini
---
[uwsgi]
chdir=/home/service/service_flask
chmod-socket=666
callable=app
module=api
socket=/tmp/uwsgi_service.sock
virtualenv=/workspace/service_flask

master=true
processes=5
max-requests=1000
harakiri=10
lazy-apps=true
logto=/workspace/service_flask/log/uwsgi/uwsgi_service.log
enable-threads = true
---

 

$ cd /workspace

$ chmod +x run.sh



$ vi /etc/nginx/sites-available/default
---
server {
listen 80;

server_name 0.0.0.0;

location / {
try_files $uri @app;
}
location @ap {
include uwsgi_params;
uwsgi_pass unix:/tmp/service_api.sock;
}
}
---

 

$ vi /etc/supervisor/conf.d/service.conf
---
[program:service]
command=/workspace/service_flask/run.sh
environment=HOME='/workspace',USER='root'
directory=/workspace/service_flask
autostart=true
autorestart=true
startretries=3
---

Posted by 앤비
,