2011-12-18 30 views
10

Tôi đã cài đặt sun jdk 1.6 x64 và tomcat trong máy linux x64 thông qua ssh, tôi không có đặc quyền root nên tôi đã cài đặt cả hai trong thư mục chính của mình.tomcat đang chạy, nhưng cổng 8080 không phản hồi

Tôi quản lý để chạy thành công tomcat nhưng nếu tôi cố gắng nhập mydomain.com:8080 thì không có câu trả lời nào từ máy chủ.

Với lệnh này:

netstat -atnp|grep LISTEN 

tôi đã kiểm tra các cổng và nó được NGHE

Dec 18, 2011 5:11:20 PM org.apache.catalina.core.AprLifecycleListener init 
INFO: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: /home2/fiegmund/jdk1.6.0_25/jre/lib/amd64/server:/home2/fiegmund/jdk1.6.0_25/jre/lib/amd64:/home2/fiegmund/jdk1.6.0_25/jre/../lib/amd64:/usr/java/packages/lib/amd64:/usr/lib64:/lib64:/lib:/usr/lib 
Dec 18, 2011 5:11:21 PM org.apache.coyote.AbstractProtocol init 
INFO: Initializing ProtocolHandler ["http-bio-8080"] 
Dec 18, 2011 5:11:21 PM org.apache.coyote.AbstractProtocol init 
INFO: Initializing ProtocolHandler ["ajp-bio-8009"] 
Dec 18, 2011 5:11:21 PM org.apache.catalina.startup.Catalina load 
INFO: Initialization processed in 2015 ms 
Dec 18, 2011 5:11:21 PM org.apache.catalina.core.StandardService startInternal 
INFO: Starting service Catalina 
Dec 18, 2011 5:11:21 PM org.apache.catalina.core.StandardEngine startInternal 
INFO: Starting Servlet Engine: Apache Tomcat/7.0.23 
Dec 18, 2011 5:11:21 PM org.apache.catalina.startup.HostConfig deployDirectory 
INFO: Deploying web application directory /home2/fiegmund/apache-tomcat-7.0.23/webapps/docs 
Dec 18, 2011 5:11:24 PM org.apache.catalina.util.SessionIdGenerator createSecureRandom 
INFO: Creation of SecureRandom instance for session ID generation using [SHA1PRNG] took [1,869] milliseconds. 
Dec 18, 2011 5:11:24 PM org.apache.catalina.startup.HostConfig deployDirectory 
INFO: Deploying web application directory /home2/fiegmund/apache-tomcat-7.0.23/webapps/manager 
Dec 18, 2011 5:11:24 PM org.apache.catalina.startup.HostConfig deployDirectory 
INFO: Deploying web application directory /home2/fiegmund/apache-tomcat-7.0.23/webapps/ROOT 
Dec 18, 2011 5:11:24 PM org.apache.catalina.startup.HostConfig deployDirectory 
INFO: Deploying web application directory /home2/fiegmund/apache-tomcat-7.0.23/webapps/examples 
Dec 18, 2011 5:11:25 PM org.apache.catalina.startup.TaglibUriRule body 
INFO: TLD skipped. URI: http://java.sun.com/jstl/core is already defined 
Dec 18, 2011 5:11:25 PM org.apache.catalina.startup.TaglibUriRule body 
INFO: TLD skipped. URI: http://java.sun.com/jstl/sql_rt is already defined 
Dec 18, 2011 5:11:25 PM org.apache.catalina.startup.TaglibUriRule body 
INFO: TLD skipped. URI: http://java.sun.com/jsp/jstl/sql is already defined 
Dec 18, 2011 5:11:25 PM org.apache.catalina.startup.TaglibUriRule body 
INFO: TLD skipped. URI: http://java.sun.com/jstl/core_rt is already defined 
Dec 18, 2011 5:11:25 PM org.apache.catalina.startup.TaglibUriRule body 
INFO: TLD skipped. URI: http://java.sun.com/jsp/jstl/core is already defined 
Dec 18, 2011 5:11:25 PM org.apache.catalina.startup.TaglibUriRule body 
INFO: TLD skipped. URI: http://java.sun.com/jsp/jstl/functions is already defined 
Dec 18, 2011 5:11:25 PM org.apache.catalina.startup.TaglibUriRule body 
INFO: TLD skipped. URI: http://java.sun.com/jstl/fmt is already defined 
Dec 18, 2011 5:11:25 PM org.apache.catalina.startup.TaglibUriRule body 
INFO: TLD skipped. URI: http://jakarta.apache.org/taglibs/standard/permittedTaglibs is already defined 
Dec 18, 2011 5:11:25 PM org.apache.catalina.startup.TaglibUriRule body 
INFO: TLD skipped. URI: http://java.sun.com/jstl/xml is already defined 
Dec 18, 2011 5:11:25 PM org.apache.catalina.startup.TaglibUriRule body 
INFO: TLD skipped. URI: http://jakarta.apache.org/taglibs/standard/scriptfree is already defined 
Dec 18, 2011 5:11:25 PM org.apache.catalina.startup.TaglibUriRule body 
INFO: TLD skipped. URI: http://java.sun.com/jstl/fmt_rt is already defined 
Dec 18, 2011 5:11:25 PM org.apache.catalina.startup.TaglibUriRule body 
INFO: TLD skipped. URI: http://java.sun.com/jsp/jstl/fmt is already defined 
Dec 18, 2011 5:11:25 PM org.apache.catalina.startup.TaglibUriRule body 
INFO: TLD skipped. URI: http://java.sun.com/jsp/jstl/xml is already defined 
Dec 18, 2011 5:11:25 PM org.apache.catalina.startup.TaglibUriRule body 
INFO: TLD skipped. URI: http://java.sun.com/jstl/xml_rt is already defined 
Dec 18, 2011 5:11:25 PM org.apache.catalina.startup.TaglibUriRule body 
INFO: TLD skipped. URI: http://java.sun.com/jstl/sql is already defined 
Dec 18, 2011 5:11:25 PM org.apache.catalina.startup.HostConfig deployDirectory 
INFO: Deploying web application directory /home2/fiegmund/apache-tomcat-7.0.23/webapps/host-manager 
Dec 18, 2011 5:11:25 PM org.apache.coyote.AbstractProtocol start 
INFO: Starting ProtocolHandler ["http-bio-8080"] 
Dec 18, 2011 5:11:25 PM org.apache.coyote.AbstractProtocol start 
INFO: Starting ProtocolHandler ["ajp-bio-8009"] 
Dec 18, 2011 5:11:25 PM org.apache.catalina.startup.Catalina start 
INFO: Server startup in 4582 ms> 

Bất kỳ ý tưởng của vấn đề là gì?

Cảm ơn trước và xin lỗi vì tiếng anh khủng khiếp mà tôi đã viết.

+0

Telnet từ chính máy cục bộ có hoạt động không? – fge

+0

có, nó kết nối –

+0

Sau đó, có khả năng nhà cung cấp dịch vụ lưu trữ của bạn không cho phép nghe trên các cổng lớn hơn 1024 ... – fge

Trả lời

16

Bước đầu tiên là chạy telnet localhost 8080 khi đăng nhập cục bộ. Sau đó, nhập một cái gì đó như

GET/

và bạn sẽ nhận lại HTML. Nếu điều đó không hoạt động, sau đó tomcat không thực sự chạy đúng hoặc không nghe trên cổng 8080. Nếu điều đó hoạt động nhưng khi cố gắng từ bên ngoài, hãy đảm bảo rằng bạn có địa chỉ ip chính xác. Hãy thử với địa chỉ ip đầu tiên. Nếu địa chỉ ip hoạt động, có lẽ mydomain.com của bạn không giải quyết được. Nếu ip đúng (giống như bạn đang ssh'ing) và nó vẫn không hoạt động, thì có thể bạn đang chạy tường lửa không cho phép 8080 qua. Thay đổi cấu hình tường lửa yêu cầu quyền truy cập root.

+0

tôi quên nói rằng máy chủ đã cài đặt Apache http Server bằng cổng 80. Dù sao, tôi đã thử với: lwp-request http: // localhost: 8080 và tôi đã nhận html của apache tomcat ... –

+0

do đó tường lửa là vấn đề, cảm ơn u rất nhiều –

+0

GET /, không http: // localhost/ –

3

Đóng IDE. Khởi động lại quá trình java.exe nếu bạn đang ở trên một hệ thống cửa sổ. Và khởi động IDE sau đó.

+1

Đây không phải là vấn đề về IDE. OP nêu rõ rằng đó là một máy chủ Linux có quyền truy cập SSH. – milosmns

4

Cố gắng ra khỏi danh sách sử dụng lệnh sau đây trên Linux Terminal LISTEN Địa chỉ TCP và chi tiết cảng với tên chương trình

netstat -ltnpa | grep -i --colour LISTEN 

Hơn nữa bạn phải kiểm tra tường lửa được bật hoặc tắt. (Hầu hết thời gian có thể được bật và có thể đã chặn cổng tomcat 8080 mặc định cụ thể bị chặn bởi iptables trong linux)

4

Vấn đề đối với tôi là Tomcat của tôi bắt đầu chỉ nghe IPv6. Đặt nó ở đây trong trường hợp ai đó phát hiện ra điều tương tự.

tôi đã có thể để có được phản ứng thích hợp với

curl -g -6 "http://[::1]:8080/" 

Nhưng không phải với localhost. Để khắc phục điều này, tôi loại bỏaddress thuộc tính từ conf/server.xml:

<Connector port="8080" protocol="HTTP/1.1" 
      connectionTimeout="20000" 
      redirectPort="8443" URIEncoding="UTF-8" /> 
      address="0.0.0.0" /> 

và khởi động lại và nó ràng buộc với IPv4 nữa. Tôi biết nó nên là cách khác xung quanh, nhưng đây là những gì cố định nó cho tôi. Hệ điều hành là Ubuntu.

0

Trong trường hợp triển khai chiến tranh nếu có lỗi trong tệp chiến tranh, tomcat có thể không trích xuất được tệp chiến tranh. Hãy chắc chắn rằng một thư mục có cùng tên như tập tin chiến tranh được tạo ra trong tomcat // libexec/webapps nếu không localhost: 8080 sẽ bị mắc kẹt.

Các vấn đề liên quan