Thursday, October 18, 2012

Changing or Renewing JSESSIONID in JBoss

I think if you reach this page by searching a keyword like this entry's title, I don't think you are expecting the answer to be something like below

session.invalidate();

Which you have tried and failed miserably. The JSESSIONID just won't change from its originally assigned value no matter what you did.

You are in luck if you are encountering this issue in your JBoss server, because I might have the answer for you.

So let's get started, first, you have to invalidate your session using the code I've posted above. Second, you have to locate server.xml files depending on the JBoss' version that you are using. For me, I'm using JBoss 4.2.3 GA, so the location is at JBOSS_HOME/server/default/deploy/jboss-web.deployer/ folder.

Located it? Great, now change all of the emptySessionPath value that you can find in this file to false.

Restart your JBoss, cross your fingers, and try again.

Cheers.

Tuesday, August 28, 2012

Pausing a Process in Linux

I was recently tasked to investigate on Java memory leak problem in production server. In order to do that, I'll have to create a memory dump. But before that, I'll have to pause the Java process from running and then resume the process after I've finished dumping the memory.

So how to do that in Linux?

To pause a process in Linux, just run the following command.

kill -SIGSTOP [PID]

Note: PID = process id, use ps command to see the process id.

To resume a paused process in Linux, run the following command.

kill -SIGCONT [PID]

That's about it. Don't worry, I didn't run this in production server, we have staging server for such troubleshooting purpose.

Chill.

Tuesday, April 3, 2012

Reverse Proxy Setup Encountered Permission Issue

Today when I setup reverse proxy for my Apache server, the reverse proxy refused to work. So I went to check on the log files and found out the following error:

Permission denied: proxy: HTTP: attempt to connect to

Seems like the Linux security prevented HTTPD process to connect to the network.

In order to solve this issue, just run the following command.

/usr/sbin/setsebool -P httpd_can_network_connect true

Alternatively, you can also set the security settings, Go to Security Level configurations and Change Tab to SELinux. And modify SELinux policy Check "Allow HTTPD scripts and modules to connect to the network" under HTTPD service.