[완료] tomcat5.5 에서 프로토콜(http/https)에 따라 자원 접근이 안되는 문제

yangkun의 이미지

Red Hat EL 4 에 Tomcat-5.5.2.7 만을 설치해 서비스 중입니다.

서버의 동일 자원의 접근 가능 여부가 http / https 요청에 따라 달라지고,
Alias 로 등록된 도메인에 따라 달라집니다.

https://www.xxx.com/contents/aa.do (O)
http://www.xxx.com/contents/aa.do (X)

http://www.yyy.com/board/styles.xml (O)
http://www.zzz.com/board/styles.xml (X)

404 Not Found 가 아닌 500 Server Error 가 발생합니다.

Host 설정은 www.xxx.com 으로 되어 있으며
www.yyy.comwww.zzz.com 은 Alias 로 설정되어 있습니다.

특정 확장자들에 대해서만 저런 현상을 보이고 있습니다.

스프링 MVC로 작업했고, 전체 어플리케이션은 동일하지만 도메인 별로 메뉴가 달라서
urlrewrite 3.0.4 를 앞에 붙여 사용하고 있습니다.

즉,

www.xxx.com/aaa/bbb --> urlrewriter 에 의해서 --> /xxx/aaa/bbb 요청으로 변경 --> web.xml 에 의해서 xxx 서블릿으로 식별 --> xxx-servlet.xml 환경으로 실행..

머 이런식입니다. 지혜를 빌려주세요 ㅠㅠ

다음은 server.xml, urlrewrite.xml, web.xml 입니다.
부끄러워 자세한 도메인및 경로는 ..... 처리 했습니다...;;

-------- server.xml ----------
 
<Server port="8005" shutdown="SHUTDOWN" debug="0">
  <Listener className="org.apache.catalina.mbeans.ServerLifecycleListener" debug="0"/>
  <Listener className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener" debug="0"/>
 
  <GlobalNamingResources>
    <Resource name="UserDatabase" auth="Container" type="org.apache.catalina.UserDatabase" factory="org.apache.catalina.users.MemoryUserDatabaseFactory" pathname="conf/tomcat-users.xml" />
  </GlobalNamingResources>
 
  <Service name="Catalina">
    <Connector port="443" maxThreads="150" minSpareThreads="25" maxSpareThreads="75"  enableLookups="false"
                 disableUploadTimeout="ture" acceptCount="100" debug="0" scheme="https" secure="true"
                 keystoreFile="........" keystorePass="123456"
                 clientAuth="false" sslProtocol="TLS" />
 
    <Connector port="444" maxThreads="150" minSpareThreads="25" maxSpareThreads="75"  enableLookups="false"
                 disableUploadTimeout="ture" acceptCount="100" debug="0" scheme="https" secure="true"
                 keystoreFile="......." keystorePass="123456"
                 clientAuth="false" sslPeotocol="TLS" />
 
    <Connector port="80"  maxThreads="512" minSpareThreads="60" maxSpareThreads="256" enableLookups="false"
               redirectPort="8443" acceptCount="100" debug="0" connectionTimeout="20000"
               disableUploadTimeout="true" useBodyEncodingForURI="true"/>
 
    <Engine name="Catalina" defaultHost="......" debug="0">
 
      <Realm className="org.apache.catalina.realm.UserDatabaseRealm" debug="0" resourceName="UserDatabase"/>
 
      <Host name="....." debug="0" appBase="/appl" unpackWARs="true" autoDeploy="false"
                                                                            xmlValidation="false" xmlNamespaceAware="false">
         <Valve className="org.apache.catalina.valves.AccessLogValve" directory="....."
                prefix="..." suffix=".txt" pattern="common" resolveHosts="false"/>
         <Context path="" docBase="......" reloadable="false"/>
      </Host>
 
      <Host name="......." debug="0" appBase="/appl" unpackWARs="false" autoDeploy="false"
                                                                             xmlValidation="false" xmlNamespaceAware="false">
         <!-- admin -->
         <Alias>....</Alias>
         <Alias>........</Alias>
 
         <!-- center -->
         <Alias>..</Alias>
         <Alias>...</Alias>
         <Alias>.....</Alias>
         <Alias>....</Alias>
         <Alias>.....</Alias>
         <Alias>....</Alias>
 
         <!-- center english -->
         <Alias>...</Alias>
         <Alias>....</Alias>
 
         <!-- center japan -->
         <Alias>....</Alias>
         <Alias>.....</Alias>
 
 
 
         <Valve className="org.apache.catalina.valves.AccessLogValve" directory="......."
                prefix="access_log." suffix=".txt" pattern="%h %v - %t &quot;%r&quot; %s %b" resolveHosts="false"/>
 
         <Context path="" docBase="....." reloadable="false"/>
 
      </Host>
    </Engine>
  </Service>
</Server>
 
-------- rewrite.xml ----------
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE urlrewrite PUBLIC "-//tuckey.org//DTD UrlRewrite 2.6//EN" "http://tuckey.org/res/dtds/urlrewrite2.6.dtd">
<urlrewrite>
    <rule enabled="true">
        <condition type="server-name" next="or">www.xxx.com</condition>
        <condition type="server-name">xxx.com</condition>
        <from>/(.*)</from>
        <to type="forward" last="true">/xxx/$1</to>
    </rule>
    <rule enabled="true">
        <condition type="server-name" next="or">www.yyy.com</condition>
        <condition type="server-name">yyy.com</condition>
        <from>/(.*)</from>
        <to type="forward" last="true">/yyy/$1</to>
    </rule>
</urlrewrite>
 
------ web.xml 의 일부 -----
 
<servlet>
    <servlet-name>xxx</servlet-name>
        <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
    </servlet>
    <servlet-mapping>
        <servlet-name>xxx</servlet-name>
        <url-pattern>/xxx/*</url-pattern>
    </servlet-mapping>
</servlet>
<servlet>
    <servlet-name>yyy</servlet-name>
        <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
    </servlet>
    <servlet-mapping>
        <servlet-name>yyy</servlet-name>
        <url-pattern>/yyy/*</url-pattern>
    </servlet-mapping>
</servlet>
yangkun의 이미지

죄송합니다. 원인은 예상치 못한곳에 있었네요.
서블릿으로 요청이 안들어오는걸 확인한 후에야 다른쪽으로 눈을 돌리게 됐는데.
웹서버 앞단에 방화벽 서버가 있어서...
http 요청에 대해 등록된 확장자외에는 필터링 해버리고 있었네요...

그래서 도메인이 변경되거나, 스키마가 변경되거나, 포트가 변경되면 됐던거네요.
죄송합니다. 크흑 ㅠㅠ

May the force be with you...

댓글 달기

Filtered HTML

  • 텍스트에 BBCode 태그를 사용할 수 있습니다. URL은 자동으로 링크 됩니다.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>
  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.

BBCode

  • 텍스트에 BBCode 태그를 사용할 수 있습니다. URL은 자동으로 링크 됩니다.
  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param>
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.

Textile

  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • You can use Textile markup to format text.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>

Markdown

  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • Quick Tips:
    • Two or more spaces at a line's end = Line break
    • Double returns = Paragraph
    • *Single asterisks* or _single underscores_ = Emphasis
    • **Double** or __double__ = Strong
    • This is [a link](http://the.link.example.com "The optional title text")
    For complete details on the Markdown syntax, see the Markdown documentation and Markdown Extra documentation for tables, footnotes, and more.
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>

Plain text

  • HTML 태그를 사용할 수 없습니다.
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.
  • 줄과 단락은 자동으로 분리됩니다.
댓글 첨부 파일
이 댓글에 이미지나 파일을 업로드 합니다.
파일 크기는 8 MB보다 작아야 합니다.
허용할 파일 형식: txt pdf doc xls gif jpg jpeg mp3 png rar zip.
CAPTCHA
이것은 자동으로 스팸을 올리는 것을 막기 위해서 제공됩니다.