Tomcat manager ERR_CONNECTION_REFUSED - java

I use Eclipse IDE and I've JBOSS and Tomcat installed: everything seems to works, but...
When I try to connect to http://localhost:8080/manager/html to use the administration panel, I get this error:
ERR_CONNECTION_REFUSED
this is my tomcat-users file:
<?xml version='1.0' encoding='utf-8'?>
<tomcat-users>
<role rolename="tomcat"/>
<role rolename="role1"/>
<user username="tomcat" password="tomcat" roles="tomcat"/>
<user username="both" password="tomcat" roles="tomcat,role1"/>
<user username="role1" password="tomcat" roles="role1"/>
<role rolename="manager-gui"/>
<role rolename="manager-script"/>
<user username="mauro" password="mauro"
roles="manager-gui,manager-script "/>
</tomcat-users>
Windows firewall is disabled, and until now I've never had problems to see all my JPS

Give role manager-gui to some user
<user username="manager" password="tomcat" roles="manager-gui"/>
NOTE: By default, no user is included in the "manager-gui" role
required to operate the "/manager/html" web application. If you
wish to use this app, you must define such a user - the username and
password are arbitrary.

Related

How to log in to Tomcat?

I installed Tomcat on VPS with Ubuntu 16.04, everything works, but I can not log in. At the moment in the file tomcat-users.xml these are the settings:
<tomcat-users xmlns="http://tomcat.apache.org/xml"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://tomcat.apache.org/xml tomcat-users.xsd" version="1.0">
<role rolename="tomcat"/>
<role rolename="role1"/>
<role rolename="manager-gui"/>
<user username="tomcat" password="tomcat" roles="tomcat"/>
<user username="both" password="tomcat" roles="tomcat,role1"/>
<user username="role1" password="tomcat" roles="role1"/>
<user username="manager" password="manager" roles="manager-gui"/>
</tomcat-users>
I use manager, but I can not enter. Tell me what could be the problem? In the files manager and host-manager everything is configured, otherwise there would be another error. Location of tomcat-users: /opt/tomcat/conf/tomcat-users.xml
Contents of tomcat.service:
[Unit]
Description=Apache Tomcat Web Application Container
After=network.target
[Service]
Type=forking
Environment=JAVA_HOME=/usr/lib/jvm/java-1.8.0-openjdk-amd64/jre
Environment=CATALINA_PID=/opt/tomcat/temp/tomcat.pid
Environment=CATALINA_HOME=/opt/tomcat
Environment=CATALINA_BASE=/opt/tomcat
Environment='CATALINA_OPTS=-Xms512M -Xmx1024M -server -XX:+UseParallelGC'
Environment='JAVA_OPTS=-Djava.awt.headless=true -Djava.security.egd=file:/dev/./urandom'
ExecStart=/opt/tomcat/bin/startup.sh
ExecStop=/opt/tomcat/bin/shutdown.sh
User=tomcat
Group=tomcat
UMask=0007
RestartSec=10
Restart=always
[Install]
WantedBy=multi-user.target

Tomcat login error

I'm trying to develop an web app using java. I was using apache tomcat 7 and it was working fine. But today I installed tomcat 8. Then I transferred my web app to the new installation of apache. But now, I can't login to the web app.
Here is my tomcat-users.xml:
<tomcat-users>
<role rolename="tomcat"/>
<role rolename="role1"/>
<role rolename="manager-gui"/>
<user username="manager" password="tomcat" roles="manager-gui"/>
<user username="tomcat" password="tomcat" roles="admin,tomcat"/>
<user username="both" password="tomcat" roles="tomcat,role1"/>
<user username="role1" password="tomcat" roles="role1"/>
</tomcat-users>
When I tried to access the login example of the apache tomcat using the user name tomcat and password tomcat, it directs to the error page. It says,
Invalid username and/or password, please try again.
Can any one tell me where the error is ?

TomcatEmbeddedServletContainer - Authentication required dialog box

I'm trying to access the Spring Boot appication running on embedded Tomcat container on the local machine using http://localhost:8080/ProjectName/
As I access the application the dialouge box is being displayed.
For a non-embedded Tomcact container I can modify the tomcat-server.xml and add
<tomcat-users>
<role rolename="manager"/>
<role rolename="admin"/>
<role rolename="admin-gui"/>
<role rolename="manager-gui"/>
<user username="admin" password="admin" roles="admin,manager,"/>
</tomcat-users>
How would I do it on embedded tomcat container?
Use the addUser()/addRole() methods.

Managing Web applications in Tomcat by command line

I have configured Tomcat6 on RHEL6. I have several war files deployed and the web server is up and running. I could log into the "Tomcat Web Application Manager" after configuring $catalina.home/conf/tomcat-user.xml appropriately, which looks like below :
<?xml version='1.0' encoding='utf-8'?>
<tomcat-users>
<role rolename="tomcat"/>
<role rolename="role1"/>
<user username="tomcat" password="tomcat" roles="tomcat"/>
<user username="both" password="tomcat" roles="tomcat,role1"/>
<user username="role1" password="tomcat" roles="role1"/>
<user name="tomcat" password="password" roles="manager" />
</tomcat-users>
I used the following to command to stop the "/httpif" application, but didn't work.
wget http://tomcat:password#localhost:8080/manager/html/stop?path=/httpif
Error what I got was 401 unauthorized.
--2014-03-05 14:28:23-- http://localhost:8080/manager/html/stop?path=/httpif
Resolving localhost (localhost)... ::1, 127.0.0.1
Connecting to localhost (localhost)|::1|:8080... connected.
HTTP request sent, awaiting response... 401 Unauthorized
Authorization failed.
Can anyone help me how do I get through this.? Thanks in advance.
Try to add the role manager-gui to the tomcat user and change its password to password="password"
<?xml version='1.0' encoding='utf-8'?>
<tomcat-users>
<role rolename="tomcat"/>
<role rolename="manager-gui"/>
<user username="tomcat" password="password" roles="tomcat,manager-gui"/>
<user username="both" password="tomcat" roles="tomcat,role1"/>
<user username="role1" password="tomcat" roles="role1"/>
</tomcat-users>
you are not passing the auth parameter correctly. correct syntax for wget is:
wget http://localhost:8080/whatever/ --user=tomcat --password=password
don't uncomment the whole block just add these lines in block to add a single user, if one user work other will work. start with simple :-)
<?xml version='1.0' encoding='utf-8'?>
<tomcat-users>
<role rolename="manager-gui"/>
<user username="test" password="test" roles="manager-gui"/>
</tomcat-users>

why am I getting the deployment error?

As I try to deploy my web application from netbeans, I get the following error :
Starting Tomcat process...
Waiting for Tomcat...
Tomcat server started.
W:\UnderTest\NetbeansCurrent\WebApplication1\nbproject\build-impl.xml:1033:
Deployment error: Access to Tomcat server has not been authorized.
Set the correct username and password with the "manager-script" role in the
Tomcat customizer in the Server Manager.
See the server log for details.
BUILD FAILED (total time: 14 seconds)
What is that ? Why am I getting this error ?
Following is the snippet from tomcat-users.xml :
<tomcat-users>
<!--
NOTE: By default, no user is included in the "manager-gui" role required
to operate the "/manager/html" web application. If you wish to use this app,
you must define such a user - the username and password are arbitrary.
-->
<!--
NOTE: The sample user and role entries below are wrapped in a comment
and thus are ignored when reading this file. Do not forget to remove
<!.. ..> that surrounds them.
-->
<role rolename="tomcat"/>
<role rolename="role1"/>
<role rolename="manager-gui"/>
<user username="suhail" password="suhail" roles="manager-gui"/>
<user username="tomcat" password="tomcat" roles="tomcat"/>
<user username="both" password="tomcat" roles="tomcat,role1"/>
<user username="role1" password="tomcat" roles="role1"/>
</tomcat-users>
Following is the snapshot from netbeans server settings :
You have to add the manager-script in order to perform deployment operations.
So in you xml you should have something like
<user username="suhail" password="suhail" roles="manager-gui,manager-script"/>

Categories