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?
Related
I am trying to access my Tomcat HomePage which is inside my Google Cloud VM Instance with External IP address 35.189.85.127 and Internal IP 10.154.0.2. On my local machine, in my browser I tried http://35.189.85.127 and http://35.189.85.127:8080 but got error
The connection has timed out. The server at 35.189.85.127 is taking too long to respond.
I have seen all the questions and replies on stackoverflow regarding this question but still I found no clear solution.
The steps that I've done so far:
I have setup a Google Cloud VM instance in Compute Engine. I am using Windows Server 2016 as the image.
Using RDP I log on to Windows Server.
I successfully installed Java 1.7 and Tomcat 7 on Windows Server.
I tested Java and Tomcat 7, both are working fine i.e. I open browser and type localhost:8080 and it shows Tomcat HomePage.
I replaced localhost with my VM Instance Internal IP i.e. 10.154.0.2:8080 and it again correctly shows Tomcat HomePage.
Now I try to access Tomcat HomePage using my VM Instance External IP (Static) 35.189.85.127 but in my browser I get error
The connection has timed out. The server at 35.189.85.127 is taking too long to respond.
Faced the same issue today.
Noticed from your question that you're using an Windows environment.
On Windows
Be sure that the Windows Firewall is properly configured to allow traffic under the ports you need (or deactivate it).
On GCP
Under "VPC Network/Firewall Rules", create a new firewall rule and configure as below:
Firewall Rule Parameters (image)
Or, you have the option to check the "Allow HTTP traffic" option under the Instance Configuration menu and edit Tomcat's server.xml to startup at port 80, as described here:
Change Tomcat Port Tutorial # StackOverflow
Option1: If it's just tomcat. GCP offers a click to launch Tomcat instance with an external IP. You can SSH and also have a temp tomcat username and password to manage any of your deployments.
https://console.cloud.google.com/launcher/details/click-to-deploy-images/tomcat
Option 2:
If you wish to have a Google Cloud VM instance in Compute Engine.
You will need to setup security groups and assign it to your instance.
Eg. Define rules to Open Tomcat port 8080(or any) externally / range. Assign that group/rule to your VM instance.
There are many options available, it all depends on how you wish to organize things. You could create a VPC and add your instances there or keep them under the same subnet or have them accessible externally etc.
I have deployed my java web application using apache tomcact in my system through Eclipse. I can access the same page with
https://localhost:8080/Home.jsp
as well
https://mysystemip:8080/Home.jsp
But the same page is not able to connect
https://mysystemip:8080/Home.jsp over the network through other systems. Previously it was working and now not. What issue causing this ?
Your Tomcat server is only bound to your local network interface. You need to bind it to all interfaces for it to be available.
There is already a solution (Can't access Tomcat using IP address):
Add address="0.0.0.0" to Connector string
I don't find the solution for my specific problem, therefore, I ask for you help.
I developed a java application using Spring, JPA/Hibernate and Vaadin. The database is on PostgreSQL.
The application on my computer run on localhost:8080 and bind the database on localhost:5432;
In order for my colleagues to use it, I need now to deploy my application on a virtal server Tomcat. The address of this Tomcat is like 10.152.487.12:8080...
I want to create a war of my application in java and deploy it on Tomcat. But, where I can put the database and how ?
Apache Tomcat allow the creation of a Postgresql server on 8080 port ?
Apache Tomcat allow the installation of a Postgresql server on 5432 like 10.152.487.12:5432 ?
Please, I need help, thank you in advance !
I found the solution !
Yes, I am a newbie, but I think another peoples can be in the same situation, therefore...
You open the "Remote Desktop" on windows if the server where Tomcat turn on is Windows Server. Then, you enter the IP address of the server (without the port 8080 of course). Then, you arrive on the server, you can go on Internet for download PostgreSQL (warning, desactivate the security of the browser, it not allow you to surf !).
Finally, install, enjoy !
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.
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. :)