리눅스에서 tomcat 설치는 느무느무 쉽다.

그냥 압축을 풀어놓고 서비스를 띄우면 그만이다.

슉슉~

사용자 삽입 이미지




















http://tomcat.apache.org/


원하는 버전의 tomcat 을 다운받자... 여기서는 6버전을 다운... core 의 tar.gz 로 되어있는것을 받으면 된다.

/usr/local 에 다운 받았다.



[root@blogserver local]# pwd
/usr/local
[root@blogserver local]# ls -al
합계 112848
drwxr-xr-x. 15 root root      4096 2011-05-19 04:40 .
drwxr-xr-x. 13 root root      4096 2011-05-17 00:45 ..
-rw-r--r--   1 root root   6507748 2011-05-19 04:39 apache-tomcat-6.0.32.tar.gz
drwxr-xr-x.  2 root root      4096 2010-04-20 01:32 bin
drwxr-xr-x.  2 root root      4096 2010-04-20 01:32 etc
drwxr-xr-x.  2 root root      4096 2010-04-20 01:32 games
drwxr-xr-x.  2 root root      4096 2010-04-20 01:32 include
-rwxr-xr-x   1 root root  85315136 2011-05-19 03:27 jdk-6u25-linux-x64.bin
drwxr-xr-x  10 root root      4096 2011-05-19 03:29 jdk1.6.0_25
drwxr-xr-x.  2 root root      4096 2010-04-20 01:32 lib
drwxr-xr-x.  2 root root      4096 2010-04-20 01:32 lib64
drwxr-xr-x.  2 root root      4096 2010-04-20 01:32 libexec
drwxr-xr-x  11 root root      4096 2011-05-17 02:39 mysql
drwxrwxrwx  32 7155 wheel     4096 2011-05-17 02:37 mysql-5.1.57
-rw-r--r--   1 root root  23660514 2011-05-17 02:23 mysql-5.1.57.tar.gz
drwxr-xr-x.  2 root root      4096 2010-04-20 01:32 sbin
drwxr-xr-x.  5 root root      4096 2011-05-17 00:45 share
drwxr-xr-x.  2 root root      4096 2010-04-20 01:32 src
-rw-r--r--   1 root root       416 2011-05-19 03:57 test.class
-rw-r--r--   1 root root       106 2011-05-19 03:57 test.java
[root@blogserver local]#




압축을 풀어준다.



[root@blogserver local]# tar -xvf apache-tomcat-6.0.32.tar.gz
[root@blogserver local]# ls -al

합계 112852
drwxr-xr-x. 16 root root      4096 2011-05-19 04:41 .
drwxr-xr-x. 13 root root      4096 2011-05-17 00:45 ..
drwxr-xr-x   9 root root      4096 2011-05-19 04:41 apache-tomcat-6.0.32
-rw-r--r--   1 root root   6507748 2011-05-19 04:39 apache-tomcat-6.0.32.tar.gz
drwxr-xr-x.  2 root root      4096 2010-04-20 01:32 bin
drwxr-xr-x.  2 root root      4096 2010-04-20 01:32 etc
drwxr-xr-x.  2 root root      4096 2010-04-20 01:32 games
drwxr-xr-x.  2 root root      4096 2010-04-20 01:32 include
-rwxr-xr-x   1 root root  85315136 2011-05-19 03:27 jdk-6u25-linux-x64.bin
drwxr-xr-x  10 root root      4096 2011-05-19 03:29 jdk1.6.0_25
drwxr-xr-x.  2 root root      4096 2010-04-20 01:32 lib
drwxr-xr-x.  2 root root      4096 2010-04-20 01:32 lib64
drwxr-xr-x.  2 root root      4096 2010-04-20 01:32 libexec
drwxr-xr-x  11 root root      4096 2011-05-17 02:39 mysql
drwxrwxrwx  32 7155 wheel     4096 2011-05-17 02:37 mysql-5.1.57
-rw-r--r--   1 root root  23660514 2011-05-17 02:23 mysql-5.1.57.tar.gz
drwxr-xr-x.  2 root root      4096 2010-04-20 01:32 sbin
drwxr-xr-x.  5 root root      4096 2011-05-17 00:45 share
drwxr-xr-x.  2 root root      4096 2010-04-20 01:32 src
-rw-r--r--   1 root root       416 2011-05-19 03:57 test.class
-rw-r--r--   1 root root       106 2011-05-19 03:57 test.java
[root@blogserver local]#



./startup.sh 로 서비스를 띄운다. 끌때는 ./shutdown.sh

띄운후 프로세스도 한번 확인해주자.


[root@blogserver bin]# pwd
/usr/local/apache-tomcat-6.0.32/bin
[root@blogserver bin]# ./startup.sh
Using CATALINA_BASE:   /usr/local/apache-tomcat-6.0.32
Using CATALINA_HOME:   /usr/local/apache-tomcat-6.0.32
Using CATALINA_TMPDIR: /usr/local/apache-tomcat-6.0.32/temp
Using JRE_HOME:        /usr/local/jdk1.6.0_25
Using CLASSPATH:       /usr/local/apache-tomcat-6.0.32/bin/bootstrap.jar
[root@blogserver bin]#
[root@blogserver bin]#
[root@blogserver bin]# ps -ef | grep java
root      4960     1 36 04:42 pts/1    00:00:03 /usr/local/jdk1.6.0_25/bin/java -Djava.util.logging.config.file=/usr/local/apache-tomcat-6.0.32/conf/logging.properties -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager -Djava.endorsed.dirs=/usr/local/apache-tomcat-6.0.32/endorsed -classpath /usr/local/apache-tomcat-6.0.32/bin/bootstrap.jar -Dcatalina.base=/usr/local/apache-tomcat-6.0.32 -Dcatalina.home=/usr/local/apache-tomcat-6.0.32 -Djava.io.tmpdir=/usr/local/apache-tomcat-6.0.32/temp org.apache.catalina.startup.Bootstrap start
root      4981  4651  0 04:42 pts/1    00:00:00 grep --color=auto java
[root@blogserver bin]#



방화벽이 죽어있다면 브라우저에서

http://서버아이피:8080

으로 접속했을때 호랭이가 나오면 정상이다.


방화벽을 사용중이라면 8080 포트를 열어주자.



[root@blogserver bin]# vi /etc/sysconfig/iptables

# Firewall configuration written by system-config-firewall
# Manual customization of this file is not recommended.
*filter
:INPUT ACCEPT [0:0]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [0:0]
-A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
-A INPUT -p icmp -j ACCEPT
-A INPUT -i lo -j ACCEPT

-A INPUT -m state --state NEW -m tcp -p tcp --dport 8103 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 3306 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 21 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 8080 -j ACCEPT

-A INPUT -j REJECT --reject-with icmp-host-prohibited
-A FORWARD -j REJECT --reject-with icmp-host-prohibited
COMMIT



[root@blogserver bin]#
[root@blogserver bin]# /etc/init.d/iptables restart
iptables: 방화벽 규칙을 지웁니다: [  OK  ]
iptables: chain을 ACCEPT 규칙으로 설정 중:  filter [  OK  ]
iptables: 모듈을 언로드하는 중: [  OK  ]
iptables: 방화벽 규칙 적용 중:  [  OK  ]
[root@blogserver bin]#
[root@blogserver bin]# /etc/init.d/iptables status
테이블: filter
Chain INPUT (policy ACCEPT)
num  target     prot opt source               destination        
1    ACCEPT     all  --  0.0.0.0/0            0.0.0.0/0           state RELATED,ESTABLISHED
2    ACCEPT     icmp --  0.0.0.0/0            0.0.0.0/0          
3    ACCEPT     all  --  0.0.0.0/0            0.0.0.0/0          
4    ACCEPT     tcp  --  0.0.0.0/0            0.0.0.0/0           state NEW tcp dpt:8103
5    ACCEPT     tcp  --  0.0.0.0/0            0.0.0.0/0           state NEW tcp dpt:3306
6    ACCEPT     tcp  --  0.0.0.0/0            0.0.0.0/0           state NEW tcp dpt:21
7    ACCEPT     tcp  --  0.0.0.0/0            0.0.0.0/0           state NEW tcp dpt:8080 
8    REJECT     all  --  0.0.0.0/0            0.0.0.0/0           reject-with icmp-host-prohibited

Chain FORWARD (policy ACCEPT)
num  target     prot opt source               destination        
1    REJECT     all  --  0.0.0.0/0            0.0.0.0/0           reject-with icmp-host-prohibited

Chain OUTPUT (policy ACCEPT)
num  target     prot opt source               destination        

[root@blogserver bin]#




브라우져에서 확인해보믄...

사용자 삽입 이미지


호랭이 안뇽?





05 19, 2011 05:00 05 19, 2011 05:00
iamback 이 작성.

Trackback URL : http://pippen80.cafe24.com/trackback/271

Trackback RSS : http://pippen80.cafe24.com/rss/trackback/271

Trackback ATOM : http://pippen80.cafe24.com/atom/trackback/271


« Prev : 1 : ... 14 : 15 : 16 : 17 : 18 : 19 : 20 : 21 : 22 : ... 251 : Next »