I have Apache running Solaris using the mpm module, and it listens on port 8080. Every once in a while, someone will start up a Tomcat instance on the same host. The has the affect of directing all the traffic to Tomcat. Once Tomcat is shutdown, traffic resumes to Apache. I'd like for Apache to bind this socket exclusively, so other processes get an error. Is this possible?
Note, this is a dev box, so it's not possible to restrict who logs on, or what programs they run. Yes, it is possible, and quite easy to change the Tomcat port. The problem is this is the default tomcat port. So a developer untar's Tomcat, starts it up, and then I notice I'm getting Tomcat 404 errors instead of Apache content. This leads me to tracking down the developer and telling them to change their default port. Ideally, Tomcat would just fail.
When Java binds a port, it binds it in exclusive mode, and another process cannot listen on the same port. Apache seems to bind the port in shared mode. I wouldn't think this would be required with the mpm module, but it seems to be the default. I'm looking for a compiler option or config option that will bind the port in exclusive mode.