728x90
반응형

 

 

 

 

Ubuntu Linux] jdk 환경(PATH) 설정 및 톰켓 서버 실행하기

 

 

 

1. PATH 설정하기

    - /etc/environment

javanian@ubuntu:~$ cat /etc/environment
PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin"
javanian@ubuntu:~$

 

javanian@ubuntu:~$ sudo vi /etc/environment
[sudo] password for javanian:
javanian@ubuntu:~$ cat /etc/environment
PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/usr/local/java/jdk-19.0.2/bin"
javanian@ubuntu:~$

 

javanian@ubuntu:~$ echo $PATH
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin
javanian@ubuntu:~$ source /etc/environment
javanian@ubuntu:~$ echo $PATH
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/usr/local/java/jdk-19.0.2/bin
javanian@ubuntu:~$

 

javanian@ubuntu:~$ cat ~/.profile
# ~/.profile: executed by the command interpreter for login shells.
# This file is not read by bash(1), if ~/.bash_profile or ~/.bash_login
# exists.
# see /usr/share/doc/bash/examples/startup-files for examples.
# the files are located in the bash-doc package.

# the default umask is set in /etc/profile; for setting the umask
# for ssh logins, install and configure the libpam-umask package.
#umask 022

# if running bash
if [ -n "$BASH_VERSION" ]; then
    # include .bashrc if it exists
    if [ -f "$HOME/.bashrc" ]; then
        . "$HOME/.bashrc"
    fi
fi

# set PATH so it includes user's private bin if it exists
if [ -d "$HOME/bin" ] ; then
    PATH="$HOME/bin:$PATH"
fi

# set PATH so it includes user's private bin if it exists
if [ -d "$HOME/.local/bin" ] ; then
    PATH="$HOME/.local/bin:$PATH"
fi
javanian@ubuntu:~$ source ~/.profile
javanian@ubuntu:~$ echo $PATH
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/usr/local/java/jdk-19.0.2/bin
javanian@ubuntu:~$

 

※ PATH 설정 요약

cat /etc/environment
sudo vi /etc/environment
 - PATH 추가
source /etc/environment
cat ~/.profile
source ~/.profile
echo $PATH

 

 

 

2. 톰켓 서버 실행하기

    - /usr/local/tomcat/apache-tomcat-11.0.0-M1/bin/startup.sh
    - /usr/local/tomcat/apache-tomcat-11.0.0-M1/bin/shutdown.sh

 

javanian@ubuntu:~$ /usr/local/tomcat/apache-tomcat-11.0.0-M1/bin/startup.sh
Using CATALINA_BASE:   /usr/local/tomcat/apache-tomcat-11.0.0-M1
Using CATALINA_HOME:   /usr/local/tomcat/apache-tomcat-11.0.0-M1
Using CATALINA_TMPDIR: /usr/local/tomcat/apache-tomcat-11.0.0-M1/temp
Using JRE_HOME:        /usr
Using CLASSPATH:       /usr/local/tomcat/apache-tomcat-11.0.0-M1/bin/bootstrap.jar:/usr/local/tomcat/apache-tomcat-11.0.0-M1/bin/tomcat-juli.jar
Using CATALINA_OPTS:
Tomcat started.

 

    - ps -ef | grep tomcat

 

 

3. 웹(톰켓) 서버 접속하기

    - w3m http://localhost:8080

javanian@ubuntu:~$ w3m http://localhost:8080
Command 'w3m' not found, but can be installed with:
sudo apt install w3m
javanian@ubuntu:~$ sudo apt install w3m
[sudo] password for javanian:
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done

 

 

 

4. Client에서 웹(톰켓) 서버 접속하기

    - 포트 포워딩 : 8080 포트

 

 

    - http://192.168.140.1:8080/

    - http://localhost:8080/

 

 

 

 

728x90
반응형

+ Recent posts