나는 2 개 가지 방법으로 (아파치 톰캣 5.5 및 6을 설치하려고 한 소스 와 apt-get을 함께 성공없이 - 데비안 5 데비안 6). 서버가 실행 중이지만 연결할 수 없습니다.
netstat -a
:
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address Foreign Address State
tcp 0 0 *:ssh *:* LISTEN
tcp 0 0 `hostname`:ssh my_home_ip:4318 ESTABLISHED
tcp 0 52 `hostname`:ssh my_home_ip:remctl ESTABLISHED
tcp6 0 0 [::]:8009 [::]:* LISTEN
tcp6 0 0 [::]:8180 [::]:* LISTEN
tcp6 0 0 [::]:ssh [::]:* LISTEN
udp 0 0 *:mdns *:*
udp 0 0 *:33059 *:*
udp6 0 0 [::]:mdns [::]:*
udp6 0 0 [::]:43829 [::]:*
netstat -tnlp
:
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 1416/sshd
tcp6 0 0 :::8009 :::* LISTEN 7880/jsvc
tcp6 0 0 :::8180 :::* LISTEN 7880/jsvc
tcp6 0 0 :::22 :::* LISTEN 1416/sshd
ps aux | grep tomcat
:
root 7878 0.0 0.0 1984 352 ? Ss 21:55 0:00 /usr/bin/jsvc -user tomcat55 -cp /usr/share/java/commons-daemon.jar:/usr/share/tomcat5.5/bin/bootstrap.jar -outfile SYSLOG -errfile SYSLOG -pidfile /var/run/tomcat5.5.pid -Djava.awt.headless=true -Xmx128M -Djava.endorsed.dirs=/usr/share/tomcat5.5/common/endorsed -Dcatalina.base=/var/lib/tomcat5.5 -Dcatalina.home=/usr/share/tomcat5.5 -Djava.io.tmpdir=/var/lib/tomcat5.5/temp -Djava.security.manager -Djava.security.policy=/var/lib/tomcat5.5/conf/catalina.policy -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager -Djava.util.logging.config.file=/var/lib/tomcat5.5/conf/logging.properties org.apache.catalina.startup.Bootstrap
root 7879 0.0 0.0 1984 460 ? S 21:55 0:00 /usr/bin/jsvc -user tomcat55 -cp /usr/share/java/commons-daemon.jar:/usr/share/tomcat5.5/bin/bootstrap.jar -outfile SYSLOG -errfile SYSLOG -pidfile /var/run/tomcat5.5.pid -Djava.awt.headless=true -Xmx128M -Djava.endorsed.dirs=/usr/share/tomcat5.5/common/endorsed -Dcatalina.base=/var/lib/tomcat5.5 -Dcatalina.home=/usr/share/tomcat5.5 -Djava.io.tmpdir=/var/lib/tomcat5.5/temp -Djava.security.manager -Djava.security.policy=/var/lib/tomcat5.5/conf/catalina.policy -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager -Djava.util.logging.config.file=/var/lib/tomcat5.5/conf/logging.properties org.apache.catalina.startup.Bootstrap
tomcat55 7880 0.1 5.3 324068 27932 ? Sl 21:55 0:01 /usr/bin/jsvc -user tomcat55 -cp /usr/share/java/commons-daemon.jar:/usr/share/tomcat5.5/bin/bootstrap.jar -outfile SYSLOG -errfile SYSLOG -pidfile /var/run/tomcat5.5.pid -Djava.awt.headless=true -Xmx128M -Djava.endorsed.dirs=/usr/share/tomcat5.5/common/endorsed -Dcatalina.base=/var/lib/tomcat5.5 -Dcatalina.home=/usr/share/tomcat5.5 -Djava.io.tmpdir=/var/lib/tomcat5.5/temp -Djava.security.manager -Djava.security.policy=/var/lib/tomcat5.5/conf/catalina.policy -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager -Djava.util.logging.config.file=/var/lib/tomcat5.5/conf/logging.properties org.apache.catalina.startup.Bootstrap
root 8013 0.0 0.0 1716 492 pts/0 R+ 22:13 0:00 grep tomcat
nmap
포트 확인 :
# nmap localhost -p 8180
Starting Nmap 4.62 ( http://nmap.org ) at 2012-03-03
Interesting ports on localhost.localdomain (127.0.0.1):
PORT STATE SERVICE
8180/tcp closed unknown
Nmap done: 1 IP address (1 host up) scanned in 0.025 seconds
# nmap localhost -p 8009
Starting Nmap 4.62 ( http://nmap.org ) at 2012-03-03
Interesting ports on localhost.localdomain (127.0.0.1):
PORT STATE SERVICE
8009/tcp closed ajp13
Nmap done: 1 IP address (1 host up) scanned in 0.027 seconds
# nmap localhost -p 22
Starting Nmap 4.62 ( http://nmap.org ) at 2012-03-03
Interesting ports on localhost.localdomain (127.0.0.1):
PORT STATE SERVICE
22/tcp open ssh
Nmap done: 1 IP address (1 host up) scanned in 0.026 seconds
카탈리나 로그 :
Mar 3, 2012 9:55:26 PM org.apache.catalina.core.AprLifecycleListener lifecycleEvent
INFO: The Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path:
Mar 3, 2012 9:55:26 PM org.apache.coyote.http11.Http11BaseProtocol init
INFO: Initializing Coyote HTTP/1.1 on http-8180
Mar 3, 2012 9:55:26 PM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 486 ms
Mar 3, 2012 9:55:27 PM org.apache.catalina.core.StandardService start
INFO: Starting service Catalina
Mar 3, 2012 9:55:27 PM org.apache.catalina.core.StandardEngine start
INFO: Starting Servlet Engine: Apache Tomcat/5.5
Mar 3, 2012 9:55:27 PM org.apache.catalina.core.StandardHost start
INFO: XML validation disabled
Mar 3, 2012 9:55:27 PM org.apache.coyote.http11.Http11BaseProtocol start
INFO: Starting Coyote HTTP/1.1 on http-8180
Mar 3, 2012 9:55:27 PM org.apache.jk.common.ChannelSocket init
INFO: JK: ajp13 listening on /0.0.0.0:8009
Mar 3, 2012 9:55:27 PM org.apache.jk.server.JkMain start
INFO: Jk running ID=0 time=0/24 config=null
Mar 3, 2012 9:55:27 PM org.apache.catalina.storeconfig.StoreLoader load
INFO: Find registry server-registry.xml at classpath resource
Mar 3, 2012 9:55:27 PM org.apache.catalina.startup.Catalina start
INFO: Server startup in 321 ms
java -version
:
java version "1.5.0_22"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_22-b03)
Java HotSpot(TM) Client VM (build 1.5.0_22-b03, mixed mode)
또한 Tomcat을 VPS 외부 IP에 강제 할당하려고 시도했습니다. 나는 또한지고있어 개체 힙에 충분한 공간을 확보 할 수 없습니다 VM의 초기화하는 동안 오류가 발생했습니다. 때때로 오류가 발생하지만 Tomcat이 응답하지 않기 때문에 문제가되지 않습니다.
텍스트가 너무 많아서 죄송합니다. 유익한 정보를 얻으려고했습니다. 도와주세요. 미리 감사드립니다!
업데이트
답변에서 언급했듯이 Tomcat은 IPv6 포트에서 수신 대기했습니다. 이를 변경하기 위해 JAVA 머신의 환경 변수를 /etc/profile
파일 에 추가해야했습니다.
JAVA_OPTS="-Djava.net.preferIPv4Stack=true"
export JAVA_OPTS
... 파일을 다시로드하십시오. source /etc/profile
... 그리고 다음과 Connector
같이 /etc/tomcat5.5/server.xml
(내 경우)를 편집하여 Tomcat의 메인을 구성 하십시오.
<Connector port="8080" maxHttpHeaderSize="8192"
maxThreads="150" minSpareThreads="25" maxSpareThreads="75"
enableLookups="false" redirectPort="8443" acceptCount="100"
connectionTimeout="20000" disableUploadTimeout="true" address="0.0.0.0" />
주목하라 address="0.0.0.0"
IPv4 주소에 바인딩 Tomcat을 알려줍니다.
시간 내 주셔서 감사합니다. 모두 좋은 하루 보내세요.
nmap -6 ::1 -p 8009 PORT STATE SERVICE 8009/tcp open ajp13
. 수락 할 수 있도록 답변으로 게시 하시겠습니까?
::1
localhost 대신 스캔 할 때 포트가 열린 것으로 표시됩니까 ?