As per tomcat security documentation I have disabled tomcat shutdown port due to security concerns.
https://tomcat.apache.org/tomcat-9.0-doc/security-howto.html#Server
Now I am unable to shutdown tomat using shutdown.bat/shutdown.sh.
Can anyone help me with script or command to stop tomcat server safey if shutdown port is disabled?
On linux: catalina.sh the script try to shutdown tomcat gracefully calling
org.apache.catalina.startup.Bootstrap stop
This try calling shutdown command on shutdown port configured server.xml
If it not succeed it will try with kill command.
On Windows: the start/stop is done by service and don't use the shutdown port. If you use startup.bat and shutdown.bat (not recommended in production), the shutdown will not work with shutdown port disabled (-1)
Related
I'm trying to deploy a Spring Boot Rest Api (Gradle) to an Azure app service. There is an executable jar in the /home/site/wwwroot folder and a startup command (java -jar /home/site/wwwroot/app.jar). When I execute this script, the spring api starts but throws the following error: "The Tomcat connector configured to listen on port 80 failed to start. The port may already be in use or the connector may be misconfigured."
I can't run the app on another port because the Azure App Service only allows inbound HTTP traffic on port 80 and 443 for SSL. I tried killing the process that is running on port 80 but that kills my ssh terminal.
Is there a solution to 'clear' the proces running on port 80 and actually run my Spring application on it?
"The Tomcat connector configured to listen on port 80 failed to start.The port may already be in use or the connector may be misconfigured."
The error is because another process is running on the same port. To solve this, you have two options.
Try to run the application on a port other than 8080.
Identify and stop the process running on that specific port.
Check this post on how to change the default tomcat port number.
See: how the spring boot configuration works.
Check this blog and SO thread might be helpful. Tomcat Server Error - Port 8080 already in use
Apache server is giving an error at boot up (or when I try to start the service with systemctl manually)
make_sock: could not bind to address [::]:7301 # virtual host port
But it starts nicely with following command:
httpd -k start
3 things come to mind:
That port, 7301 is already in use by another process, try a netstat -apn | grep 7301 to see if that's the case and if so change the apache port or kill that process.
You have 2 conflicting Listen directives in your apache conf file. For ex. Listen *:7301 and Listen 1.2.3.4:7301 would cause that error, pleasr remove one of them
You have configured apache to use an interface which is not active or does not have IPv6 enabled
Edit:
You have selinux active on your host and it's preventing apache from using a non default port as port 80.
asadmin start-domain domain1
But it shows this error.
There is a process already using the admin port 4848 -- it probably is another instance of a GlassFish server.
I have searched and found that it could be the hostname or that the port is used by an other application or server and actually it is used by TCP.
I have no problem with the hostname so I've tried this solution by changing port.
asadmin set server.http-service.http-listener.http-listener-1.port=10080
but it shows this error
remote failure: No configuration found for server.http-service.http-listener.http-listener-1
Command set failed.
I can't understand why.
Assuming you are running glassifhs under linux
1 - Check if glassfish is already runnig.
ps -ef |grep java
kill any process java relative to glassfish
2 - Check if the port 4848 is in use
netstat -nao |grep 4848
3 - Change the default port
Edit the file {glassfish_home}/config/asadminenv.conf
AS_ADMIN_PORT=4848
I just kill all glassfish processes
pkill -f glassfish
I hit the same error.
This was useful - i.e. check you can ping $(hostname). Looks like glassfish checks hostname against IP, possibly during bind process.
My issue was my hostname/ip address in /etc/hosts was not aligned correctly, meaning I could not ping $(hostname). Once aligned and pinged, glassfish started ok.
I just hit this issue today. Be sure to delete the $PATH/TO/domain1/config/pid and $PATH/TO/domain1/config/pid.prev files as well, if the process isn't running but is being reported as still running.
I installed monit and tried to check the status using below command.
monit status
But end up with below error.
monit: error connecting to the monit daemon
How can I fix this?
edit vim /etc/monit/monitrc, starting from line 118 and uncomment below lines
set httpd port 2812
use address localhost # only accept connection from localhost
allow localhost # allow localhost to connect to the server and
allow admin:monit
sudo monit reload to take affect
Read more
Sometimes the problem appears because loopback interface is down . We should bring up the lo interface as follow
root#server:~# ifup lo
I have installed Authbind to run Tomcat on port 80 in Ubuntu.
I have followed http://netthink.com/?p=362 to run Tomcat in Ubuntu in port 80.
When I run Tomcat on the command line by typing ./start.sh, Tomcat starts normally on port 80 without any exception.
In order to run Tomcat from Eclipse I installed the Tomcat plugin from http://www.eclipsetotale.com/tomcatPlugin.html. Everything is fine except that when I want to start Tomcat from Eclipse. When I run Tomcat from Eclipse by the Tomcat plugin, I get the following exception:
java.net.BindException: Permission denied :80
And if I add Tomcat as a server in "Server view" in Eclipse and want to start it from Server view I get this exception:
Port 80 required by Tomcat v6.0 Server at localhost is already in use
But I am sure that there is not any process that acquires port 80, because in the same time when I run Tomcat on the command line by typing ./start.sh, Tomcat starts normally on port 80.
How do I run Tomcat from Eclipse on port 80?
Using another port other than 80 and less than 1024 for Tomcat and start it in Server View in Eclipse gave me the same exception. For example, for port 82:
Port 82 required by Tomcat v6.0 Server at localhost is already in use
You said :
But i am sure that there is not any process that acquires port
80,because in the same time when i run Tomcat in command line by
typing ./start.sh ,tomcat starts normally in port 80.
Did you stop Tomcat in command line before starting it with Eclipse ?
To make sure your Tomcat is stopped, type this :
ps -ef|grep tomcat
You should have something like this if Tomcat is stopped :
user 16428 16373 0 13:56 pts/1 00:00:00 grep --color=auto tomcat
try running eclipse as root and then start tomcat (on port 80).. should work. although not an optimal solution. But should work since 80 is a privileged port in linux and requires sudo permissions to run.
You should start eclipse with: authbind --deep eclipse Since eclipse doesn't start tomcat via startup.sh file, inserting authbind there will have no effect.