Do Not Think!!!

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 글로 기록하기
$ defaults write com.apple.iPhoto PKFaceDetectionEnabled 0
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



Posted
Filed under 01010101
#!/bin/bash

function start() {
    echo "start Ubuntu on VMware"
    /Applications/VMware\ Fusion.app/Contents/Library/vmrun -T fusion start ~/Documents/Virtual\ Machines/Ubuntu\ 64-bit.vmwarevm/Ubuntu\ 64-bit.vmx nogui
}

function stop() {
    echo "stop Ubuntu on VMware"
    /Applications/VMware\ Fusion.app/Contents/Library/vmrun -T fusion stop ~/Documents/Virtual\ Machines/Ubuntu\ 64-bit.vmwarevm/Ubuntu\ 64-bit.vmx nogui
}


if [ "start" = "$1" ] ;
then
    start
elif [ "stop" = "$1" ] ;
then
    stop
else
    echo "usage: $0 { start | stop }"
    exit
fi
Posted
Filed under 01010101
$ sudo vi /etc/nginx/sites-enabled/domain.conf

server {
    server_name domain;

    root /home/ubuntu/domain;
    index index.php;

    # set expiration of assets to MAX for caching
    location ~* \.(ico|css|js|gif|jpe?g|png)(\?[0-9]+)?$ {
        access_log off;
        log_not_found off;
        expires 360d;
    }

    # static contents
    if ($request_uri ~* ^/(images|css|js|font)/) {
        rewrite ^(.*$) /www/$1;
        break;
    }

    # unless the request is for a valid file (image, js, css, etc.), send to bootstrap
    if (!-e $request_filename) {
        rewrite ^/(.*)$ /index.php?/$1 last;
        break;
    }

    location / {
        try_files $uri $uri/ /index.php;
    }

    location ~* \.php$ {
        fastcgi_pass   unix:/var/run/php5-fpm.sock;
        fastcgi_index   index.php;
        fastcgi_split_path_info ^(.+\.php)(.*)$;
        fastcgi_param   SCRIPT_FILENAME $document_root$fastcgi_script_name;
        include         fastcgi_params;
    }

    # deny access to hidden files
    location ~ /\. {
        access_log off;
        log_not_found off;
        deny all;
    }
}
Posted
Filed under 01010101
nginx setting

$ sudo vi /etc/nginx/site-avaliable/domain.conf

server {
    server_name domain;

    location / {
      proxy_set_header X-Real-IP $remote_addr;
      proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
      proxy_set_header Host $http_host;
      proxy_set_header X-NginX-Proxy true;

      proxy_pass http://127.0.0.1:8080/;
      proxy_redirect off;
    }
}