[Linux] java ¹× tomcat rpm ¼³Ä¡

   Á¶È¸ 6556   Ãßõ 1    

http://ehostidc.co.kr/center/EH050402.php?no=141441&choose=title&keyw¡¦ (356)
http://ehostidc.co.kr/cld/EH020201.php?ke=0 (325)



java 와 톰캣 설치를 CentOS 7 에서 제공하는 rpm 으로 설치 후 설정 등에 대한 간단 정리

- java 1.8 openjdk, tomcat 7

1. java 설치

[root@localhost opt]# yum install java-1.8.0-openjdk-devel.x86_64


2. java 확인

[root@localhost opt]# cat HelloWorld.java
public class HelloWorld {
public static void main(String[] args) {
System.out.println("Hello, EhostIDC");
}
}

[root@localhost opt]# javac HelloWorld.java
[root@localhost opt]# java HelloWorld




3. JAVA_HOME 확인

[root@localhost opt]# echo $JAVA_HOME



[root@localhost opt]# which javac



[root@localhost opt]# readlink -f /usr/bin/javac

[root@localhost opt]# vi /etc/profile

export JAVA_HOME=/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.161-0.b14.el7_4.x86_64



[root@localhost opt]# source /etc/profile
[root@localhost opt]# echo $JAVA_HOME



4. tomcat 설치

[root@localhost bin]# yum install tomcat


[root@EhostIDC ~]# systemctl enable tomcat
Created symlink from /etc/systemd/system/multi-user.target.wants/tomcat.service to /usr/lib/systemd/system/tomcat.service.
[root@EhostIDC ~]# systemctl start tomcat

5. mod_jk 설치

[root@EhostIDC native]# yum install autoconf gcc libtool httpd-devel

[root@EhostIDC opt]# wget http://apache.mirror.cdnetworks.com/tomcat/tomcat-...
[root@EhostIDC opt]# cd /opt/tomcat-connectors-1.2.42-src/native/

[root@EhostIDC native]# ./buildconf.sh
[root@EhostIDC native]# ./configure --with-apxs=/usr/bin/apxs
[root@EhostIDC native]# make
[root@EhostIDC native]# make install

6. mod_jk 설정 파일

[root@EhostIDC native]# cd /etc/httpd/conf.modules.d/

[root@EhostIDC conf.modules.d]# vi 00-jk.conf
LoadModule jk_module modules/mod_jk.so

[root@EhostIDC conf.d]# vi /etc/httpd/conf/jk.conf

#work properties
JkWorkersFile conf.d/workers.properties

#log format
JkLogStampFormat "[%a %b %d %H:%M:%S %Y] "

# JK error log
JkLogFile logs/mod_jk.log

# JK log level
JkLogLevel info

# JK shared memory file
JkShmFile logs/mod_jk.shm

# define the name of the file here.
# JkMountFile conf.d/uriworkermap.properties


JkMount /*.do tomcat1

JkMount /*.jsp tomcat1


JkMount 에 할당된 이름에 대해 worker.properties 에서 worker 리스트 할당 및 맵핑 처리


[root@EhostIDC conf.d]# vi workers.properties

##single instance
worker.list=tomcat1


worker.tomcat1.port=8009

# tomcat server.xml

#


worker.tomcat1.host=tomcat IP
worker.tomcat1.type=ajp13

##multi instance
#worker.list=instance1,instance2,instance3

##server 1

#worker.instance1.port=8109
#worker.instance1.host=jsp2.ehostidc.co.kr
#worker.instance1.type=ajp13
#worker.instance1.lbfactor=1


##server 2
#worker.instance2.port=8109
#worker.instance2.host=jsp2.ehostidc.co.kr
#worker.instance2.type=ajp13
#worker.instance2.lbfactor=1


##server 3
#worker.instance3.port=8109
#worker.instance3.host=jsp3.ehostidc.co.kr
#worker.instance3.type=ajp13
#worker.instance3.lbfactor=1




7. 한글 인코딩 처리
[root@EhostIDC tomcat]# vi /etc/tomcat/server.xml

8. oracle jdk download 경로

http://www.oracle.com/technetwork/java/javase/down...









https://www.aiocp.co.kr/ ( 딥러닝,머신러닝 서버 판매 ,컨설팅) https://bigbangcloud.co.kr/ ( GPU 클라우드 서비스) ::: AI 서버의 모든것 ::: 인공지능의 시작~ (주)이호스트ICT
ªÀº±Û Àϼö·Ï ½ÅÁßÇÏ°Ô.


PDS
Á¦¸ñPage 21/77
2014-05   4947742   Á¤ÀºÁØ1
2015-12   1484436   ¹é¸Þ°¡
2019-10   5773   PCMaster
2019-10   5279   µö·¯´×¼­¹ö
2019-10   7185   ¾Æ½º¶õ
2019-10   6265   µö·¯´×¼­¹ö
2019-10   4256   µö·¯´×¼­¹ö
2019-10   4601   µö·¯´×¼­¹ö
2019-10   4309   µö·¯´×¼­¹ö
2019-10   4138   Á¦°¥±âõ
2019-10   4521   µö·¯´×¼­¹ö
2019-10   5437   µö·¯´×¼­¹ö
2019-10   6557   µö·¯´×¼­¹ö
2019-10   7034   ½ºÄµl¹ÎÇö±â
2019-10   4436   µö·¯´×¼­¹ö
2019-10   4829   µö·¯´×¼­¹ö
2019-10   5384   ÇãÀα¸¸¶Æ¾
2019-09   7986   º¹»ó»ç
2019-09   8790   µö·¯´×¼­¹ö
2019-09   5357   µö·¯´×¼­¹ö
2019-09   5400   µö·¯´×¼­¹ö
2019-09   5724   µö·¯´×¼­¹ö