简体   繁体   中英

Failed to Start Apache tomcat from eclipse juno in linux at port 80

At the window platform I have run tomcat from eclipse juno. But at linux I face this problem

When I run web project from eclipse I got this error message, while from command line I can able to run tomcat.

Error Message is - Port 80 required by Tomcat v7.0 Server at localhost is already in use. The server may already be running in another process, or a system process may be using the port. To start this server you will need to stop the other process or change the port number(s).

I already check my port using nmap and other command

The main point is that when I run tomcat from command line then it start, but when I start this from eclipse I got this error

First, check again whether the port is indeed in use. I believe that you have apache web server (httpd) that is taking the port.

Second, on linux only processes running under root user can use lower ports (under 100). Probably when you run tomcat from command line you run it as root (eg using sudo), however when you are running it from eclipse it is running under your user.

The solution is: for development use other port. Eg 8080 .

For production: use special user account (not root) to run tomcat. Eg user named tomcat . Configure it to listen to port 8080. Run apache web server (httpd) under root user configured to listen to port 8080 and configured to be connected to tomcat using mod_jk. This is most secure and reliable commonly used configuration.

I believe linux comes with a apache server, which may be running on port 80. So when you try to run the tomcat on the same port, it is complaining port already in use. To find out if apache is installed you can use the rpm command. I believe it is rpm -qa will tell you all packages installed. Now as far as the directory for apache files it is normally /var/www/htdocs.

After starting Tomcat from the command line you also stopped it? Because if Tomcat is still running from the command line you get this error while trying to start it again out of eclipse.

Is it right that you run your Tomcat on Port 80? This wont work in an Linux environment, because Linux comes up with an Apache Webserver listening on Port 80.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM