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(Response.java:1126)
at org.eclipse.jetty.server.Response.sendError(Response.java:313)
at org.eclipse.jetty.server.Response.sendError(Response.java:415)
at org.eclipse.jetty.server.handler.ContextHandler.checkContext(ContextHandler.java:820)
at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:916)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:135)
at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:154)
at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:521)
at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:154)
at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:116)
at org.eclipse.jetty.server.Server.handle(Server.java:363)
at org.eclipse.jetty.server.AbstractHttpConnection.handleRequest(AbstractHttpConnection.java:483)
at org.eclipse.jetty.server.AbstractHttpConnection.headerComplete(AbstractHttpConnection.java:920)
at org.eclipse.jetty.server.AbstractHttpConnection$RequestHandler.headerComplete(AbstractHttpConnection.java:982)
at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:635)
at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:235)
at org.eclipse.jetty.server.AsyncHttpConnection.handle(AsyncHttpConnection.java:82)
at org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:627)
at org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:51)
at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:608)
at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:543)
at java.lang.Thread.run(Thread.java:722)


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?

Answer

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]