I'm starting tomcat by cmd (Windows) then Tomcat opens a java window like a console, tomcat log when people login/logout and shows it in this "window". I want to access remotely this "window" screen while server is running to admin who is login/logout. I saw Jconsole and it don't show what I want. What is the alternative?
If you want to manage the tomcat, i think you can try to use Tomcat manager which is built-in in Tomcat server. you can access to it with /manager/html. In addition, you can use remote desktop to your remote host as a alternative.
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 am a .NET Developer trying to learn Java. I have created a simple CRUD based EJB application and it works in Netbeans.
I am trying to add a remote Glassfish server (installed on another PC) to Netbeans so that I can deploy the application (EJBs) from Netbeans. Think of the remote server as a live server (though it is not).
Is it possible to add a remote Glassfish server to Netbeans 7.4. It only seems to allow you to add a local instance.
Assuming you have done asadmin enable-secure-admin (etc) on your remote server, the only way I have found is to remotely mount the (physical) server and then you can point Netbeans at the glassfish directory on the remotely mounted server.
I have a tomcat7.0 running in a remote desktop machine say 204.34.34.45.
When I log into the remote desktop and try "http://localhost:8080" it is working fine.However
http://204.34.34.45:8080 is not working.
I am able to ping 204.34.34.45 from outside the remote desktop machine.
Do you know how can I access tomcat outside the remote desktop machine.
The firewall rules for that host may not allow connections to 8080. Talk to your system administrator for details.
Also, make sure you have the correct IP bindings set up for tomcat. It is possible to allow connections to localhost:8080, but disallow them from 204.34.34.45:8080. See How do you configure tomcat to bind to a single ip address (localhost) instead of all addresses?
I have a web application. It is currently deployed on a remote server in a Glassfish instance. Is it possible to remotely connect to the server and debug the application (like I would a normal java application) using Netbeans?
If someone has done this and could provide insight or could point me to a guide, that would be great.
I know this functionality exists with Visual Studio and ASP.Net. I was not sure if there is a java equivalent.
Most examples that I have seen online are for applications that are simply running on a remote machine or for debugging a Glassfish application running on the local machine.
Yes, it is possible.
Once you have GlassFish running in debug mode, go to the Debug menu in NetBeans and click on Attach Debugger..., which brings up the Attach dialog. You'll probably go with something like:
Debugger: Java Debugger (JPDA)
Connector: SocketAttach
Transport: dt_socket
Host: hostname_or_ip_address
Port: 9009
Timeout may be left blank. When you click OK on this dialog, you should be able to connect your NetBeans debugger to GlassFish.
Remember:
The firewall on your remote server (and any gateways in between) should allow connections to the debugger port (9009 in my example).
Make sure you're using matching port numbers. In the GlassFish admin console, usually at: http://localhost:4848
Expand Configurations.
Expand server-config (or whichever you are using).
Click JVM Settings.
Check Debug to Enabled.
Verify that Debug Options contains:
-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=9009
Read the JPDA docs for other options you can use.
I'm trying to see if a WAR I just built is even running inside of Tomcat (7.0.19). I am deploying to a linux box and so my only two options are the Tomcat admin console (web app) or, hopefully, determining webapp status through the terminal.
I already know how to get in through the console web app; I am wondering if there is any way to see the status (ACTIVE/INACTIVE/TERMINATED, etc) of deployed web apps from the terminal.
Thanks in advance.
PSI-Probe is a great application for monitoring your applications deployed to a tomcat instance. It will tell you if an application is running or down. If the application is not deployed, it will simply not be in the list.
curl --user user:pass http://localhost:8080/manager/text/list
It prints
OK - Listed applications for virtual host localhost
/manager:running:0:manager
/docs:running:0:docs
/examples:running:0:examples
/host-manager:running:0:host-manager
/myapp:running:0:myapp
Your user needs the manager-script role. Documentation: Manager App HOW-TO, List_Currently_Deployed_Applications
You can probably do it using JMX.
Find appropriate MBean that shows this information on local tomcat using regular JConsole. If you want to connect JConsole to remote you will probably have some problems with firewall, so you have other solution.
Take command line JMX client and run it on the monitored host through SSH terminal. I used the following command line JMX client: cmdline-jmxclient-0.10.3.jar
wget http://<username>:<password>#<hostname>:<port>/manager/list -O - -q
(Not sure about Tomcat 7 though)