2015. 11. 19. 12:57
mac의 terminal에서 ssh로 Ubuntu로 접속시에 한글 깨짐현상 (Mac과 Ubuntu에서 모두 셋팅을 해줘야 한다.)

1. 한글 보기 문제 

locale 설정을 mac은 접속하는 터미널에서 실행, ubuntu는 ~/.bash_profile에 아래의 2줄을 추가하였다.

export LANG=’ko_KR.UTF-8′

export LC_ALL=’ko_KR.UTF-8′


2. 한글 입력 문제

mac은 접속하는 터미널에서 실행, ubuntu는 ~/.inputrc 파일에 아래 3줄을 추가하였다.

set convert-meta off

set meta-flag on

set output-meta on


3.vi 에서 한글이 깨질 경우

ubuntu에만 ~/.vimrc 파일에 아래 2줄을 추가하였다.

set encoding=utf-8

setfileencodings=utf-8,euckr

'Tip > 우분투' 카테고리의 다른 글

ubuntu mysql 설치  (0) 2016.05.04
Ununbu에 vsftpd 설치하기  (0) 2015.04.14
MySQL 기본적인 사용  (0) 2014.11.19
MySQL 원격접속 허용하기  (0) 2014.11.19
MySQL 접속  (0) 2014.11.19
Posted by 모바일헌터
2014. 11. 10. 22:36

1. tomcat 다운로드
 tomcat.apache.org로 이동하여 좌측의 Download에서 적당한 버전을 선택하고 Binary Distributions에서 Core: tar.gz를 다운로드 받는다.

2. 다운로드한 파일을 압축해제한 후 /opt밑으로 이동한다.
$ tar xvfz apache-tomcat-8.0.14.tar.gz
$ sudo mv 
apache-tomcat-8.0.14  /opt/tomcat8

3. tomcat의 버전정보와 시스템 정보를 확인해보자
$ cd /opt/tomcat8/bin
$ ./version.sh

Using CATALINA_BASE:   /opt/tomcat8
Using CATALINA_HOME:   /opt/tomcat8
Using CATALINA_TMPDIR: /opt/tomcat8/temp
Using JRE_HOME:        /usr/lib/jvm/jdk1.8.0/jre
Using CLASSPATH:       /opt/tomcat8/bin/bootstrap.jar:/opt/tomcat8/bin/tomcat-juli.jar
Server version: Apache Tomcat/8.0.14
Server built:   Sep 24 2014 09:01:51
Server number:  8.0.14.0
OS Name:        Linux
OS Version:     3.16.0-24-generic
Architecture:   amd64
JVM Version:    1.8.0_25-b17
JVM Vendor:     Oracle Corporation 

4. 시스템 설정을 검토해 보자
$ ./configtest.sh
◎ 만약 tomcat을 이미 실행했다면 종료를 한 후에 test를 진행해야 한다.

5. 사용자를 추가해봅시다.
$ sudo vi /opt/tomcat8/bin/
tomcat-users.xml 

...

  <role rolename="manager-gui"/>
  <role rolename="admin-gui"/>
  <user username="username" password="password" roles="manager-gui,admin-gui"/>
</tomcat-users>

username/password를 알맞게 설정해주세요.

6. 실행 및 종료
$ ./startup.sh         # 실행
$ ./shutdown.sh     # 종료

7. 실행/종료를 위한 스크립트를 init.d에 생성하자.
$ sudo vi /etc/init.d/tomcat8

#!/bin/sh
### BEGIN INIT INFO
# Provides:          tomcat8
# Required-Start:    $local_fs $remote_fs $network
# Required-Stop:     $local_fs $remote_fs $network
# Should-Start:      $named
# Should-Stop:       $named
# Default-Start:     2 3 4 5
# Default-Stop:      0 1 6
# Short-Description: Start Tomcat.
# Description:       Start the Tomcat servlet engine.
### END INIT INFO 
if [ `id -u` -ne 0 ]; then
    echo "You need root privileges to run this script"
    exit 1
fi
# Make sure tomcat is started with system locale
if [ -r /etc/default/locale ]; then
    . /etc/default/locale
    export LANG
fi
if [ -r /etc/default/rcS ]; then
    . /etc/default/rcS
fi
. /lib/lsb/init-functions

export CATALINA_HOME=/opt/tomcat8
PATH=/sbin:/bin:/usr/sbin:/usr/bin
start() {
 sh $CATALINA_HOME/bin/startup.sh
}
stop() {
 sh $CATALINA_HOME/bin/shutdown.sh
}
case $1 in
  start|stop) $1;;
  restart) stop; start;;
  *) echo "Run as $0 <start|stop|restart>"; exit 1;;
esac

$ sudo chmod 755 /etc/init.d/tomcat8

8. tomcat이 부팅시  자동 실행될 수 있도록 등록해줍시다.
$ sudo update-rc.d tomcat8 defaults

자동 실행을 해제
$ sudo update-rc.d tomcat8 remove

OSX의 Terminal에서 ssh로 로그인을 해서 작업중이라면 Perl locale error가 발생할 수 있다. [해결방법]
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
LANGUAGE = "en_US:en",
LC_ALL = (unset),
LC_CTYPE = "UTF-8",
LANG = "en_US.UTF-8"
    are supported and installed on your system.
perl: warning: Falling back to a fallback locale ("en_US.UTF-8”).

9. tomcat을 실행하고 Server Status를 확인해봅시다.
$ sudo /etc/init.d/tomcat8 start

http://localhost:8080을 오픈하여 보세요.
"Server Status" 버튼을 눌러서 5.에서 설정한 username과 password를 입력하여 Server Status를 확인해보세요.



참고) Apache + Tomcat + MySQL 설치 (우분투)


'Tip > 우분투' 카테고리의 다른 글

MySQL 유저관리  (0) 2014.11.12
Ubuntu의 명령라인에서 패키지 관리  (0) 2014.11.11
Ubuntu Server에 Apache httpd 설치하기  (0) 2014.11.10
Ubuntu Server에 GNU GCC컴파일러 설치  (0) 2014.11.10
Ubuntu에 SSH Server 설치하기  (0) 2014.11.10
Posted by 모바일헌터
2014. 11. 10. 20:54

0. 사전 준비

0.1 PCRE 최신 라이브러리 다운로드
pcre.org -> anonymous FTP를 이용해 최신 버전을 다운로드 받을 수 있는 사이트에 접속하여 최신 버전 다운로드

0.2 컴파일하고 설치하기
$ tar xvfz pcre-8.36
$ cd pcre-8.36
$ ./configure
$ make
$ sudo make install

0.3 pcre 라이브러리를 /usr/local/lib에 설치된다. 로드가 되지 않을 경우, 다음의 명령어를 입력한다.
$ sudo ldconfig


1. apache사이트에서 관련 파일 다운로드 받기

1.1 httpd 다운로드 하기
www.apache.org -> download -> mirror 사이트로 이동 -> httpd 선택 -> 최신 버전을 다운로드 (httd-2.4.10.tar.gz)를 다운로드

1.2 apr과 apr-util 다운로드 하기
www.apache.org -> download -> mirror 사이트로 이동 -> apr 선택택


2. 압축해제
$ tar xvfz httd-2.4.10.tar.gz
$ tar xvfz apr-1.5.1
$ tar xvfz apr-util-1.5.4

3. 이동
mv apr-1.5.1 httpd-2.4.10/srclib/apr
mv apr-util-1.5.4 httpd-2.4.10/srclib/apr-util


4. apache 컴파일 하고 설치하기 
$ cd httpd-2.4.10
$ ./configure --prefix=/usr/local/apache2
$ make
$ sudo make install


5. apache 시작 및 종료 
$ sudo /usr/local/apache2/bin/apachectl start

$ sudo /usr/local/apache2/bin/apachectl /etc/init.d/apache2
$ sudo invoke-rc.d apache2 start   $ sudo /etc/init.d/apache2 start  : 시작
$ sudo invoke-rc.d apache2 stop   $ sudo /etc/init.d/apache2 stop   : 종료

6. apache 정상동작 확인하기
$ sudo netstat -anp | grep httpd

7.  부팅 시 자동실행
$ sudo vi /etc/init.d/apache2

#!/bin/sh
### BEGIN INIT INFO
# Provides:          apache2
# Required-Start:    $local_fs $remote_fs $network $syslog $named
# Required-Stop:     $local_fs $remote_fs $network $syslog $named
# Default-Start:     2 3 4 5
# Default-Stop:      0 1 6
# X-Interactive:     true
# Short-Description: Apache2 web server
# Description:       Start the web server and associated helpers
### END INIT INFO
if [ `id -u` -ne 0 ]; then
    echo "You need root privileges to run this script"
    exit 1
fi
# Make sure tomcat is started with system locale
if [ -f /etc/default/locale ]; then
    . /etc/default/locale
    export LANG
fi
if [ -f /etc/default/rcS ]; then
    . /etc/default/rcS
fi
/lib/lsb/init-functions

$ sudo update-rc.d apache2 defaults 

자동실행을 중단하기위해서는
$ sudo update-rc.d apache2 remove
 

OSX의 Terminal에서 ssh로 로그인을 해서 작업중이라면 Perl locale error가 발생할 수 있다. [해결방법]
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
LANGUAGE = "en_US:en",
LC_ALL = (unset),
LC_CTYPE = "UTF-8",
LANG = "en_US.UTF-8"
    are supported and installed on your system.
perl: warning: Falling back to a fallback locale ("en_US.UTF-8”).

참고) Apache + Tomcat + MySQL 설치 (우분투)

Posted by 모바일헌터
2014. 10. 24. 16:34
아파치 설치

 $ sudo apt-get install apache2

>> 브라우저에서 "http://localhost"를 확인해보세요

- 소스를 빌드하여 설치하기: Ubuntu Server에 Apache httpd 설치하기


Tomcat 설치

 $ sudo apt-get install tomcat7


◎ 선택적으로 tomcat7-docs, tomcat7-examples, tomcat7-admin도 설치해주세요.

 $ sudo apt-get install tomcat7 tomcat7-docs tomcat7-examples tomcat7-admin


 다음의 파일에서 JDK의 폴더를 찾지 못하는 경우가 있습니다. 
$ vi /etc/init.d/tomcat7
JDK_DIRS=“/usr/lib/jvm/jdk1.8.0"

Open JDK보다 Oracle JDK를 사용하기 원하신다면 다음 링크를 참조하세요.

>> 브라우저에서 "http://localhost:8080"를 확인해보세요
default Tomcat home page: /var/lib/tomcat7/webapps/ROO/index.html
CATALINA_HOME: /usr/share/tomcat7
CATALINA_BASE: /var/lib/tomcat7

위와 같이 자동으로 설치 되었을 경우, 약간의 설정에 문제가 있으므로 다음의 글을 참조하여 설치하기를 권장한다. Ubuntu Server에 tomcat 설치

MySQL 설치

 $ sudo apt-get install mysql-server


동작확인하기

 $ sudo netstat -tap | grep mysql




'개발 거들기' 카테고리의 다른 글

소스를 블로그에 올릴 때  (0) 2016.05.12
ATOM에서 TODO관리하기  (0) 2015.12.21
git 로컬 저장소 생성(.git 폴더)  (0) 2015.01.14
git 수정사항 확인  (0) 2015.01.14
형상관리 툴 - (1) git  (0) 2014.09.20
Posted by 모바일헌터