简体   繁体   中英

Webrick and Apache in one server

I have a server that runs an Apache server on port 80 and a Webrick web-apps on port 9090. Whenever I stop the Webrick server by killing the process using kill -9 12345 , where 12345 is the PID of Webrick, I cannot restart the web-apps again since port 9090 is "automatically" used by another process, which is surprisingly the Apache server.

Currently, I have to stop and restart the Apache server before I can restart my Webrick web-apps, which is very annoying. Is there any better solution for this problem?

Switch the port for either webrick or apache. Apache Tomcat defaults to port 9090.

with kill -9 id you really kill the process ... so it has no chance to say "good by". So apache has no chance to realize that the other end of connection is gone (or it takes a while)

try a simple kill id before and only use kill -9 if the process hangs

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