Do Not Think!!!

Posted
Filed under 01010101
$ hostnamectl set-hostname new_hostname

$ vi /etc/hosts
127.0.0.1 new_hostname
Posted
Filed under 01010101
$ gradle -q dependencies


The example of Spring Boot project
+--- org.springframework.boot:spring-boot-devtools: -> 1.3.6.RELEASE
|    +--- org.springframework.boot:spring-boot:1.3.6.RELEASE
|    |    +--- org.springframework:spring-core:4.2.7.RELEASE
|    |    |    \--- commons-logging:commons-logging:1.2
|    |    \--- org.springframework:spring-context:4.2.7.RELEASE
|    |         +--- org.springframework:spring-aop:4.2.7.RELEASE
|    |         |    +--- aopalliance:aopalliance:1.0
|    |         |    +--- org.springframework:spring-beans:4.2.7.RELEASE
|    |         |    |    \--- org.springframework:spring-core:4.2.7.RELEASE (*)
|    |         |    \--- org.springframework:spring-core:4.2.7.RELEASE (*)
|    |         +--- org.springframework:spring-beans:4.2.7.RELEASE (*)
|    |         +--- org.springframework:spring-core:4.2.7.RELEASE (*)
|    |         \--- org.springframework:spring-expression:4.2.7.RELEASE
|    |              \--- org.springframework:spring-core:4.2.7.RELEASE (*)
|    \--- org.springframework.boot:spring-boot-autoconfigure:1.3.6.RELEASE
|         \--- org.springframework.boot:spring-boot:1.3.6.RELEASE (*)
+--- org.springframework.boot:spring-boot-starter-web: -> 1.3.6.RELEASE
|    +--- org.springframework.boot:spring-boot-starter:1.3.6.RELEASE
|    |    +--- org.springframework.boot:spring-boot:1.3.6.RELEASE (*)
|    |    +--- org.springframework.boot:spring-boot-autoconfigure:1.3.6.RELEASE (*)
|    |    +--- org.springframework.boot:spring-boot-starter-logging:1.3.6.RELEASE
|    |    |    +--- ch.qos.logback:logback-classic:1.1.7
|    |    |    |    +--- ch.qos.logback:logback-core:1.1.7
|    |    |    |    \--- org.slf4j:slf4j-api:1.7.20 -> 1.7.21
|    |    |    +--- org.slf4j:jcl-over-slf4j:1.7.21
|    |    |    |    \--- org.slf4j:slf4j-api:1.7.21
|    |    |    +--- org.slf4j:jul-to-slf4j:1.7.21
|    |    |    |    \--- org.slf4j:slf4j-api:1.7.21
|    |    |    \--- org.slf4j:log4j-over-slf4j:1.7.21
|    |    |         \--- org.slf4j:slf4j-api:1.7.21
|    |    +--- org.springframework:spring-core:4.2.7.RELEASE (*)
|    |    \--- org.yaml:snakeyaml:1.16
|    +--- org.springframework.boot:spring-boot-starter-validation:1.3.6.RELEASE
|    |    +--- org.springframework.boot:spring-boot-starter:1.3.6.RELEASE (*)
|    |    +--- org.apache.tomcat.embed:tomcat-embed-el:8.0.36
|    |    \--- org.hibernate:hibernate-validator:5.2.4.Final
|    |         +--- javax.validation:validation-api:1.1.0.Final
|    |         +--- org.jboss.logging:jboss-logging:3.2.1.Final -> 3.3.0.Final
|    |         \--- com.fasterxml:classmate:1.1.0
|    +--- com.fasterxml.jackson.core:jackson-databind:2.6.7
|    |    +--- com.fasterxml.jackson.core:jackson-annotations:2.6.0 -> 2.6.7
|    |    \--- com.fasterxml.jackson.core:jackson-core:2.6.7
|    +--- org.springframework:spring-web:4.2.7.RELEASE
|    |    +--- org.springframework:spring-aop:4.2.7.RELEASE (*)
|    |    +--- org.springframework:spring-beans:4.2.7.RELEASE (*)
|    |    +--- org.springframework:spring-context:4.2.7.RELEASE (*)
|    |    \--- org.springframework:spring-core:4.2.7.RELEASE (*)
|    \--- org.springframework:spring-webmvc:4.2.7.RELEASE
|         +--- org.springframework:spring-beans:4.2.7.RELEASE (*)
|         +--- org.springframework:spring-context:4.2.7.RELEASE (*)
|         +--- org.springframework:spring-core:4.2.7.RELEASE (*)
|         +--- org.springframework:spring-expression:4.2.7.RELEASE (*)
|         \--- org.springframework:spring-web:4.2.7.RELEASE (*)
+--- org.springframework.boot:spring-boot-starter-jetty: -> 1.3.6.RELEASE
|    +--- org.eclipse.jetty:jetty-servlets:9.2.17.v20160517
|    |    +--- org.eclipse.jetty:jetty-continuation:9.2.17.v20160517
|    |    +--- org.eclipse.jetty:jetty-http:9.2.17.v20160517
|    |    |    \--- org.eclipse.jetty:jetty-util:9.2.17.v20160517
|    |    +--- org.eclipse.jetty:jetty-util:9.2.17.v20160517
|    |    \--- org.eclipse.jetty:jetty-io:9.2.17.v20160517
|    |         \--- org.eclipse.jetty:jetty-util:9.2.17.v20160517
|    +--- org.eclipse.jetty:jetty-webapp:9.2.17.v20160517
|    |    +--- org.eclipse.jetty:jetty-xml:9.2.17.v20160517
|    |    |    \--- org.eclipse.jetty:jetty-util:9.2.17.v20160517
|    |    \--- org.eclipse.jetty:jetty-servlet:9.2.17.v20160517
|    |         \--- org.eclipse.jetty:jetty-security:9.2.17.v20160517
|    |              \--- org.eclipse.jetty:jetty-server:9.2.17.v20160517
|    |                   +--- javax.servlet:javax.servlet-api:3.1.0
|    |                   +--- org.eclipse.jetty:jetty-http:9.2.17.v20160517 (*)
|    |                   \--- org.eclipse.jetty:jetty-io:9.2.17.v20160517 (*)
|    +--- org.eclipse.jetty.websocket:websocket-server:9.2.17.v20160517
|    |    +--- org.eclipse.jetty.websocket:websocket-common:9.2.17.v20160517
|    |    |    +--- org.eclipse.jetty.websocket:websocket-api:9.2.17.v20160517
|    |    |    +--- org.eclipse.jetty:jetty-util:9.2.17.v20160517
|    |    |    \--- org.eclipse.jetty:jetty-io:9.2.17.v20160517 (*)
|    |    +--- org.eclipse.jetty.websocket:websocket-client:9.2.17.v20160517
|    |    |    +--- org.eclipse.jetty:jetty-util:9.2.17.v20160517
|    |    |    +--- org.eclipse.jetty:jetty-io:9.2.17.v20160517 (*)
|    |    |    \--- org.eclipse.jetty.websocket:websocket-common:9.2.17.v20160517 (*)
|    |    +--- org.eclipse.jetty.websocket:websocket-servlet:9.2.17.v20160517
|    |    |    +--- org.eclipse.jetty.websocket:websocket-api:9.2.17.v20160517
|    |    |    \--- javax.servlet:javax.servlet-api:3.1.0
|    |    +--- org.eclipse.jetty:jetty-servlet:9.2.17.v20160517 (*)
|    |    \--- org.eclipse.jetty:jetty-http:9.2.17.v20160517 (*)
|    \--- org.eclipse.jetty.websocket:javax-websocket-server-impl:9.2.17.v20160517
|         +--- org.eclipse.jetty:jetty-annotations:9.2.17.v20160517
|         |    +--- org.eclipse.jetty:jetty-plus:9.2.17.v20160517
|         |    |    +--- org.eclipse.jetty:jetty-webapp:9.2.17.v20160517 (*)
|         |    |    \--- org.eclipse.jetty:jetty-jndi:9.2.17.v20160517
|         |    |         \--- org.eclipse.jetty:jetty-util:9.2.17.v20160517
|         |    +--- org.eclipse.jetty:jetty-webapp:9.2.17.v20160517 (*)
|         |    +--- javax.annotation:javax.annotation-api:1.2
|         |    +--- org.ow2.asm:asm:5.0.1
|         |    \--- org.ow2.asm:asm-commons:5.0.1
|         |         \--- org.ow2.asm:asm-tree:5.0.1
|         |              \--- org.ow2.asm:asm:5.0.1
|         +--- org.eclipse.jetty.websocket:javax-websocket-client-impl:9.2.17.v20160517
|         |    +--- org.eclipse.jetty.websocket:websocket-client:9.2.17.v20160517 (*)
|         |    \--- javax.websocket:javax.websocket-api:1.0
|         +--- org.eclipse.jetty.websocket:websocket-server:9.2.17.v20160517 (*)
|         \--- javax.websocket:javax.websocket-api:1.0
+--- org.springframework.boot:spring-boot-starter-actuator: -> 1.3.6.RELEASE
|    +--- org.springframework.boot:spring-boot-starter:1.3.6.RELEASE (*)
|    \--- org.springframework.boot:spring-boot-actuator:1.3.6.RELEASE
|         +--- org.springframework.boot:spring-boot:1.3.6.RELEASE (*)
|         +--- org.springframework.boot:spring-boot-autoconfigure:1.3.6.RELEASE (*)
|         +--- com.fasterxml.jackson.core:jackson-databind:2.6.7 (*)
|         +--- org.springframework:spring-core:4.2.7.RELEASE (*)
|         \--- org.springframework:spring-context:4.2.7.RELEASE (*)
+--- org.springframework.boot:spring-boot-starter-security: -> 1.3.6.RELEASE
|    +--- org.springframework.boot:spring-boot-starter:1.3.6.RELEASE (*)
|    +--- org.springframework:spring-aop:4.2.7.RELEASE (*)
|    +--- org.springframework.security:spring-security-config:4.0.4.RELEASE
|    |    +--- aopalliance:aopalliance:1.0
|    |    +--- org.springframework.security:spring-security-core:4.0.4.RELEASE
|    |    |    +--- aopalliance:aopalliance:1.0
|    |    |    +--- org.springframework:spring-aop:4.2.5.RELEASE -> 4.2.7.RELEASE (*)
|    |    |    +--- org.springframework:spring-beans:4.2.5.RELEASE -> 4.2.7.RELEASE (*)
|    |    |    +--- org.springframework:spring-context:4.2.5.RELEASE -> 4.2.7.RELEASE (*)
|    |    |    +--- org.springframework:spring-core:4.2.5.RELEASE -> 4.2.7.RELEASE (*)
|    |    |    \--- org.springframework:spring-expression:4.2.5.RELEASE -> 4.2.7.RELEASE (*)
|    |    +--- org.springframework:spring-aop:4.2.5.RELEASE -> 4.2.7.RELEASE (*)
|    |    +--- org.springframework:spring-beans:4.2.5.RELEASE -> 4.2.7.RELEASE (*)
|    |    +--- org.springframework:spring-context:4.2.5.RELEASE -> 4.2.7.RELEASE (*)
|    |    \--- org.springframework:spring-core:4.2.5.RELEASE -> 4.2.7.RELEASE (*)
|    \--- org.springframework.security:spring-security-web:4.0.4.RELEASE
|         +--- aopalliance:aopalliance:1.0
|         +--- org.springframework.security:spring-security-core:4.0.4.RELEASE (*)
|         +--- org.springframework:spring-beans:4.2.5.RELEASE -> 4.2.7.RELEASE (*)
|         +--- org.springframework:spring-context:4.2.5.RELEASE -> 4.2.7.RELEASE (*)
|         +--- org.springframework:spring-core:4.2.5.RELEASE -> 4.2.7.RELEASE (*)
|         +--- org.springframework:spring-expression:4.2.5.RELEASE -> 4.2.7.RELEASE (*)
|         \--- org.springframework:spring-web:4.2.5.RELEASE -> 4.2.7.RELEASE (*)
+--- org.springframework.boot:spring-boot-starter-data-jpa: -> 1.3.6.RELEASE
|    +--- org.springframework.boot:spring-boot-starter:1.3.6.RELEASE (*)
|    +--- org.springframework.boot:spring-boot-starter-aop:1.3.6.RELEASE
|    |    +--- org.springframework.boot:spring-boot-starter:1.3.6.RELEASE (*)
|    |    +--- org.springframework:spring-aop:4.2.7.RELEASE (*)
|    |    \--- org.aspectj:aspectjweaver:1.8.9
|    +--- org.springframework.boot:spring-boot-starter-jdbc:1.3.6.RELEASE
|    |    +--- org.springframework.boot:spring-boot-starter:1.3.6.RELEASE (*)
|    |    +--- org.apache.tomcat:tomcat-jdbc:8.0.36
|    |    |    \--- org.apache.tomcat:tomcat-juli:8.0.36
|    |    \--- org.springframework:spring-jdbc:4.2.7.RELEASE
|    |         +--- org.springframework:spring-beans:4.2.7.RELEASE (*)
|    |         +--- org.springframework:spring-core:4.2.7.RELEASE (*)
|    |         \--- org.springframework:spring-tx:4.2.7.RELEASE
|    |              +--- org.springframework:spring-beans:4.2.7.RELEASE (*)
|    |              \--- org.springframework:spring-core:4.2.7.RELEASE (*)
|    +--- org.hibernate:hibernate-entitymanager:4.3.11.Final
|    |    +--- org.jboss.logging:jboss-logging:3.1.3.GA -> 3.3.0.Final
|    |    +--- org.jboss.logging:jboss-logging-annotations:1.2.0.Beta1
|    |    +--- org.hibernate:hibernate-core:4.3.11.Final
|    |    |    +--- org.jboss.logging:jboss-logging:3.1.3.GA -> 3.3.0.Final
|    |    |    +--- org.jboss.logging:jboss-logging-annotations:1.2.0.Beta1
|    |    |    +--- dom4j:dom4j:1.6.1
|    |    |    |    \--- xml-apis:xml-apis:1.0.b2
|    |    |    +--- org.hibernate.common:hibernate-commons-annotations:4.0.5.Final
|    |    |    |    +--- org.jboss.logging:jboss-logging:3.1.3.GA -> 3.3.0.Final
|    |    |    |    \--- org.jboss.logging:jboss-logging-annotations:1.2.0.Beta1
|    |    |    +--- org.hibernate.javax.persistence:hibernate-jpa-2.1-api:1.0.0.Final
|    |    |    +--- org.javassist:javassist:3.18.1-GA
|    |    |    +--- antlr:antlr:2.7.7
|    |    |    \--- org.jboss:jandex:1.1.0.Final
|    |    +--- dom4j:dom4j:1.6.1 (*)
|    |    +--- org.hibernate.common:hibernate-commons-annotations:4.0.5.Final (*)
|    |    +--- org.hibernate.javax.persistence:hibernate-jpa-2.1-api:1.0.0.Final
|    |    \--- org.javassist:javassist:3.18.1-GA
|    +--- javax.transaction:javax.transaction-api:1.2
|    +--- org.springframework.data:spring-data-jpa:1.9.4.RELEASE
|    |    +--- org.springframework.data:spring-data-commons:1.11.4.RELEASE
|    |    |    +--- org.springframework:spring-core:4.1.9.RELEASE -> 4.2.7.RELEASE (*)
|    |    |    +--- org.springframework:spring-beans:4.1.9.RELEASE -> 4.2.7.RELEASE (*)
|    |    |    +--- org.slf4j:slf4j-api:1.7.13 -> 1.7.21
|    |    |    \--- org.slf4j:jcl-over-slf4j:1.7.13 -> 1.7.21 (*)
|    |    +--- org.springframework:spring-orm:4.1.9.RELEASE -> 4.2.7.RELEASE
|    |    |    +--- org.springframework:spring-beans:4.2.7.RELEASE (*)
|    |    |    +--- org.springframework:spring-core:4.2.7.RELEASE (*)
|    |    |    +--- org.springframework:spring-jdbc:4.2.7.RELEASE (*)
|    |    |    \--- org.springframework:spring-tx:4.2.7.RELEASE (*)
|    |    +--- org.springframework:spring-context:4.1.9.RELEASE -> 4.2.7.RELEASE (*)
|    |    +--- org.springframework:spring-aop:4.1.9.RELEASE -> 4.2.7.RELEASE (*)
|    |    +--- org.springframework:spring-tx:4.1.9.RELEASE -> 4.2.7.RELEASE (*)
|    |    +--- org.springframework:spring-beans:4.1.9.RELEASE -> 4.2.7.RELEASE (*)
|    |    +--- org.springframework:spring-core:4.1.9.RELEASE -> 4.2.7.RELEASE (*)
|    |    +--- org.slf4j:slf4j-api:1.7.13 -> 1.7.21
|    |    \--- org.slf4j:jcl-over-slf4j:1.7.13 -> 1.7.21 (*)
|    \--- org.springframework:spring-aspects:4.2.7.RELEASE
|         \--- org.aspectj:aspectjweaver:1.8.9
+--- pl.allegro.tech.boot:handlebars-spring-boot-starter:0.2.12
|    +--- com.github.jknack:handlebars-springmvc:4.0.4
|    |    +--- com.github.jknack:handlebars:4.0.4 -> 4.0.5
|    |    |    +--- org.apache.commons:commons-lang3:3.1 -> 3.4
|    |    |    +--- org.antlr:antlr4-runtime:4.5.1-1
|    |    |    +--- org.mozilla:rhino:1.7R4
|    |    |    \--- org.slf4j:slf4j-api:1.6.4 -> 1.7.21
|    |    \--- org.springframework:spring-webmvc:3.1.1.RELEASE -> 4.2.7.RELEASE (*)
|    +--- org.springframework.boot:spring-boot-starter-web:1.3.2.RELEASE -> 1.3.6.RELEASE (*)
|    \--- com.github.jknack:handlebars-guava-cache:4.0.4
|         +--- com.github.jknack:handlebars:4.0.4 -> 4.0.5 (*)
|         \--- com.google.guava:guava:14.0.1
+--- com.github.jknack:handlebars-helpers:4.0.5
|    \--- com.github.jknack:handlebars:4.0.5 (*)
+--- com.amazonaws:aws-java-sdk-ses:1.11.13
|    \--- com.amazonaws:aws-java-sdk-core:1.11.13
|         +--- commons-logging:commons-logging:1.1.3 -> 1.2
|         +--- org.apache.httpcomponents:httpclient:4.5.2
|         |    +--- org.apache.httpcomponents:httpcore:4.4.4 -> 4.4.5
|         |    +--- commons-logging:commons-logging:1.2
|         |    \--- commons-codec:commons-codec:1.9
|         +--- com.fasterxml.jackson.core:jackson-databind:2.6.6 -> 2.6.7 (*)
|         +--- com.fasterxml.jackson.dataformat:jackson-dataformat-cbor:2.6.6
|         |    \--- com.fasterxml.jackson.core:jackson-core:2.6.6 -> 2.6.7
|         \--- joda-time:joda-time:2.8.1 -> 2.8.2
+--- commons-io:commons-io:2.5
+--- org.apache.commons:commons-lang3:3.4
+--- org.apache.commons:commons-collections4:4.1
+--- org.projectlombok:lombok:1.16.8
\--- org.mariadb.jdbc:mariadb-java-client:1.4.6
Posted
Filed under 01010101
ntp 설치
$ sudo apt-get install ntp

ntp 실행
$ sudo service ntp start

처음 시간맞추기
$ sudo service ntp stop
$ sudo ntpd -gq
$ sudo service ntp start
Posted
Filed under 01010101
location /
proxy_pass http://wsbackend;

proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
}
Posted
Filed under 01010101

Open JDK 8

$ sudo add-apt-repository ppa:openjdk-r/ppa
$ sudo apt-get update
$ sudo apt-get install openjdk-8-jdk


Nginx Latest Stable

$ sudo apt-get install software-properties-common
$ sudo add-apt-repository ppa:nginx/stable
$ sudo apt-get update
$ sudo apt-get install nginx


Gradle Latest Stable

$ sudo add-apt-repository ppa:cwchien/gradle
$ sudo apt-get update
$ sudo apt-get install gradle
Posted
Filed under 01010101

install nginx

$ sudo apt-get install nginx

install mariadb

$ sudo apt-get install software-properties-common
$ sudo apt-key adv --recv-keys --keyserver hkp://keyserver.ubuntu.com:80 0xcbcb082a1bb943db
$ sudo add-apt-repository 'deb http://ftp.osuosl.org/pub/mariadb/repo/10.0/ubuntu trusty main'

$ sudo apt-get update
$ sudo apt-get install mariadb-server

install tomcat

$ sudo apt-get install tomcat7
download tomcat8
https://tomcat.apache.org/download-80.cgi

install java

$ sudo add-apt-repository ppa:openjdk-r/ppa
$ sudo apt-get update
$ sudo apt-get install openjdk-8-jdk

configure nginx

$ sudo vi /etc/nginx/sites-enable/example.com
server {
    server_name example.com;
    rewrite ^ http://www.example.com$request_uri? permanent;
}

server {
    server_name *.example.com;

    root /var/lib/tomcat-8/webapps/ROOT/;
    index index.html;

    location / {
        proxy_set_header X-Forwarded-Host $host;
        proxy_set_header X-Forwarded-Server $host;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_pass http://127.0.0.1:8080/;
    }
}

configure tomcat

...



Posted
Filed under 01010101

Install IDE

Install spring tool suite

https://spring.io/tools/eclipse


Install eclipse + spring tool suite plugin

https://www.eclipse.org/downloads/
http://marketplace.eclipse.org/marketplace-client-intro?mpc_install=1794107


Install Tomcat 7

http://tomcat.apache.org/download-70.cgi


Configure Eclipse

UTF-8
Add Servers

사용자 삽입 이미지
사용자 삽입 이미지


Create Spring Project

Hello Spring

사용자 삽입 이미지
사용자 삽입 이미지


Troubleshooting

1. Tomcat 설치 디렉토리 문제

~/workspace/Servers/ 은 eclipse 가 Servers 설정 파일을 저장하는 경로입니다.
설정파일 경로는 /Servers 부터 시작합니다.
~/workspace/Servers/ 에 Tomcat 을 설치 할 경우, classpath 도 /Servers/ 에서 찾는 문제가 있습니다.
따라서, ~/workspace/Servers/ 이외의 경로에 Tomcat 을 설치해야 합니다.

ex) ~/workspace/Tomcats/apache-tomcat-7.0.57

사용자 삽입 이미지
사용자 삽입 이미지

Posted
Filed under 01010101
On a default installation the cron jobs get logged to
/var/log/syslog

Show cron log
$ grep CRON /var/log/syslog

Monitoring cron log
$ tail -f /var/log/syslog | grep CRON



Posted
Filed under 01010101
Host OS: Mac OS X
Guest OS: Ubuntu Server 14.04
VMware Fusion 7


Mac OS X

VMware CD/DVD connect to
/Applications/VMware Fusion.app/Contents/Library/isoimages/linux.iso

VMware Settings - Sharing - share folder


Ubuntu

$ sudo mkdir /mnt/cdrom
$ sudo mount /dev/cdrom /mnt/cdrom
$ cp /mnt/cdrom/VMwareTools-9.8.3-2075148.tar.gz .
$ tar zxvf VMwareTools-9.8.3-2075148.tar.gz
$ cd vmware-tools-distrib
$ sudo ./vmware-install.pl

reboot

$ sudo mkdir /mnt/hgfs
$ sudo mount -t vmhgfs .host:/sharedfolder /mnt/hgfs