๋ฐ˜์‘ํ˜•

์–ด๋Š๋‚  ๋ฏธ๋‹ˆPC์„ ๊ตฌ์ž…ํ•˜์˜€๋‹ค. (?)

์ œํ’ˆ์€ [๋ ˆ๋…ธ๋ฒ„ M710Q] ์ด๊ฑฐ๋‹ค.
(๋ชจ๋‹ˆํ„ฐ ์—ฐ๊ฒฐ์„ ์œ„ํ•ด DP to DP ์–‘๋ฐฉํ–ฅ ์ผ€์ด๋ธ” ๋ฐ usb ํฌํŠธ ์ง€์› ๋งˆ์šฐ์Šค๋„ ๊ฐ™์ด ๊ตฌ๋งค ใ…Ž.. ํ‚ค๋ณด๋“œ๋Š” ์ด๋ฏธ ์žˆ๊ณ ..)


ํ•ด๋‹น PC ์—๋Š” ์ด๋ฏธ ์œˆ๋„์šฐ๊ฐ€ ์„ค์น˜๋˜์–ด ์žˆ์—ˆ๋‹ค. 
๊ทธ๋Ÿฌ๋‚˜ ๋‚˜๋Š” ์œˆ๋„์šฐ๋ฅผ ์ง€์šฐ์ง€ ์•Š๊ณ  ๋ฆฌ๋ˆ…์Šค(์šฐ๋ถ„ํˆฌ!)๋ฅผ ๊ฐ™์ด ์„ค์น˜ํ•˜์—ฌ ๋ฉ€ํ‹ฐ๋ถ€ํŒ…์„ ํ•˜๊ณ  ์‹ถ์—ˆ๋‹ค.
(๋‚˜์ค‘์— ๊ฐœ์ธ์ ์ธ ์šฉ๋ฌด๋กœ ์ธํ•œ? ์œˆ๋„์šฐ ํ™˜๊ฒฝ์œผ๋กœ ๋ญ”๊ฐ€ ์ž‘์—…์ด ํ•„์š”ํ• ์ˆ˜ ์žˆ์„์ˆ˜๋„์žˆ์ง€ ์•Š์„๊นŒ ํ•˜์—ฌ?)

 


โ˜… ๋ฉ€ํ‹ฐ๋ถ€ํŒ…์„ ํ•˜๊ธฐ ์œ„ํ•œ ์ค€๋น„

1) ์šฐ๋ถ„ํˆฌ๋ฅผ ์„ค์น˜ํ•˜๊ธฐ ์œ„ํ•ด ์ง‘์— ๋Œ์•„๋‹ค๋‹ˆ๋˜ usb์„ ์ฐพ์•˜๊ณ  ํฌ๋งทํ–ˆ๋‹ค.
(๋Œ€์ถฉ ์ด๋Ÿฐ์‹..https://www.samsungsvc.co.kr/solution/40474)

2) ๋ถ€ํŒ…๋””์Šคํฌ๋ฅผ ๋งŒ๋“ค์—ˆ๋‹ค.
์šฐ๋ถ„ํˆฌ ์‚ฌ์ดํŠธ๋ฅผ ๊ฐ€์„œ osi ํŒŒ์ผ์„ PC์— ๋‹ค์šด๋ฐ›๊ณ , Refus ๋ผ๋Š” ํ”„๋กœ๊ทธ๋žจ์„ ์„ค์น˜ํ•˜์—ฌ ๋ถ€ํŒ…๋””์Šคํฌ ๋งŒ๋“œ๋Š” ์ž‘์—…์„ ์ง„ํ–‰ํ–ˆ๋‹ค. 
(https://amkorousagi-money.tistory.com/entry/%EC%9A%B0%EB%B6%84%ED%88%AC-%EB%B6%80%ED%8C%85-usb-%EB%A7%8C%EB%93%A4%EA%B8%B0-%EC%9A%B0%EB%B6%84%ED%88%AC-%EC%84%A4%EC%B9%98 ์„ ์ฐธ๊ณ ํ–ˆ๋‹ค)

Ubuntu 24.04.1 ๋ฒ„์ „ + GUI ๊ธฐ๋Šฅ์ด ์ถ”๊ฐ€๋œ Desktop image ์„ ๋‹ค์šด๋ฐ›์Œ ใ…Ž..

 

3) ์œˆ๋„์šฐ ํ•˜๋“œ๋””์Šคํฌ ํŒŒํ‹ฐ์…˜ ๋ถ„ํ• ์„ ์ง„ํ–‰ํ–ˆ๋‹ค. ์ด์œ ๋Š” ์ถ”ํ›„ ์šฐ๋ถ„ํˆฌ๋ฅผ ์œ„ํ•œ ๊ณต๊ฐ„์„ ํ• ๋‹นํ•˜๊ธฐ ์œ„ํ•จ!
(๋Œ€์ถฉ ์ด๋Ÿฐ์‹..https://www.samsungsvc.co.kr/solution/25065)

4) ๋ฏธ๋‹ˆPC์— ๋ถ€ํŒ…๋””์ŠคํฌUSB์„ ๊ผฝ์•„๋†“๊ณ !!!! ์žฌ๋ถ€ํŒ…์„ ํ–ˆ๋‹ค.
๋ถ€ํŒ… ํ™”๋ฉด์ด ๋–ณ์„๋•Œ ๋ถ€ํŠธ ๋””๋ฐ”์ด์Šค ์„ ํƒ ํ™”๋ฉด์œผ๋กœ ์ด๋™ํ•˜๋„๋ก F12์„ ๊ฒ€๋‚˜๊ฒŒ ๋ˆŒ๋ €๋‹ค. (์ด๊ฒŒ PC ๊ธฐ๊ธฐ ๋ณ„๋กœ ์‚ด์ง ๋‹ค๋ฅธ๋“ฏ ํ–ˆ๋‹ค.)

USB ์„ ์„ ํƒ! ์—”ํ„ฐ!

 

5) ์šฐ๋ถ„ํˆฌ ์„ค์น˜ ์‹œ์ž‘!

...์ญ‰์ญ‰

์•„๊นŒ ์œˆ๋„์šฐ ํ•˜๋“œ๋””์Šคํฌ ํŒŒํ‹ฐ์…˜ ๋‚˜๋ˆด๋˜๊ฑธ ๊ธฐ์–ต!ํ•˜์—ฌ ์ˆ˜๋™ ํŒŒํ‹ฐ์…”๋‹์œผ๋กœ ์„ ํƒ!

์ญ‰์ญ‰...๊ณ„์ • ์„ค์ •๊นŒ์ง€ ํ•˜๋ฉด ์šฐ๋ถ„ํˆฌ ์„ค์น˜ ๋!

6) ๋ฏธ๋‹ˆPC์—์„œ USB ์ œ๊ฑฐ ๋ฐ ์žฌ์‹คํ–‰์‹œ F12์„ ๋ˆŒ๋Ÿฌ OS์„ ์„ ํƒ ๋ฐ ์‹คํ–‰ํ•˜๋„๋กํ•จ!


 

๋ฐ˜์‘ํ˜•
๋ฐ˜์‘ํ˜•

# node.js๋ฅผ ์‚ฌ์šฉํ•˜๊ธฐ ์œ„ํ•ด์„œ๋Š”, ์‚ฌ์šฉํ•˜๊ธฐ ์œ„ํ•œ ํ™˜๊ฒฝ ์…‹ํŒ…์ด ํ•„์š”ํ•˜๋‹ค.


- nginx, node.js, mongodb ์„ค์น˜ ์ˆœ์ด๋‹ค.

- nginx๋Š” ์›น์„œ๋ฒ„๋‹ค. 

- nginx๋Š” ๋ฆฌ๋ฒ„์Šค ํ”„๋ก์‹œ ํ™œ์šฉ์ด ๊ฐ€๋Šฅํ•˜๋‹ค. ๋ณดํ†ต์€ ์ค‘๊ฐ„ ๋ผ์šฐํ„ฐ ์—ญํ• ๋กœ ๋งŽ์ด ์‚ฌ์šฉํ•˜๋Š” ๋“ฏ ํ•˜๋‹ค.

- node.js๋Š” ecmascript ๊ธฐ๋ฐ˜ ์–ธ์–ด๋ฅผ ๊ฐ€์ง€๊ณ  ์„œ๋ฒ„๋‹จ์—์„œ ์‚ฌ์šฉํ•  ์ˆ˜ ์žˆ๋„๋ก ํ•œ ํ”Œ๋žซํผ(์™„์ „์ฒด?)์ด๋‹ค.

- node.js๋Š” v8์—”์ง„ ์œ„์—์„œ ๋™์ž‘ํ•œ๋‹ค. (v8์—”์ง„์€ c++๋กœ ๋˜์–ด์žˆ๋‹ค๊ณ  ํ•œ๋‹ด...)

- mongodb๋Š” ๋ฐ์ดํ„ฐ๋ฅผ ์ €์žฅํ•˜์—ฌ ์‚ฌ์šฉํ•˜๊ธฐ ์œ„ํ•œ ์šฉ๋„์ด๋‹ค.

- nginx, node.js, mongodb๋ฅผ ์‚ฌ์šฉํ•˜๊ธฐ ์œ„ํ•œ ํ™˜๊ฒฝ์œผ๋กœ ๋ฆฌ๋ˆ…์Šค ubuntu ์šด์˜์ฒด์ œ๋ฅผ ์„ ํƒํ•˜์˜€๋‹ค.



[0] apt-get ์ตœ์‹ ๋ฒ„์ „ ์—…๋ฐ์ดํŠธ 

 (#apt-get? ์šฐ๋ถ„ํˆฌ, ๋ฐ๋น„์•ˆ ๊ณ„์—ด์˜ ํŒจํ‚ค์ง€ ๊ด€๋ฆฌ ๋ช…๋ น์–ด ๋„๊ตฌ๋ผ๊ณ ํ•จ.  yum์€ ๋ ˆ๋“œํ–‡ ๊ณ„์—ด์—์„œ..)


$ sudo apt-get update


[1] nginx

1) [๋ณดํ†ต ์„ค์น˜] ์„ค์น˜ : sudo apt-get install nginx


* ๋ฒ„์ „ํ™•์ธ : nginx -v


1-1) [**๊ผญ ์•ˆํ•ด๋„ ๋จ] ์ปดํŒŒ์ผ ๋ฐฉ์‹์œผ๋กœ ์„ค์น˜ (์••์ถ•ํŒŒ์ผ์„ ๋ฐ›์•„ ํ’€์–ด์„œ ์ปดํŒŒ์ผ ํ•˜์—ฌ ์„ค์น˜ํ•˜๋Š”๋ฒ•)

 - ์ด๊ฑด ์•ˆํ•ด๋„ ๋˜๋Š” ๋ฒ•์ด๊ธดํ•œ๋ฐ, ๋‚˜์˜๊ฒฝ์šฐ๋Š” nginx echo๋ชจ๋“ˆ์„ ์‚ฌ์šฉํ•˜๊ณ  ์‹ถ์–ด์„œ ์ด๋ฐฉ๋ฒ•์œผ๋กœ ์„ค์น˜๋ฅผ ์‹œ๋„ํ–ˆ๋‹ค.

 - echo ๋ชจ๋“ˆ ์žˆ์œผ๋ฉด nginx ํ•จ์ˆ˜ ๋‚ด์—์„œ ํ˜ธ์ถœ์—ฌ๋ถ€ ํ™•์ธ์ด ๊ฐ€๋Šฅํ•˜๋‹ค.

 http://astinchoi.github.io/2018/02/01/nginx_install_with_echo_nginx_module.html

 ์œ„์˜ ๋งํฌ๋ฅผ ์‘์šฉํ–ˆ๊ณ , 


 ๋‚˜๋Š” ์ด๋ ‡๊ฒŒ ํ–ˆ๋‹ค.

 $ apt-get install gcc, unzip, make, g++


 $ wget http://nginx.org/download/nginx-1.12.2.tar.gz

 $ tar -xvzf nginx-1.12.2.tar.gz

 $ wget https://github.com/openresty/echo-nginx-module/archive/v0.61.zip

 $ unzip v0.61.zip

 $ wget ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.42.tar.gz

 $ tar -zxf pcre-8.42.tar.gz

 $ wget http://www.openssl.org/source/openssl-1.0.2p.tar.gz

 $ tar -zxf openssl-1.0.2p.tar.gz

 $ wget https://github.com/arut/nginx-rtmp-module/archive/master.zip

 $ unzip master.zip

 $ wget http://zlib.net/zlib-1.2.11.tar.gz

 $ tar -zxf zlib-1.2.11.tar.gz

 $ cd nginx-1.12.2

 

 $ ./configure --prefix=/etc/nginx/ --sbin-path=/usr/sbin/nginx --conf-path=/etc/nginx/nginx.conf --pid-path=/var/run/nginx/nginx.pid --error-log-path=/var/log/nginx/error.log --http-log-path=/var/log/nginx/access.log --with-pcre=/root/pcre-8.42 --with-zlib=/root/zlib-1.2.11 --add- module=/root/echo-nginx-module-0.61 

>> ์ฐธ๊ณ ๋กœ ๊ฒฝ๋กœ๊ฐ™์€๊ฑด ์กฐ๊ธˆ ๋‹ค๋ฅผ ์ˆ˜ ์žˆ์„ ๊ฒƒ์ด๋‹ค.


 $ make -j2

 $ make install


 ์ด๋ ‡๊ฒŒ ์ปดํŒŒ์ผ๋ฐฉ์‹์œผ๋กœ ์„ค์น˜๋ฅผ ํ–ˆ๋‹ค......



2) ์‹คํ–‰ : sudo service nginx start    

  ~ ์•„๋‹ˆ๋ฉด.... sudo /etc/init.d/nginx start

  ~ ์ค‘์ง€๋Š” stop, ์žฌ์‹œ์ž‘์€ restart, ์ƒํƒœ๋Š” status


โ€ป service ๋ช…๋ น์–ด๊ฐ€ ์‹คํ–‰์ด ์•ˆ๋œ๋‹ค๋ฉด /lib/systemd/system/ ์„ ๋ณด๋ผ. (nginx.service ํŒŒ์ผ ์ฐพ์•„๋ณด๊ธฐ)

โ€ป /etc/init.d/nginx ๊ฐ€ ์‹คํ–‰์ด ์•ˆ๋œ๋‹ค๋ฉด /etc/init.d์— nginx ํŒŒ์ผ์„ ์‚ดํŽด๋ณด๋ผ. (์—†์œผ๋ฉด ์ฐพ์•„์„œ ๋งŒ๋“ค๋˜๊ฐ€ ํ•ด์•ผํ•œ๋‹ค.)


3) ์‹คํ–‰ ํ™•์ธ : ip ์ฃผ์†Œ ์ ‘๊ทผ์œผ๋กœ ํ™•์ธ(http)

 - http ์ ‘๊ทผ์ด ์•ˆ๋˜๊ฑฐ๋“  ํ•ด๋‹น ํฌํŠธ(80)์ด ์—ด๋ ค์žˆ๋Š”์ง€ ํ™•์ธํ•˜์—ฌ์•ผ ํ•œ๋‹ค.


4) ์„ค์ • : /etc/nginx/sites-enabled ์ด๋™ํ•˜์—ฌ test.conf ํŒŒ์ผ์ƒ์„ฑ (ํŒŒ์ผ๋ช…์€ ์ƒ๊ด€์—†์Œ)

 - ์™ธ๋ถ€ ์„œ๋ฒ„์—์„œ ์ƒ์„ฑํ•  ๊ฒฝ์šฐ ๋‚ด๋ถ€ ํฌํŠธ๋ฅผ ์ด์šฉํ•˜์—ฌ ์„œ๋ฒ„์‹คํ–‰

 ---- test.conf ๋‚ด์šฉ ----

server {

    listen       80;

    server_name  localhost;


    location / {

        proxy_set_header Host $http_host;

        proxy_set_header X-Real-IP $remote_addr;

        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;

        proxy_set_header X-Forwarded-Proto $scheme;

        proxy_set_header X-NginX-Proxy true;


        proxy_pass http://localhost:3000/; <----์‚ฌ์šฉํ•  ๋‚ด๋ถ€ ํฌํŠธ ์ž…๋ ฅ

        proxy_redirect off;

        index index.jsp index.html index.php;

    }


    error_page   500 502 503 504  /50x.html;

    location = /50x.html {

        root   html;

    }

}

 ---- ---- ---- ---- ----

 - ์ด๋ ‡๊ฒŒ ๋˜๋ฉด, ์™ธ๋ถ€์—์„œ http://์„œ๋ฒ„์ฃผ์†Œ ๋กœ ์ ‘๊ทผ์‹œ servcer -> location / ํ•จ์ˆ˜๋ฅผ ํƒ„๋‹ค.


[2] node.js

1) ์„ค์น˜ : sudo apt-get install -y nodejs

* ๋ฒ„์ „ํ™•์ธ : node -v


[2-1] npm ์ตœ์‹ ๋ฒ„์ „ ์˜ฌ๋ฆฌ๊ธฐ

1) ์„ค์น˜ : sudo npm install -g npm

* ๋ฒ„์ „ํ™•์ธ : npm -v


[3] mongodb

1) ์„ค์น˜ : sudo apt-get install mongodb

* ๋ฒ„์ „ํ™•์ธ : mongo --version

๋ฐ˜์‘ํ˜•
๋ฐ˜์‘ํ˜•

๋กœ์ปฌ์—์„œ ์‹คํ–‰๋จ์„ ํ™•์ธํ•˜์˜€๋‹ค.


์ด๋ฒˆ์—” ๋ฆฌ๋ˆ…์Šค ์„œ๋ฒ„์—์„œ ์‹คํ–‰ ํ•ด ๋ณผ ์ƒ๊ฐ์ด๋‹ค.


0. ์‚ฌ์ „ ์ค€๋น„์‚ฌํ•ญ


0-0. ๋ฆฌ๋ˆ…์Šค ์„œ๋ฒ„(๋‚˜์˜ ๊ฒฝ์šฐ๋Š” [AWS EC2 - ubuntu]๋ฅผ ์ด์šฉ)

 * ์ฐธ๊ณ  : http://mungmange.tistory.com/59?category=741355,


0-1. java8์„ค์น˜

 * ์ฐธ๊ณ  : https://zetawiki.com/wiki/%EC%9A%B0%EB%B6%84%ED%88%AC_Java_8_%EC%84%A4%EC%B9%98

          : http://bluexmas.tistory.com/734 << ๋‚˜๋Š” ์ด๊ฑธ ์ฐธ๊ณ ํ•จ


  $ add-apt-repository ppa:webupd8team/java
  $ apt-get update
  $ apt-get install oracle-java8-installer
  $ java -version
  $ apt-get install oracle-java8-installer
  $ java -version


0-2. tomcat 7.0์„ค์น˜

* ์ฐธ๊ณ  : https://zetawiki.com/wiki/%EB%A6%AC%EB%88%85%EC%8A%A4_%ED%86%B0%EC%BA%A37_%EC%BB%B4%ED%8C%8C%EC%9D%BC_%EC%84%A4%EC%B9%98

http://kingle1024.tistory.com/60 << ๋‚˜๋Š” ์ด๊ฑธ ์ฐธ๊ณ ํ•จ


 $ apt-get install tomcat7
 $ service tomcat7 start
 $ sudo ln -s /usr/lib/jvm/java-8-oracle/ /usr/lib/jvm/default-java
 $ service tomcat7 start


๋ญ ๊ฒ€์ƒ‰ํ•˜๋ฉด ๋งŽ์ด ๋‚˜์˜จ๋‹ค.




1. ๋ฆฌ๋ˆ…์Šค 8080ํฌํŠธ๋ฅผ ์—ด์–ด๋ผ.


tomcat ๊ธฐ๋ณธ ํฌํŠธ๋Š” 8080์œผ๋กœ ์„ค์ •๋˜์–ด์žˆ๋‹ค.

๋‚˜๋Š” 8080์œผ๋กœ ์„ค์ •์„ ํ•ด๋†“๊ณ  ์‹คํ–‰ํ•˜์˜€๋‹ค.


์ฐธ๊ณ ๋กœ AWS๋ฅผ ์‚ฌ์šฉํ•œ ๋‚˜๋Š” AWS ๋Œ€์‹œ๋ณด๋“œ์— ๋“ค์–ด๊ฐ€์„œ ์„ค์ •ํ•ด์ฃผ์—ˆ๋‹ค.


โ€ป ์™ ๋งŒํ•˜๋ฉด ์ฝ˜์†”๋‚ด์—์„œ ๋ฐฉํ™”๋ฒฝ ์„ค์ •์„ ํ•˜์ง€ ๋ง๊ธฐ๋ฅผ

--> ์˜ˆ์ „์— ์ฝ˜์†”๋กœ ๋ฐฉํ™”๋ฒฝ ์ž˜๋ชป ๊ฑด๋“ค์˜€๋‹ค๊ฐ€ ์ ‘์†์•ˆ๋˜์„œ EC2 ์ƒˆ๋กœ ์„ค์น˜ํ•œ ์ ์ด ์žˆ์—ˆ๋‹ค. (ใ… ใ… )


* ์ฐธ๊ณ  : http://mungmange.tistory.com/66?category=741355 (์‰ฝ๋‹ค)


ํฌํŠธ๋ฅผ ์—ฐ ํ›„, ํ•ด๋‹น URL์„ ์ ‘์†ํ•ด๋ณธ๋‹ค.

์ด๋Ÿฌํ•œ ํ˜•ํƒœ์ผ ๊ฒƒ์ด๋‹ค.


http://๋ฆฌ๋ˆ…์Šค์ฃผ์†Œ:8080

2. war ํŒŒ์ผ ์ง‘์–ด๋„ฃ๊ธฐ.


์œ„์˜ ๊ทธ๋ฆผ์—๋„ ๋‚˜์™€์žˆ์ง€๋งŒ, ์ € It works ! ~~ ๋‚˜์˜ค๋Š” ํŽ˜์ด์ง€์˜ ๊ฒฝ๋กœ๋Š”

/var/lib/tomcat7/webapps/ROOT/index.html ์ด๋‹ค. (์œ„์— ๋‚˜์™€์žˆ๋‹ค.)


ํ•ด๋‹น์œ„์น˜๊ฐ€ ํ†ฐ์บฃ ์‹คํ–‰ ํ–ˆ์„ ๋•Œ์˜ ๊ธฐ๋ณธ ํ”„๋กœ์ ํŠธ ๊ฒฝ๋กœ์ด๋‹ค.

์ด๊ฑด server.xml์—์„œ ์ˆ˜์ •์ด ๊ฐ€๋Šฅํ•˜๋‹ค. 


๋‚˜๋Š” 

/var/lib/tomcat7/webapps/ROOT 

๊ฒฝ๋กœ์— mungmang_java.war ์„ ์ง‘์–ด๋„ฃ๊ณ , ์••์ถ•์„ ํ’€์—ˆ๋‹ค.

์ง‘์–ด๋„ฃ๋Š”๊ฑด ํŒŒ์ผ์ฆ๋ผ ํ”„๋กœ๊ทธ๋žจ(SFTP ์—ฐ๊ฒฐ ํ”„๋กœ๊ทธ๋žจ) ์ด์šฉ.


$ unzip mungmang_java.war -d /var/lib/tomcat7/webapps/ROOT/mungmang_java


โ€ป ๋งŒ์•ฝ unzip ์ด ubuntu์— ์„ค์น˜๋˜์–ด ์žˆ์ง€ ์•Š์œผ๋ฉด ์„ค์น˜ํ•ด๋ผ (apt-get install unzip)



3. server.xml๋ฅผ ์ฐพ์•„ context๊ฒฝ๋กœ๋ฅผ ์ถ”๊ฐ€ํ•ด์ฃผ์–ด์•ผ ํ•œ๋‹ค.


$ find / -name 'server.xml' 
$ vi /ํ†ฐ์บฃ์œ„์น˜๊ฒฝ๋กœ/server.xml


ํ•ด๋‹น ์œ„์น˜๋ฅผ ์ฐพ์•„ ๋นจ๊ฐ„๊ธ€์”จ๋ฅผ ์ถ”๊ฐ€ํ•ด์•ผ ํ•œ๋‹ค.

      <Host name="localhost"  appBase="webapps"

            unpackWARs="true" autoDeploy="true">

        <Context docBase="./ROOT/mungmang_java" path="/mungmang_java" reloadable="true"/>

        <Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs"

               prefix="localhost_access_log." suffix=".txt"

               pattern="%h %l %u %t &quot;%r&quot; %s %b" />

      </Host>


๊ทธ๋ฆฌ๊ณ  tomcat ์žฌ์‹œ์ž‘


$ service tomcat7 restart


โ€ป ๋งŒ์•ฝ appBase๊ฒฝ๋กœ๋ฅผ ๋ณ€๊ฒฝํ•˜๊ณ  ์‹ถ์œผ๋ฉด


      <Host name="localhost"  appBase="/var/abcd"

            unpackWARs="true" autoDeploy="true">

        <Context docBase="mungmang_board.war" path="/springpj" reloadable="true"/>

        <Context docBase="mungmang_java.war" path="/mungmang_java" reloadable="true"/>


        <Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs"

               prefix="localhost_access_log." suffix=".txt"

               pattern="%h %l %u %t &quot;%r&quot; %s %b" />

      </Host>


# ์ฐธ๊ณ  : http://dimdim.tistory.com/entry/Tomcat-WAR-%ED%8C%8C%EC%9D%BC-%EB%B0%B0%ED%8F%AC-%EC%82%BD%EC%A7%88%EC%97%90-%EB%8C%80%ED%95%9C-%EC%A0%95%EB%A6%AC



4. ์‹คํ–‰ํ•ด๋ณธ๋‹ค.


http://๋ฆฌ๋ˆ…์Šค์ฃผ์†Œ:8080/mungmang_java/test.jsp


โ€ป ๋งŒ์•ฝ jstl ๊ด€๋ จ ์—๋Ÿฌ๊ฐ€ ๋‚˜๊ฑฐ๋“ ,

/var/lib/tomcat7/webapps/ROOT/mungmang_java/WEB-INF/lib ์œ„์น˜์— jstl-1.2.jar ํŒŒ์ผ์„ ๋„ฃ์–ด์ฃผ์ž.




-- ๋

๋ฐ˜์‘ํ˜•
๋ฐ˜์‘ํ˜•

โ€ป ์‚ฌ์ „ ์ค€๋น„์‚ฌํ•ญ


๋กœ์ปฌPC์ค€๋น„->tomcat, java์„ค์น˜->์ดํด๋ฆฝ์Šค์„ค์น˜


์ด๊ฑด๋ญ ๊ธฐ๋ณธ์œผ๋กœ ๋˜์–ด์žˆ์œผ๋ฆฌ๋ผ ์ƒ๊ฐํ•œ๋‹ค.


---



1. ๋กœ์ปฌ์„œ๋ฒ„์—์„œ ์›นํ”„๋กœ์ ํŠธ ๊ฐœ๋ฐœ


์ธํ”„๋Ÿฐ ๊ฐ•์ขŒ๋ฅผ ์ฐธ๊ณ  ํ•˜์˜€๋‹ค. 


โ€ป ์ฐธ๊ณ  : https://www.inflearn.com/course-status-2/



1-1. ์ดํด๋ฆญ์Šค์—์„œ ๋‹ค์ด๋‚˜๋ฏน ํ”„๋กœ์ ํŠธ ๋งŒ๋“ค๊ธฐ



๊ทธ ํ›„, [Project name] ์ž…๋ ฅ ํ›„ ํ•˜๋‹จ์˜ [Finish ๋ฒ„ํŠผ] ํด๋ฆญ!


- Static Web Project : ๋™์  ์š”์†Œ๊ฐ€ ํฌํ•จ๋˜์–ด ์žˆ์ง€ ์•Š์€ ํ”„๋กœ์ ํŠธ(HTML)

- Dynamic Web Project : ๋™์  ์š”์†Œ๊ฐ€ ํฌํ•จ๋˜์–ด ์žˆ๋Š” ํ”„๋กœ์ ํŠธ(JSP, Servlet ..)



1-2. ํŒŒ์ผ ๊ตฌ์กฐ ์ƒ์„ฑ


์ธํ”„๋Ÿฐ ๊ฐ•์˜๋ฅผ ์ฐธ๊ณ  ํ•˜์˜€๋‹ค.

์•„๋ž˜์™€ ๊ฐ™์ด ํŒŒ์ผ์„ ์ƒ์„ฑํ•˜์˜€๋‹ค.



ํŒจํ‚ค์ง€๋ฅผ command, dto, frontcontroller ๋กœ ๊ตฌ๋ถ„ ํ•˜์˜€๋‹ค. 

(DB๋Š” ์‚ฌ์šฉํ•˜์ง€ ์•Š์•˜๋‹ค. ๊ทธ๋ž˜์„œ dao๊ฐ€ ์—†๋‹ค.)


์•„๋ž˜๋Š” ์†Œ์ŠคํŒŒ์ผ์ด๋‹ค. (*.war ํŒŒ์ผ๋กœ ์ƒ์„ฑํ•˜์˜€๋‹ค.)

mungmang_java.war


๊ตฌ์กฐ๋Š” ๋‹ค์Œ๊ณผ ๊ฐ™๋‹ค.




2. ๋กœ์ปฌ์„œ๋ฒ„์—์„œ ์‹คํ–‰ํ•ด๋ณด๊ธฐ


2-1. tomcat ์‹คํ–‰ํ•ด๋ณด๊ธฐ


์ดํด๋ฆฝ์Šค์—์„œ tomcat์„ ์‹คํ–‰ํ•ด์•ผ ํ•œ๋‹ค.

์‹คํ–‰ ์ „, server.xml ํŒŒ์ผ ์—ด์–ด์„œ ๋นจ๊ฐ„๊ธ€์”จ๋ถ€๋ถ„์„ ์ถ”๊ฐ€ํ•˜์ž.



<Host appBase="webapps" autoDeploy="true" name="localhost" unpackWARs="true">

      <Context docBase="mungmang_java" path="/mungmang_java" reloadable="true" source="org.eclipse.jst.jee.server:mungmang_java"/> <!-- ์ถ”๊ฐ€ -->

</Host>


๋˜๋Š” 


์ด๋Ÿฐ๋ฐฉ์‹์œผ๋กœ ํ”„๋กœ์ ํŠธ๋ฅผ ์ถ”๊ฐ€ํ•ด๋„ ๋œ๋‹ค.


๊ทธ๋ฆฌ๊ณ ๋‚˜์„œ test.jsp ํŒŒ์ผ์„ ์‹คํ–‰!


๊ฒฝ๋กœ๋Š” http://localhost:8080/mungmang_java/test.jsp


๊ฒฐ๊ณผ๋Š” http://localhost:8080/mungmang_java/result.do


โ€ป ๋งŒ์•ฝ jstl ๊ด€๋ จ ์—๋Ÿฌ๊ฐ€ ๋‚œ๋‹ค๋ฉด, 

C:\ํ†ฐ์บฃ๊ฒฝ๋กœ\lib ์œ„์น˜์— jstl-1.2.jarํŒŒ์ผ์„ ์ฃผ์ž…์‹œ์ผœ ์ค€๋‹ค.


* jstl ๋‹ค์šด ๊ฒ€์ƒ‰ ๊ฒฐ๊ณผ : 

https://www.google.co.kr/search?ei=QAFjW4SMGInk8wWJhon4CQ&q=jstl+%EB%8B%A4%EC%9A%B4&oq=jstl+%EB%8B%A4%EC%9A%B4&gs_l=psy-ab.3..0j0i5i30k1j0i8i30k1l6j0i30k1.2755704.2758882.0.2759275.12.12.0.0.0.0.361.1377.0j6j1j1.9.0....0...1.1j4.64.psy-ab..4.8.1342.6..0i10k1j35i39k1j0i67k1.115.ONpoo-7ivtE



3. war ํŒŒ์ผ์„ ์ƒ์„ฑํ•˜์ž.


์œ„์— mungmang_java.war ํŒŒ์ผ์„ ๋งŒ๋“ค์—ˆ๋˜ ๋ฐฉ๋ฒ•์€ ๋‹ค์Œ๊ณผ ๊ฐ™๋‹ค.


ํ•ด๋‹น ํ”„๋กœ์ ํŠธ ์˜ค๋ฅธ์ชฝ ๋ฒ„ํŠผ ํด๋ฆญ -> Export -> War File ํด๋ฆญ



Finish!


๋ฐ˜์‘ํ˜•
๋ฐ˜์‘ํ˜•

#ubuntu์—์„œ django


---------------------------------------------------------------------------------

# ์ฐธ๊ณ  

https://tutorial.djangogirls.org/ko/installation/

http://incoffee.tistory.com/6 ---> ์ด๊ฑฐ ๋ณด๊ณ  ํ•จ  

https://uwsgi-docs.readthedocs.io/en/latest/WSGIquickstart.html

http://pythonstudy.xyz/python/article/303-Django-%EC%84%A4%EC%B9%98

https://docs.djangoproject.com/ko/2.0/intro/tutorial01/


# ๋ฒ„์ถ”์–ผ ํ™˜๊ฒฝ ์„ค์ • ๊ด€๋ จ

https://beomi.github.io/2016/12/28/HowToSetup-Virtualenv-VirtualenvWrapper/

---------------------------------------------------------------------------------


[0] apt-get ํŒจํ‚ค์ง€ ์—…๋ฐ์ดํŠธ

$ sudo apt-get update && apt-get upgrade -y


[1] python-pip, python-dev ์„ค์น˜

$ sudo apt-get install python-pip python-dev
$ sudo apt-get install python3-pip python3-dev


[2] ํ™•์ธ

$ pip -V
$ pip3 -V


[3] pip์œผ๋กœ virtualenv virtualenvwrapper ์„ค์น˜

$ pip install virtualenv virtualenvwrapper

$ pip3 install virtualenv virtualenvwrapper


[4] virtualenv ํ”„๋กœ์ ํŠธ ์ƒ์„ฑ

$ virtualenv --python=ํŒŒ์ด์ฌ๋ฒ„์ „ ๊ฐ€์ƒํ™˜๊ฒฝ์ด๋ฆ„

# ex)

$ virtualenv --python=python3.5 ๊ฐ€์ƒํด๋”

$ virtualenv --python=python2.7 ๊ฐ€์ƒํด๋”


[5] ๊ฐ€์ƒํ™˜๊ฒฝ ์‹คํ–‰

$ cd ๊ฐ€์ƒํด๋”/bin/

$ source activate


[6] ์žฅ๊ณ ์„ค์น˜

- pip์ด ์ตœ์‹  ๋ฒ„์ „์ธ์ง€ ํ™•์ธ

$ pip install --upgrade pip

$ pip install django~=1.11.0


[7] ์žฅ๊ณ  ํ”„๋กœ์ ํŠธ ์ƒ์„ฑ

$ cd ๊ฐ€์ƒํด๋”

$ django-admin startproject mysite .


[8] ์žฅ๊ณ  ํ”„๋กœ์ ํŠธ ํ™˜๊ฒฝ์„ค์ • ๋ณ€๊ฒฝ

mysite/settings.py


TIME_ZONE = 'Asia/Seoul'

STATIC_ROOT = os.path.join(BASE_DIR, 'static')

ALLOWED_HOSTS = ['127.0.0.1', '.pythonanywhere.com']


์ถ”๊ฐ€ ๋ฐ ๋ฐ์ดํ„ฐ๋ฒ ์ด์Šค ์…‹ํŒ… >> ์ด๋ฏธ ๋‚ด๋ถ€์— sqlite3์ด ์„ค์น˜๋˜์–ด ์žˆ๋‹ค๊ณ  ํ•จ.

DATABASES = {

    'default': {

        'ENGINE': 'django.db.backends.sqlite3',

        'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),

    }

}


[9] ์‹คํ–‰ (python ์œผ๋กœ ์‹คํ–‰ํ•˜๊ฑฐ๋‚˜ uWSGI ์œผ๋กœ ์‹คํ–‰)

$ python manage.py migrate ---> ์„œ๋ฒ„ ์ž‘๋™ ํ™•์ธ

$ python manage.py runserver ---> ์„œ๋ฒ„์‹คํ–‰

[9-1] uWSGI๋ฅผ virtualenv์— ์„ค์น˜

$ pip install uwsgi

[9-2] uWSGI ์‹คํ–‰

$ uwsgi --socket :8001 --wsgi-file test.py

[9-3] django ํ”„๋กœ์ ํŠธ ์‹คํ–‰

$ python manage.py runserver

$ uwsgi --socket :8001 --module mysite.wsgi --> ์‹คํ–‰ ๋˜์—ˆ์Œ

>> (test) root@mungmange:/var/www/dev/git_project/dev_toy/py/test/mysite # uwsgi --socket :8001 --module mysite.wsgi

$ uwsgi --http :8001 --module mysite.wsgi #uwsgi --socket :8001 --wsgi-file test.py



[10] nginx ์Šคํฌ๋ฆฝํŠธ

-------------------------------------------

upstream django{

    server localhost:8001;

}

server {


    listen       80;

    server_name  localhost;


    charset utf-8;


location ~ /d {

    uwsgi_pass  django;

include     uwsgi_params; # the uwsgi_params file you installed

}

}

-------------------------------------------

$ service nginx restart


[11] ์ฐธ๊ณ ๋กœ setting.py ํŒŒ์ผ ์ˆ˜์ • ํ›„

$ python manage.py migrate ํ•ด์ฃผ๊ธฐ



[12] ์–ดํ”Œ๋ฆฌ์ผ€์ด์…˜ ํ”„๋กœ์ ํŠธ ์ƒ์„ฑ

$ python manage.py ๊ฐ€์ƒํด๋” blog



----------------------------------------------------------------------------------------------------------------

# python ์ฟผ๋ฆฌ์…‹


[1] shell ์‹คํ–‰

(test) root@mungmange:/var/www/dev/git_project/dev_toy/py/test/mysite# python manage.py shell



[2] ๊ฐ์ฒด ์กฐํšŒ

>>> from blog.models import Post

>>> Post.objects.all()

<QuerySet [<Post: aa>, <Post: aa>, <Post: aa>, <Post: ad>, <Post: sdf>]>


๋ฐ˜์‘ํ˜•
๋ฐ˜์‘ํ˜•

1. nginx ์„ค์น˜ ๋ฐ ์„ค์ •

์ฐธ๊ณ  : http://altkeycode.tistory.com/10


1-1) ์„ค์น˜

yum install nginx


1-2) nginx ์„ค์ •ํŒŒ์ผ ์ˆ˜์ • 

( /etc/nginx/cond.f/default.conf )


1-3) ๋ถ€ํŒ…์‹œ ์ž๋™์‹œ์ž‘

systemctl enable nginx


1-4) ์ง€๊ธˆ ์‹คํ–‰

systemctl start nginx


1-3) ๋ฐฉํ™”๋ฒฝ ์˜คํ”ˆ

firewall-cmd --zone=public --add-port=80/tcp --permanent


1-4) ๋ฐฉํ™”๋ฒฝ ์žฌ์‹œ์ž‘

firewall-cmd --reload


1-5) ๋ฒ„์ถ”์–ผ๋ฐ•์Šค์—์„œ ํฌํŠธํฌ์›Œ๋”ฉ ์ฒ˜๋ฆฌ

์„ค์ •>๋„คํŠธ์›Œํฌ>๊ณ ๊ธ‰(D)>ํฌํŠธํฌ์›Œ๋”ฉ(P)



2. 80 ํฌํŠธ ์‹คํ–‰ ์•ˆ๋  ์‹œ


2-1) 80ํฌํŠธ ์—ด๋ ค์žˆ๋Š”์ง€ ํ™•์ธ

netstat -ntpa | grep 80


2-2) netstat ๋ช…๋ น์–ด ์‹คํ–‰ ์•ˆ๋œ๋‹ค๋ฉด?

yum install net-tools



์ฐธ๊ณ  : http://blog.daum.net/bondj/19



๋ฐ˜์‘ํ˜•
๋ฐ˜์‘ํ˜•

nginx ์„ค์น˜ ํ›„ 

80ํฌํŠธ ์‹คํ–‰์„ ํ™•์ธํ•˜๋ ค ํ•˜์˜€์œผ๋‚˜

IIS ์‹œ์ž‘ํ™”๋ฉด ๊ฐ™์€๊ฒŒ ๋‚˜์™”๋‹ค.

Window10 ํ™˜๊ฒฝ... ์œˆ8์ด๋‚˜ ์œˆ10์—์„œ ๋‚˜์˜ค๋Š” ํ™”๋ฉด์ธ ๊ฒƒ ๊ฐ™์€๋ฐ

์ด๋ฅผ ์•ˆ๋‚˜์˜ค๊ฒŒ ํ•˜๋ ค๋ฉด



์ œ์–ดํŒ>์„œ๋น„์Šค ์— ๋“ค์–ด๊ฐ€




์ € ํŒŒ๋ž€์ƒ‰ ๋ฐ•์Šค๋ฅผ ์ค‘์ง€๋ฅผ ํ•˜์—ฌ๋ผ (๋งˆ์šฐ์Šค ์˜ค๋ฅธ์ชฝ๋ฒ„ํŠผ์„ ๋ˆŒ๋Ÿฌ ์ค‘์ง€ ๋ฒ„ํŠผ์„ ํด๋ฆญ)


๊ทธํ›„์— 80ํฌํŠธ ์ ‘์† ์‹œ ์›ํ•˜๋Š”...ํŽ˜์ด์ง€๊ฐ€ ์‹คํ–‰๋  ๊ฒƒ์ด๋‹ค.


์ฐธ๊ณ  : http://ssftc.blogspot.kr/2015/08/10-80.html

๋ฐ˜์‘ํ˜•
๋ฐ˜์‘ํ˜•

Centos7์„ ์„ค์น˜ํ•˜๊ณ  ์ ‘์† ํ›„ ํ”„๋กœ๊ทธ๋žจ์„ ์„ค์น˜ํ•˜๋ ค๊ณ  ํ• ๋•Œ 

(yum ์ด ์‹คํ–‰์ด ์•ˆ๋  ๋–„)


cannot find a valid baseurl for repo base/7/x86_64

๋ผ๋Š” ์—๋Ÿฌ๊ฐ€ ๋‚  ์‹œ์—


ONBOOT=no


dhclient


yum update

y ์ž…๋ ฅ, y ์ž…๋ ฅ



์ด์ˆœ์„œ๋กœ ์‹คํ–‰ํ•˜์—ฌ๋ผ. ๊ทธ๋Ÿผ๋œ๋‹ค.


์ฐธ๊ณ  : https://www.youtube.com/watch?v=HyVul-vNwYM


๋ฐ˜์‘ํ˜•
๋ฐ˜์‘ํ˜•

๊ฐ€์ƒ๋จธ์‹ ์—์„œ

Centos7์„ ์„ค์น˜ํ•ด๋ณด์ž. ๊ฐ„๋‹จํ•˜๋‹ค.



Install CentosOS 7 ์„ ํƒ



์‹œ์Šคํ…œ -> ์„ค์น˜ ๋Œ€์ƒ (D) ์„ ์„ ํƒํ•˜์—ฌ ์ž๋™์œผ๋กœ ํ• ๋‹น๋˜๊ฒŒ ํ•˜๊ณ 

์„ค์น˜์‹œ์ž‘(B) ํด๋ฆญ


ROOT์•”ํ˜ธ (R) ์„ ์„ ํƒํ•˜์—ฌ ์ดˆ๊ธฐ ๋น„๋ฐ€๋ฒˆํ˜ธ ์„ค์ •ํ•˜๊ธฐ


์ ‘์†ํ•˜๊ธฐ



๋ฐ˜์‘ํ˜•
๋ฐ˜์‘ํ˜•

๋ฒ„์ถ”์–ผ ๋ฐ•์Šค ์‹คํ–‰ ์—๋Ÿฌ ์‹œ

(์„ธ์„ ์ด ์‹คํ–‰์ด์•ˆ๋œ๋‹ค๋Š”๋‘ฅ์˜ ๋ฉ”์„ธ์ง€..)

๋ฒ„์ถ”์–ผ๋ฐ•์Šค E_FAIL (0x80004005)


Soft Forum Xecure HSM

Fasoo DRM

๋„ค์ด๋ฒ„ ebook ํ”„๋กœ๊ทธ๋žจ


์„ ์‚ญ์ œํ•ด๋ณด๋ผ......๋ณด์•ˆํ”„๋กœ๊ทธ๋žจ์ด๋ž‘ ์ถฉ๋Œ์ด ๋‚˜๋Š”๊ฐ€ ์‹ถ๋‹ค.....(๋‚˜์˜๊ฒฝ์šฐ์—” ์‚ญ์ œํ•˜๊ณ  ์ž˜ ์‹คํ–‰๋˜์—ˆ๋‹ค.)
์‚ญ์ œ ํ›„ PC ์žฌ๋ถ€ํŒ…ํ•˜๋„๋ก ํ•˜๊ณ ..



๊ฒ€์ƒ‰ํ–ˆ์„๋•Œ ์ถ”๊ฐ€ ํŒจํ‚ค์ง€ ํŒŒ์ผ์„ ๋ฐ›์•„ ๋„ฃ์œผ๋ผ๋Š”๋‘ฅ 

hyper-v๋ฅผ ์ฒดํฌํ•ด์ œ๋ฅผํ•˜๋ผ๋Š”๋‘ฅ 

(๋‚˜์˜ PC ์šด์˜์ฒด์ œ ๋ฒ„์ „์€ window10 home์ด๋ผ hyper-v ์„ ํƒํ•˜๋Š”๊ฒŒ ์—†๋”๋ผ)

์—ฌ๋Ÿฌ๊ฐ€์ง€๋ฅผ ํ•ด๋ณด์•˜๋Š”๋ฐ๋„ ์•ˆ๋˜์„œ ์ฐพ๋‹ค๊ฐ€ ์ €๋ ‡๊ฒŒ ํ•˜๋‹ˆ ๋˜์—ˆ๋‹ค.

๋ฐ˜์‘ํ˜•

+ Recent posts