반응형

우선 업무특성상 인터넷 망 영역에서 WAS 시스템이 있어야 한다는 조건이 발생했다....

보안땜시 그렇다고 하는데....

후우...

* 기타 파일들
  - admin 설치용
  - jdk 1.4 호환용

  - 개발자 설치용
  - 전체 document
    - 윈도우 설치용


1. 아래의 사이트에서 톰켓 SRC 버젼을 받는다.
    - 사실 jsp 를 통한 서블릿 과정을 진행할려고 하여 별도의 apache 연동은 없다 ! (웹 서버가 필요하면 별도의 아파치 연동과정을 찾아볼것!)
    - 단순한 한개의 jsp 페이지의 값을 넘겨 주기만 할것임 !
    - 다운로드 주소 : http://tomcat.apache.org/download-55.cgi#5.5.31
- Core부분의 tar.gz을 클릭

2. 클릭하면 저장을 할 수 있다.


3. 설치할 AIX 시스템에 FTP로 전송한다.
    - 계정 root
    - 경로 /usr/local/

4. root 계정으로 쉘 접속을 한다.
    - 아래의 명령을 실행한다.
 # cd /usr/local/
 # gzip -d apache-tomcat-5.5.31.tar.gz
 # tar xvf apache-tomcat-5.5.31.tar
 # ln -s /usr/local/apache-tomcat-5.5.31 /usr/local/tomcat
 # useradd -d /home/tomcat -g staff tomcat
 # passwd tomcat
 # mkdir /home/tomcat
 # chown -R tomcat:staff /usr/local/apache-tomcat-5.5.31 /usr/local/tomcat
 # chown -R tomcat:staff /home/tomcat

5. tomcat 계정으로 접속 후 .profile 파일을 변경처리 한다.

 if [ -s "$MAIL" ]                  # This is at Shell startup.  In normal
        then echo "$MAILMSG"       # operation, the Shell checks
fi                                 # periodically.


export JAVA_HOME=/usr/java5_64

set -o vi

PATH=/usr/bin:/etc:/usr/sbin:/usr/ucb:$HOME/bin:/usr/bin/X11:/sbin:${JAVA_HOME}/jre/bin:${JAVA_HOME}/bin:/usr/local/bin:/usr/local/tomcat/bin:.

stty erase ^?

export LANG=ko_KR

export PS1=[`hostname`:\$PWD]

umask 022


######### Tomcat 환경 변수 등록 #############

export CATALINA_HOME=/usr/local/tomcat


6. 다시 tomcat 계정으로 접속한다.
$> startup.sh 실행 후 (기동 명령)
$> ps -ef | grep startup.sh 조회시 프로세서가 조회되면 정상작동
$> shutdown.sh 실행 후 (종료 명령)
$> ps -ef | grep startup.sh 조회시 프로세서가 조회되지 않아야 정상 종료

위의 startup.sh 실행후 http://서버IP:8080/ 조회하면 노란 고양이를 만날수 있다.

포트 변경은 /usr/local/tomcat/conf/server.xml 파일내의 8080 포트를 검색하여 수정하면 된다(다른 포트와 충돌시 가동하지 않음)

※ 만약 기본 webapps 폴더이외의 홈 경로를 변경하고 싶다면...

/usr/local/tomcat/conf/Catalina/localhost/ROOT.xml 파일 생성

아래의 docBase 내용의 /home/myweb 디렉토리가 홈 디렉토리로 설정된다.

ROOT.xml 파일 내용
 <?xml version="1.0" encoding="UTF-8"?>
<Context path="" docBase="/home/myweb" debug="0" privileged="true" reloadable="true">
<Logger className="org.apache.catalina.logger.FileLogger" directory="logs"  prefix="localhost_log." suffix=".txt" timestamp="true"/>
</Context>



** 보안 취약 사항 수정 방법
telnet 호스트주소 8080
OPTIONS * HTTP/1.0

HTTP/1.1 200 OK
Server: Apache-Coyote/1.1
Allow: GET, HEAD, POST, PUT, DELETE, OPTIONS
Content-Length: 0
Date: Thu, 23 Jun 2011 08:25:16 GMT
Connection: close

위의 PUT과 DELETE의 불필요한 메소드가 활성화 되어 위험함

제거 방법

/usr/local/tomcat/conf/web.xml 파일 제일 하단부에 붉은 색 표기와 같은 형태로 입력하면 됨

     <welcome-file-list>
        <welcome-file>index.html</welcome-file>
        <welcome-file>index.htm</welcome-file>
        <welcome-file>index.jsp</welcome-file>
    </welcome-file-list>


 <security-constraint>
 <web-resource-collection>
  <web-resource-name>Protected Context</web-resource-name>
  <url-pattern>/*</url-pattern>
    <http-method>HEAD</http-method>
    <http-method>TRACE</http-method>
    <http-method>OPTIONS</http-method>
 </web-resource-collection>
 <auth-constraint />
 </security-constraint>

   <security-constraint>
     <web-resource-collection>
        <web-resource-name>Protected Context</web-resource-name>
         <url-pattern>/servlet/org.apache.catalina.servlets.DefaultServlet/*</url-pattern>
      </web-resource-collection>
      <!-- auth-constraint goes here if you requre authentication -->
      <user-data-constraint>
         <transport-guarantee>CONFIDENTIAL</transport-guarantee>
      </user-data-constraint>
   </security-constraint>

</web-app>

 




조치 결과
telnet 호스트주소 8080
OPTIONS * HTTP/1.0

HTTP/1.1 403 Forbidden
Server: Apache-Coyote/1.1
Pragma: No-cache
Cache-Control: no-cache
Expires: Thu, 01 Jan 1970 09:00:00 KST
Content-Type: text/html;charset=utf-8
Content-Length: 1108
Date: Thu, 23 Jun 2011 11:07:09 GMT
Connection: close

<html><head><title>Apache Tomcat/5.5.31 - Error report</title><style><!--H1 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:22px;} H2 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:16px;} H3 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:14px;} BODY {font-family:Tahoma,Arial,sans-serif;color:black;background-color:white;} B {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;} P {font-family:Tahoma,Arial,sans-serif;background:white;color:black;font-size:12px;}A {color : black;}A.name {color : black;}HR {color : #525D76;}--></style> </head><body><h1>HTTP Status 403 - Access to the requested resource has been denied</h1><HR size="1" noshade="noshade"><p><b>type</b> Status report</p><p><b>message</b> <u>Access to the requested resource has been denied</u></p><p><b>description</b> <u>Access to the specified resource (Access to the requested resource has been denied) has been forbidden.</u></p><HR size="1" noshade="noshade"><h3>Apache Tomcat/5.5.31</h3></body></html>Connection closed by foreign host.


반응형

'OS > AIX' 카테고리의 다른 글

bff 파일 설치 (AIX)  (0) 2010.12.08
IBM AIX 용 JAVA 다운로드 주소  (0) 2010.12.07
AIX 시스템 점검 쉘  (0) 2010.06.04
Xmanager on AIX 5.3  (1) 2010.02.09
How to install/start/restart the X11 server under AIX  (0) 2010.02.05

+ Recent posts