thaweatherman thaweatherman - 4 months ago 21
Linux Question

ActiveMQ returns 503 when accessing admin panel

When I run ActiveMQ as root I am able to access the admin panel. However I need to run it as the apache user so my web server can send messages to other programs on my machine. When I run it as the apache user and try to access the admin panel it responds with a 503 service unavailable.

Does anyone know of a fix for this? Thanks

Edit: Adding activemq.log output from the 503

2013-05-28 13:47:51,823 | WARN | Committed before 503 null | org.eclipse.jetty.server.Response | qtp1146944158-23
2013-05-28 13:47:51,824 | WARN | /admin/ | org.eclipse.jetty.server.AbstractHttpConnection | qtp1146944158-23
java.lang.IllegalStateException: Committed
at org.eclipse.jetty.server.Response.resetBuffer(
at org.eclipse.jetty.server.Response.sendError(
at org.eclipse.jetty.server.Response.sendError(
at org.eclipse.jetty.server.handler.ContextHandler.checkContext(
at org.eclipse.jetty.server.handler.ContextHandler.doScope(
at org.eclipse.jetty.server.handler.ScopedHandler.handle(
at org.eclipse.jetty.server.handler.HandlerCollection.handle(
at org.eclipse.jetty.server.handler.HandlerCollection.handle(
at org.eclipse.jetty.server.handler.HandlerWrapper.handle(
at org.eclipse.jetty.server.Server.handle(
at org.eclipse.jetty.server.AbstractHttpConnection.handleRequest(
at org.eclipse.jetty.server.AbstractHttpConnection.headerComplete(
at org.eclipse.jetty.server.AbstractHttpConnection$RequestHandler.headerComplete(
at org.eclipse.jetty.http.HttpParser.parseNext(
at org.eclipse.jetty.http.HttpParser.parseAvailable(
at org.eclipse.jetty.server.AsyncHttpConnection.handle(
at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(
at org.eclipse.jetty.util.thread.QueuedThreadPool$

Edit: I am now rerunning my script against the server while ActiveMQ is running as apache and server is root and the script hangs. It is getting stuck at creating a default session. When I step through in GDB it still works though...

Edit: I ran setenforce 0 and everything worked. Not sure why that would be. Any ideas?


Well I managed to figure out the problem in case anyone who stumbles on this is curious.

I enabled selinux again and added ports 61616 (port for openwire connections), 61613 (port for stomp connections), and 8161 (port for admin console) to the allow list for http_port_t.

I used the command:

semanage port -a -t http_port_t -p tcp [port number]