I created some web application, on Tomcat 6. When I am accessing via localhost to these machine everything work good - server create one session. But when I connect to this application via Internet, Tomcat creates each time 3 new sessions. Do anyone knows why? The clue could be, that Tomcat server is in DMZ zone, so when i connect via proxy, or from localhost everything is good, but when I access via Internet, the problem occure.
I fixed the problem, the session time out was caused by the network settings. There were 2 problems: 1) mess up with ports connection between tomcat, apache and DNS server (different ports were set up for one application on each machines)
2) When I was connecting via LAN to app, tomcat was creating 1 session and everything was ok. But when I was connecting via Internet tomcat created as I said 3 different session - the first one was exactly like in LAN connection case (session was containing SESIONID for application), but 2,3 was created in the same time and their were empty sessions. My internet adress for application was like: www.example.com/application. In tomcat documentation I read that in this case I should set up emptySessionPath in server access configuration.
When I done everything that I wrote before, my application started to work properly. :)
Related
I am trying to set up session replication between two tomcat servers(server1,server2) in two different machines.
I am using StaticMembershipInterceptor and StaticMember instead of Multicast. I am not using any loadbalancer.
Below is the site mainly I have followed. I referred this configuration as this is the exact requirement I have.
http://khaidoan.wikidot.com/tomcat-cluster-session-replication-without-multicasting
I am using Tomcat9.
What I am expecting is after the above configuration is:
Server1: Tomcat A
Server2: Tomcat B
Exected Result :
Firststep:
I start the Tomcat A. Load the webpage.(http://server1:8080) Login to application by entering username and password and session is created.
Secondstep:
I start the Tomcat B. Load the webpage.(http://server2:8080). It should automcatically login to the application without entering username and password. No login page should be available.
Actual Result after the above configuration:
In Secondstep: Login page is available. the reason why login page appears is it creates different session.
When I tested the same configuration in the two nodes of same machine, it works fine. But in different machine, it does not work.
What I tried so far:
Checked the log file of two tomcats - I can see the connection is
established.
Made sure has distributable tag
Also added the same in context.xml
Tried adding inside the tag as I saw it in couple of forum.
Checked netstat -ano I could see ports are listening at 4100 in both
the machines
Am I missing any other configuration? Not sure why it does not work.
I'm assuming you are using cookie-based session-tracking, because it is enabled by default and is preferred over URL-based session-tracking in Tomcat if the client is willing to send JSESSIONID cookies.
Cookies are scoped to a particular hostname and path. So, when you login to Tomcat A (http://server1:8080), you get a cookie scoped to server1/path. Wen you visit Tomcat B (http://server2:8080), your cookie for server1 isn't sent and you are challenged to login.
If you want this to work, you will need to choose one of the following options:
Use a reverse-proxy / load-balancer
Use multiple-IP DNS to resolve server (not server or server2) to multiple IP addresses, each pointing to a separate Tomcat instance
Disable cookie-based session tracking
But the way you are testing things cannot work due to the rules browsers follow for HTTP cookie handling.
I am kind of a newbie on server, environment stuff, so I need help on setting up a new Tomcat server.
Actually I have installed one instance and it is running already on my dedicated server, but I can't access it's main page, so it is made possible to deploy my apps.
These are the internet proccess in the server. Tomcat is running on port 8080. I tried to access it by IP:8080 and it doesn't work
So is there some extra configuration on a dedicated server to be made? Some security stuff?
I'm really struggling to configure Wildfly 9 to cluster/failover its sessions...
I keep reading that wildfly in standalone-ha mode will automatically discover peers and automatically share sessions, but it's clearly not working for me.
I have setup 3 AWS EC2 servers which all have the same configuration. They all run the same versions of everything and have the same webapp .war file deployed to each of them. This webapp works fine, I can log in to the app which maintains a simple session variable to verify that I am logged in. I've launched each server with standalone-ha.xml configuration files but logging into one doesn't allow be to access the session in any of the others.
I've tried all the things I can think of, but don't know how to diagnose the issue as I don't know how the servers identify each other.
I've manually deployed the war file on each server but placing the file into .../standalone/deployments/
Each has a fully open firewall...
Oh - I set the muticast address on the command line to 230.0.0.4 (That number came from a guide, and I have literally no understanding of it) and each is bound (-b) to the internal IP of the server...
Any help appreciated...
First you must consider that in AWS EC2 multicast traffic is not allowed and thus MPING will not work.
See http://developer.jboss.org/wiki/JGroupsS3PING
An example how to implement S3Ping http://aws.typepad.com/awsaktuell/2013/10/elastic-jboss-as-7-clustering-in-aws-using-ec2-s3-elb-and-chef.html
I'm currently deploying 2 EARs in the same Server Instance. The first one can be accessed in the port 9081, but the second one can't. Is there any way to know in which port I can get access to the second one? I've been trying to look it up in the Administrative Console but got nothing so far.
If both applications deployed to same Server the port should be same. Confirm from console if application is started and mapped to correct virtualhost. if started fine then please check SystemOut.log for any error when trying to access the application.
So I've been doing a java webservice in Eclipse in which I have launched on a localhost tomcat from Eclipse. This has worked very good as long as I've been connecting to the tomcat started from Eclipse.
However now I want to try deploy it on my tomcat separated from Eclipse but still on localhost. So I exported my web project to a .war file and deployed it with the tomcat manager app. However now I cant reach it from my client any longer. I'm running the tomcat on port 8080, just as my Eclipse tomcat did. BUT I can go to a reasource URL from my web browser and receive proper information, so the service is running(which the manager app is saying as well).
The client is a android device connected to the same network. The service fetches information from a MySQL database on the same machine. This connection worked fine before exporting it to war on my other tomcat
What am I doing wrong here? Just ask if you need any further information!
Ok so after testing I found it strange that I got connection time-outs and not something else. It also took at least 10 seconds before any feedback occurred. Sooo it felt like a firewall problem which indeed it was.
First I needed to portforward the tomcat port in my router to the machine ip that was hosting it. Then I remembered I had Windows firewall on that very machine which was also blocking conenctions on that port. So I allowed connections on tomcat port and BAM! It worked.
Thanks for all your comments, of course I should have thought about opening my ports before coming here.