我想讓我的VPS上的Tomcat安裝在端口80上而不是8080上運行,但是當編輯server.xml文件的設置時在我的Tomcat的目錄,並嘗試重新啓動Tomcat,我得到這個錯誤:嘗試將Apache Tomcat端口從8080更改爲80時出現內存錯誤
Jan 23, 2012 9:55:46 AM org.apache.coyote.http11.Http11Protocol init SEVERE: Error initializing endpoint java.net.SocketException: Cannot allocate memory at java.net.PlainSocketImpl.socketBind(Native Method) at java.net.AbstractPlainSocketImpl.bind(AbstractPlainSocketImpl.java:353) at java.net.ServerSocket.bind(ServerSocket.java:336) at java.net.ServerSocket.(ServerSocket.java:202) at java.net.ServerSocket.(ServerSocket.java:158) at org.apache.tomcat.util.net.DefaultServerSocketFactory.createSocket(DefaultServerSocketFactory.java:50) at org.apache.tomcat.util.net.JIoEndpoint.init(JIoEndpoint.java:538) at org.apache.coyote.http11.Http11Protocol.init(Http11Protocol.java:176) at org.apache.catalina.connector.Connector.initialize(Connector.java:1014) at org.apache.catalina.core.StandardService.initialize(StandardService.java:680) at org.apache.catalina.core.StandardServer.initialize(StandardServer.java:795) at org.apache.catalina.startup.Catalina.load(Catalina.java:524) at org.apache.catalina.startup.Catalina.load(Catalina.java:548) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:616) at org.apache.catalina.startup.Bootstrap.load(Bootstrap.java:261) at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413) Jan 23, 2012 9:55:46 AM org.apache.catalina.startup.Catalina load SEVERE: Catalina.start LifecycleException: Protocol handler initialization failed: java.net.SocketException: Cannot allocate memory at org.apache.catalina.connector.Connector.initialize(Connector.java:1016) at org.apache.catalina.core.StandardService.initialize(StandardService.java:680) at org.apache.catalina.core.StandardServer.initialize(StandardServer.java:795) at org.apache.catalina.startup.Catalina.load(Catalina.java:524) at org.apache.catalina.startup.Catalina.load(Catalina.java:548) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:616) at org.apache.catalina.startup.Bootstrap.load(Bootstrap.java:261) at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)
不能確定這意味着什麼?這是否意味着我沒有足夠的內存?是否有其他方法讓Tomcat在80端口上運行?
編輯:這裏是輸出,當我在免費-m類型:
total used free shared buffers cached
Mem: 1024 748 275 0 0 0
-/+ buffers/cache: 748 275
Swap: 0 0 0
其他東西已經綁定到端口80?檢查netstat –
我有apache2運行,但是當我關閉apache2我仍然得到相同的錯誤。 – Raymond
嘗試端口81或89,看看會發生什麼。另外,您可以使用netstat -a命令查看正在使用的端口。如果你討厭命令行工具,請嘗試TCPView。 – 2012-01-23 19:18:22