서버에서의 프로그램 유지

리눅스(CentOS)의 서버에 원격(ssh)으로 접속해서 java 응용프로그램(.jar) 등의 프로그램을 실행 할 때 ssh 세션이 종료된 이후에도 프로그램이 동작하게 하는 방법에 대해 작성한 글이다. 먼저 screen 이라는 프로그램을 설치하여야한다. # yum -y install ncurses-devel texinfo pam-devel libtool screen이 동작하기 위한 환경을 구축하는 것이다. 위의 프로그램들을 설치한 후 proinlab.com/download/screen32bit.rpm proinlab.com/download/screen64bit.rpm 각 ...

Tomcat 및 MySQL 관련 한글 인코딩 문제

Tomcat 에서 JDBC 를 이용하여 MySQL 에 한글로 된 정보를 저장할 때 겪었던 인코딩 관련 문제 경험을 바탕으로 몇 가지 문제에 대해 정리한 글이다. Tomcat response Java Servlet 작성 시 한글 인코딩이 깨져서 출력되는 경우 해결법. doPost 또는 doGet 에서 아래와 같은 코드를 추가하여 해결 할 수 있음. Filter 를 이용하여 변경하면 매번 입력할 필요는 없음. response.setContentType("text/html; charset=utf-8"); JDBC ...

워드프레스 추천 플러그인

워드프레스를 이용하여 블로그를 제작할 때 유용한 플러그인을 몇 가지 정리했다. Jetpack Automattic님이 만듬 | 플러그인 사이트 방문 wordpress.com 과 연동하여 wordpress.com 의 기능을 이용할 수 있게해주는 플러그인. 사이트 통계 등 유용한 기능들이 포함되어있고 SNS 및 wordpress.com 과 간단하게 연동되어 블로그를 간편하게 홍보할 수 있다. Follow Button for Jetpack TheAdityaJain님이 만듬 ...

Linux vi Editor configure

vi editor config file is named ".vimrc". make this file at your home directory. "/home/username/.vimrc". # vi /home/username/.vimrc or # cd # vi .vimrc insert line you needed. scripte utf-8 set nocp // remove original vi options and use only vim functions set all& // set original option set hi=50 // set history size set vb // visual bell error message instead of sound set lpl // load plugin when start program set enc=utf-8 // encoding option if has("gui_running") // set font if ...

Set up tomcat at CentOS with Apache

Tomcat Download & Install at first, download tomcat refer this site, http://tomcat.apache.org/download-70.cgi. # wget http://apache.mirror.cdnetworks.com/tomcat/tomcat-7/v7.0.37/bin/apache-tomcat-7.0.37.tar.gz # tar xvfz apache-tomcat-7.0.37.tar.gz # mv apache-tomcat-7.0.37 /usr/local/tomcat and make 'init.d/tomcat' file #vi /etc/rc.d/init.d/tomcat insert below. #!/bin/bash # description: Tomcat Start Stop Restart # processname: tomcat # chkconfig: 234 20 80 export JAVA_HOME=/usr/java/jdk1.6.0_35 export ...

PHP File Upload Size Setting

at CentOS ( or Another Linux OS ), find php.ini

# find / -name php.ini

and execute vim editor and find this

# vim /.../php.ini
post_max_size = 8M
upload_max_filesize = 8M

change this that you want.
must change both var.

CentOS Apache Setting

Apache Install # yum -y install httpd* # /etc/rc.d/init.d/httpd start Apache Setting # vim /etc/httpd/conf/httpd.conf change Home Directory & Setting Virtual Host DirectoryIndex index.html index.html index.php . . <VirtualHost *:80> DocumentRoot /home/user ServerName * </VirtualHost> Add your custom host <VirtualHost proinlab.com> DocumentRoot /home/user ServerName proinlab.com ServerAlias www.proinlab.com </VirtualHost>  Permission Setting change ...

InetAddress를 이용한 특정 도메인의 IP 주소 구하기

www.google.com 의 IP 주소를 구하는 프로그램이다. import java.net.Inet4Address; import java.net.InetAddress; import java.net.UnknownHostException; public class InetAddress_01 { public static void main(String[] ar) throws Exception { String[] StrArr = GetIPAddressByName(); for (int i = 0; i < StrArr.length; i++) System.out.println("IP address : " + StrArr[i]); } public static String[] GetIPAddressByName() { InetAddress[] ia = null; ...