본문 바로가기
WEB|WAS/Tomcat

centos7 tomcat8 install

by 개폰지밥 2021. 4. 19.
반응형

l  VirtualBox 에러

기존에 스냅샷 해놓은 centos7 가져오다가 생긴 에러

Implementation of the USB 2.0 controller not found!

 

=> 에러 해결

USB Disable 시켜줌.

 

l  Tomcat 설치

- 설치

wget https://mirror.apache-kr.org/apache/tomcat/tomcat-8/v8.5.65/bin/apache-tomcat-8.5.65.tar.gz

- 압축풀기

tar -xvf apache-tomcat-8.5.65.tar.gz

- 환경설정

vi ~/.bash_profile

CATALINA_HOME=/root/tomcat/apache-tomcat-8.5.65
PATH=$PATH:$HOME/bin:$CATALINA_HOME/bin
export CATALINA_HOME
export PATH

-

source ~/.bash_profile

 

l  Wget 에러

1)

-bash: wget: command not found

=> yum install wget으로 해결

2)

ERROR: cannot verify mirror.apache-kr.org's certificate, issued by ‘/O=AO Kaspersky Lab/CN=Kaspersky Endpoint Security Personal Root Certificate’:

  Self-signed certificate encountered.

To connect to mirror.apache-kr.org insecurely, use `--no-check-certificate'.

ð  wget https://mirror.apache-kr.org/apache/tomcat/tomcat-8/v8.5.65/bin/apache-tomcat-8.5.65.tar.gz --no-check-certificate

 

l  tomcat 설치 에러

[root@localhost apache-tomcat-8.5.65]# cd bin

[root@localhost bin]# startup.sh

Neither the JAVA_HOME nor the JRE_HOME environment variable is defined

At least one of these environment variable is needed to run this program

=> open jdk 설치

yum install java-1.8.0-openjdk

yum install java-1.8.0-openjdk-devel

/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.282.b08-1.el7_9.x86_64/jre/bin

 

l  centos7 gui모드로 키기

Run revel 확인하기

systemctl get-default

multi-user.target

=> run level 3cli모드이다. graphical 모드로 변경한다.

=> 영구적으로 변경하는 방법(gui)

systemctl set-default graphical.target

=>  한번만 바꾸어 사용하는 방법

systemctl isolate graphical.target

그 후 reboot

[root@localhost etc]# reboot

그래도 되지 않아서

yum -y groupinstall "GNOME Desktop" "Graphical Administration Tools"

python-firewall.noarch 0:0.6.3-12.el7

  systemd.x86_64 0:219-78.el7_9.3

  systemd-libs.x86_64 0:219-78.el7_9.3

  systemd-sysv.x86_64 0:219-78.el7_9.3

 

Complete!

Reboot

=>  성공

l  Tomcat 실행 오류

[root@localhost ~]# cd /root/tomcat/apache-tomcat-8.5.65/logs

[root@localhost logs]# tail -f catalina.out

로그를 보도록 함.

/root/tomcat/apache-tomcat-8.5.65/bin/catalina.sh: line 504: /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.282.b08-1.el7_9.x86_64/jre/bin/java/bin/java: 디렉터리가 아닙니다

Java 위치가 잘 안 잡혀있나봄.

# User specific environment and startup programs
JAVA_HOME=/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.282.b08-1.el7_9.x86_64
CLASSPATH=$JAVA_HOME/jre/lib:$JAVA_HOME/lib/tools.jar
CATALINA_HOME=/root/tomcat/apache-tomcat-8.5.65
PATH=$PATH:$HOME/bin:$CATALINA_HOME/bin
export JAVA_HOME CATALINA_HOME
export PATH

 

JAVA_HOME, CLASSPATH을 잘 설정해야한다!

수정후 다시 tomcat 재시작

 

l  Mysql 접속 에러

로컬에 설치되어있는 mysql db를 가상머신(virtualbox)에서 접속까지 되는데 fido db를 사용할 수 없는 문제 발생.

### Cause: org.springframework.jdbc.CannotGetJdbcConnectionException: Could not get JDBC Connection; nested exception is org.apache.commons.dbcp.SQLNestedException: Cannot create PoolableConnectionFactory (Access denied for user 'fido'@'%' to database 'fido')

혹은

use fido를 했을 때

ERROR 1044 (42000): Access denied for user 'fido'@'%' to database 'fido'

=> 해결

mysql> grant all privileges on fido.*to'fido'@'%';

Query OK, 0 rows affected (0.00 sec)

 

mysql> flush privileges;

Query OK, 0 rows affected (0.00 sec)

반응형

'WEB|WAS > Tomcat' 카테고리의 다른 글

tomcat war 구축시 생기는 에러  (0) 2021.05.13
[Tibero] JNDI 설정  (0) 2021.05.13
[MYSQL] JNDI 설정  (0) 2021.03.17
tomcat multi instance 구성  (0) 2021.02.23
web server vs was server, tomcat structure, how to use sv  (0) 2020.09.11

댓글