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 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;
    }
}
Posted
Filed under 01010101
NginX
sudo apt-get install nginx


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://sfo1.mirrors.digitalocean.com/mariadb/repo/10.0/ubuntu trusty main'

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

$ sudo mysql_secure_installation


PHP
$ sudo apt-get install php5 php5-cli php5-cgi php5-common php5-mysql php5-dev php5-mcrypt php5-curl php-pear php5-imagick php5-gd php5-fpm

XDebug
$ sudo apt-get install php5-xdebug
$ vi /etc/php5/fpm/conf.d/20-xdebug.ini
zend_extension=xdebug.so

xdebug.remote_enable=1
;xdebug.remote_host=127.0.0.1
xdebug.remote_connect_back=1
xdebug.remote_port=9001
xdebug.remote_handler=dbgp
xdebug.remote_autostart=0

Xdebug 설정하기: http://dont.pe.kr/tc/292
nginx + php-fpm 에서 xdebug 동작 안하는 문제: http://dont.pe.kr/tc/404


node.js
$ sudo add-apt-repository ppa:chris-lea/node.js
$ sudo apt-get update
$ sudo apt-get install nodejs


git
$ sudo apt-get install git

ImageMagick
$ sudo apt-get install imagemagick