민서네집

CentOS - JDK 설치/ tomcat 을 서비스로 등록/ FireFox 설치 본문

LINUX

CentOS - JDK 설치/ tomcat 을 서비스로 등록/ FireFox 설치

브라이언7 2013. 11. 21. 11:45

리눅스 JDK 설치


http://jmnote.com/wiki/%EB%A6%AC%EB%88%85%EC%8A%A4_JDK_%EC%84%A4%EC%B9%98


JDK를 설치하고 나서 JAVA_HOME 환경변수 셋팅.


/etc/profile.d/java_env.sh 파일 생성.

export JAVA_HOME=/usr/lib/jvm/java-1.7.0-openjdk

export PATH=$JAVA_HOME/bin:$PATH


< Install Tomcat 7 on CentOS, RHEL, or Fedora >

=> http://www.davidghedini.com/pg/entry/install_tomcat_7_on_centos


http://tomcat.apache.org/download-70.cgi 에 들어가서

Core 항목에서 tar.gz 을 다운로드 받음.


[참조]

< tomcat 을 서비스로 등록 >

http://www.davidghedini.com/pg/entry/install_tomcat_7_on_centos


< 리눅스에서 tomcat을 서비스에 등록하기 >

http://blog.naver.com/frogx/130004946234


* 아래 예제는 tomcat 사용자로 서비스를 실행하는 예제이다. (  /bin/su tomcat ~~~ 으로 되어 있는 부분 )


#!/bin/bash
# location: /etc/rc.d/init.d/tomcat
# description: Tomcat Start Stop Restart
# processname: tomcat
# chkconfig: 2345 80 20

CATALINA_HOME=/var/lib/apache-tomcat-7.0.47

case $1 in
start)
echo -n "Starting tomcat: "
echo
echo
/bin/su tomcat $CATALINA_HOME/bin/startup.sh
echo
;; 
stop)   
echo -n "Shutting down tomcat: "
echo
echo
/bin/su tomcat $CATALINA_HOME/bin/shutdown.sh
echo
;; 
restart)
$0 stop
sleep 5
$0 start
;; 
*)
echo "Usage: $0 {start|stop|restart}"
exit 1
esac    
exit 0


MySQL 을 설치하면 /etc/rc.d/init.d/mysql 쉘스크립트 파일이 생기는데, 

그 안의 내용을 보면,


# chkconfig: 2345 64 36


으로 되어 있다.

Tomcat 서버가 MySQL 서버보다 나중에 떠야 하고, 종료할 때는 먼저 종료하는 것이 좋으므로
tomcat 쉘스크립트 파일 안에 

# chkconfig: 2345 80 20

으로 수정하였다.

[2015.06.19 추가]
# sudo apt-get install chkconfig   (패키지 설치)
# chkconfig tomcat 2345   (2345 run level 에서 서비스 등록)
# chkconfig --list           (확인)

Ubuntu 에서는 chkconfig 대신에 sysv-rc-conf 를 쓰라고 한다.


# sudo apt-get install sysv-rc-conf   (패키지 설치)

# sysv-rc-conf tomcatA on  (서비스 등록)

# sysv-rc-config --list    (확인)


< CentOS 6.4 버전에서 tomcat7 을 설치 >


http://blog.cloudpack.jp/2013/01/server-news-centos6-tomcat7-rpm-yum.html


< CentOS 6 에서 Google Chrome Browser 설치 >


http://www.tecmint.com/install-google-chrome-on-redhat-centos-fedora-linux/


changing security context of `/opt/google/chrome/lib'

*** /opt/google/chrome tree contains 101 files totalling 161 MB ...

*** /tmp/chrome_install tree contains 7 files totalling 67 MB ...


Google Chrome 31.0.1650.57 and Fedora 15 libraries installed successfully.

Please run the browser via the 'google-chrome' command as a non-root user.


To update Google Chrome, run "yum update google-chrome-stable" or

simply re-run this script with "./install_chrome.sh".

To uninstall Google Chrome and its dependencies added by this script,

run "yum remove google-chrome-stable chrome-deps" or "./install_chrome.sh -u".



WARNING:

Google Chrome 31.0.1650.57 can't run nacl_helper with SELINUX=enforcing

(you will see terminal messages to that effect), which may disable sandboxing.

A workaround is to set SELINUX=permissive in /etc/selinux/config and reboot..


실행 안됨.


[admin@localhost Desktop]$ google-chrome &

[1] 2187

[admin@localhost Desktop]$ /usr/bin/google-chrome: /usr/lib/libnss3.so: version `NSS_3.14.3' not found (required by /usr/bin/google-chrome)


/etc/selinux/config 파일에서

SELINUX=permissive

로 수정해도 마찬가지로 구글 크롬을 Linux 에서 실행 시킬 수는 없었다.


< Install Latest Mozilla Firefox 23 On CentOS RHEL 6.4 >


http://linuxdrops.com/install-latest-mozilla-firefox-23-on-centos-rhel-6-4/


< Yum으로 톰캣7 설치하는 방법 설명 >


http://jmnote.com/wiki/Yum%EC%9C%BC%EB%A1%9C_%ED%86%B0%EC%BA%A37_%EC%84%A4%EC%B9%98


Tomcat 7 을 설치하는 것은 Tomcat 아파치 홈페이지에 가서 다운로드 받아서 압축 풀고 서비스로 등록하는 것이 가장 편한 것 같다.


Comments