You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Nick Klose <ni...@ualberta.ca> on 2016/07/20 21:11:20 UTC

Unable to access Manager App from remote machine

Hello,

I have recently set up Tomcat 8.5.4 on Ubuntu 14.04. I have the default
page showing on port 8080, but when I click on the Manager App button I
immediately get "403 Access Denied" and am not prompted to enter a username
or password. I have set up roles and a user in conf/tomcat-users.xml in my
Tomcat install directory (which I have named /opt/tomcat8-dev). Here's what
that file looks like:

<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="admin"/>
    <role rolename="admin-gui"/>
    <role rolename="manager"/>
    <role rolename="manager-gui"/>

    <user username="admin" password="[redacted]"
roles="admin,admin-gui,manager,manager-gui"/>
</tomcat-users>

The server I'm running it on is a remote VM without a window manager,
however I installed elinks (a command-line web browser) and tested the
Manager App and it worked fine there; I was asked for credentials, and was
able to view the app using the username/password I specified. However, this
is obviously not an ideal solution.

I have tried modifying context.xml as specified in the documentation. I
have enabled privileged mode and added a valve allowing any IP to connect
(specified using a regex). Here's what my context.xml file looks like
currently:

<?xml version="1.0" encoding="UTF-8"?>
<Context privileged="true"  antiResourceLocking="false"
docBase="${catalina.home}/webapps/manager">
​    ​
<Valve className="org.apache.catalina.valves.RemoteAddrValve" allow="^.*$"
/>
    ​
<WatchedResource>WEB-INF/web.xml</WatchedResource>
​
​    ​
<WatchedResource>${catalina.base}/conf/web.xml</WatchedResource>
    <Manager pathname="" />
</Context>

Any suggestions for how I can fix this issue?

Thanks,
Nick Klose​

Re: Unable to access Manager App from remote machine

Posted by Nick Klose <ni...@ualberta.ca>.
Hi Mark,

That solved my problem, thanks so much for your help!

Nick Klose

On Thu, Jul 21, 2016 at 1:34 PM, Mark Thomas <ma...@apache.org> wrote:

> On 21/07/2016 18:07, Nick Klose wrote:
> > Hi Mark,
> >
> > I only need access from one remote machine, but I couldn't get a valve
> > working properly for the IP I'm connecting from so I decided to open
> access
> > from anywhere until I get the Manager App working.
> >
> > The file's at at /opt/tomcat8-dev/conf/context.xml. I've not made any
> > changes to server.xml.
>
> That is the default context.xml that applies to every web application.
> You should be editing the Manager context.xml file that will be in
> webapps/manager/META-INF/context.xml
>
> Don't forget to restore conf/content.xml to its original form.
>
> Mark
>
> >
> > I tried modifying context.xml to look like this, but nothing seems to
> have
> > changed:
> >
> > <?xml version="1.0" encoding="UTF-8"?>
> > <Context>
> >     ​
> > <WatchedResource>WEB-INF/web.xml</WatchedResource>
> > ​
> > ​    ​
> > <WatchedResource>${catalina.base}/conf/web.xml</WatchedResource>
> >     <Manager pathname="" />
> > </Context>
> >
> > Thanks,
> > Nick Klose
> >
> > On Thu, Jul 21, 2016 at 12:20 AM, Mark Thomas <ma...@apache.org> wrote:
> >
> >> On 20/07/2016 23:11, Nick Klose wrote:
> >>> Hello,
> >>>
> >>> I have recently set up Tomcat 8.5.4 on Ubuntu 14.04. I have the default
> >>> page showing on port 8080, but when I click on the Manager App button I
> >>> immediately get "403 Access Denied" and am not prompted to enter a
> >> username
> >>> or password. I have set up roles and a user in conf/tomcat-users.xml in
> >> my
> >>> Tomcat install directory (which I have named /opt/tomcat8-dev). Here's
> >> what
> >>> that file looks like:
> >>>
> >>> <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="admin"/>
> >>>     <role rolename="admin-gui"/>
> >>>     <role rolename="manager"/>
> >>>     <role rolename="manager-gui"/>
> >>>
> >>>     <user username="admin" password="[redacted]"
> >>> roles="admin,admin-gui,manager,manager-gui"/>
> >>> </tomcat-users>
> >>>
> >>> The server I'm running it on is a remote VM without a window manager,
> >>> however I installed elinks (a command-line web browser) and tested the
> >>> Manager App and it worked fine there; I was asked for credentials, and
> >> was
> >>> able to view the app using the username/password I specified. However,
> >> this
> >>> is obviously not an ideal solution.
> >>>
> >>> I have tried modifying context.xml as specified in the documentation. I
> >>> have enabled privileged mode and added a valve allowing any IP to
> connect
> >>> (specified using a regex). Here's what my context.xml file looks like
> >>> currently:
> >>>
> >>> <?xml version="1.0" encoding="UTF-8"?>
> >>> <Context privileged="true"  antiResourceLocking="false"
> >>> docBase="${catalina.home}/webapps/manager">
> >>> ​    ​
> >>> <Valve className="org.apache.catalina.valves.RemoteAddrValve"
> >> allow="^.*$"
> >>> />
> >>>     ​
> >>> <WatchedResource>WEB-INF/web.xml</WatchedResource>
> >>> ​
> >>> ​    ​
> >>> <WatchedResource>${catalina.base}/conf/web.xml</WatchedResource>
> >>>     <Manager pathname="" />
> >>> </Context>
> >>>
> >>> Any suggestions for how I can fix this issue?
> >>
> >> If you want to allow access from everywhere (not recommended) just
> >> remove / comment out the Valve.
> >>
> >> Where is the context.xml file located?
> >>
> >> Unless you have changed the default settings in server.xml for the
> >> default Host, you should not need to specify a docBase in context.xml.
> >>
> >> Mark
> >>
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> >> For additional commands, e-mail: users-help@tomcat.apache.org
> >>
> >>
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>

Re: Unable to access Manager App from remote machine

Posted by Mark Thomas <ma...@apache.org>.
On 21/07/2016 18:07, Nick Klose wrote:
> Hi Mark,
> 
> I only need access from one remote machine, but I couldn't get a valve
> working properly for the IP I'm connecting from so I decided to open access
> from anywhere until I get the Manager App working.
> 
> The file's at at /opt/tomcat8-dev/conf/context.xml. I've not made any
> changes to server.xml.

That is the default context.xml that applies to every web application.
You should be editing the Manager context.xml file that will be in
webapps/manager/META-INF/context.xml

Don't forget to restore conf/content.xml to its original form.

Mark

> 
> I tried modifying context.xml to look like this, but nothing seems to have
> changed:
> 
> <?xml version="1.0" encoding="UTF-8"?>
> <Context>
>     \u200b
> <WatchedResource>WEB-INF/web.xml</WatchedResource>
> \u200b
> \u200b    \u200b
> <WatchedResource>${catalina.base}/conf/web.xml</WatchedResource>
>     <Manager pathname="" />
> </Context>
> 
> Thanks,
> Nick Klose
> 
> On Thu, Jul 21, 2016 at 12:20 AM, Mark Thomas <ma...@apache.org> wrote:
> 
>> On 20/07/2016 23:11, Nick Klose wrote:
>>> Hello,
>>>
>>> I have recently set up Tomcat 8.5.4 on Ubuntu 14.04. I have the default
>>> page showing on port 8080, but when I click on the Manager App button I
>>> immediately get "403 Access Denied" and am not prompted to enter a
>> username
>>> or password. I have set up roles and a user in conf/tomcat-users.xml in
>> my
>>> Tomcat install directory (which I have named /opt/tomcat8-dev). Here's
>> what
>>> that file looks like:
>>>
>>> <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="admin"/>
>>>     <role rolename="admin-gui"/>
>>>     <role rolename="manager"/>
>>>     <role rolename="manager-gui"/>
>>>
>>>     <user username="admin" password="[redacted]"
>>> roles="admin,admin-gui,manager,manager-gui"/>
>>> </tomcat-users>
>>>
>>> The server I'm running it on is a remote VM without a window manager,
>>> however I installed elinks (a command-line web browser) and tested the
>>> Manager App and it worked fine there; I was asked for credentials, and
>> was
>>> able to view the app using the username/password I specified. However,
>> this
>>> is obviously not an ideal solution.
>>>
>>> I have tried modifying context.xml as specified in the documentation. I
>>> have enabled privileged mode and added a valve allowing any IP to connect
>>> (specified using a regex). Here's what my context.xml file looks like
>>> currently:
>>>
>>> <?xml version="1.0" encoding="UTF-8"?>
>>> <Context privileged="true"  antiResourceLocking="false"
>>> docBase="${catalina.home}/webapps/manager">
>>> \u200b    \u200b
>>> <Valve className="org.apache.catalina.valves.RemoteAddrValve"
>> allow="^.*$"
>>> />
>>>     \u200b
>>> <WatchedResource>WEB-INF/web.xml</WatchedResource>
>>> \u200b
>>> \u200b    \u200b
>>> <WatchedResource>${catalina.base}/conf/web.xml</WatchedResource>
>>>     <Manager pathname="" />
>>> </Context>
>>>
>>> Any suggestions for how I can fix this issue?
>>
>> If you want to allow access from everywhere (not recommended) just
>> remove / comment out the Valve.
>>
>> Where is the context.xml file located?
>>
>> Unless you have changed the default settings in server.xml for the
>> default Host, you should not need to specify a docBase in context.xml.
>>
>> Mark
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>> For additional commands, e-mail: users-help@tomcat.apache.org
>>
>>
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Unable to access Manager App from remote machine

Posted by Nick Klose <ni...@ualberta.ca>.
Hi Mark,

I only need access from one remote machine, but I couldn't get a valve
working properly for the IP I'm connecting from so I decided to open access
from anywhere until I get the Manager App working.

The file's at at /opt/tomcat8-dev/conf/context.xml. I've not made any
changes to server.xml.

I tried modifying context.xml to look like this, but nothing seems to have
changed:

<?xml version="1.0" encoding="UTF-8"?>
<Context>
    ​
<WatchedResource>WEB-INF/web.xml</WatchedResource>
​
​    ​
<WatchedResource>${catalina.base}/conf/web.xml</WatchedResource>
    <Manager pathname="" />
</Context>

Thanks,
Nick Klose

On Thu, Jul 21, 2016 at 12:20 AM, Mark Thomas <ma...@apache.org> wrote:

> On 20/07/2016 23:11, Nick Klose wrote:
> > Hello,
> >
> > I have recently set up Tomcat 8.5.4 on Ubuntu 14.04. I have the default
> > page showing on port 8080, but when I click on the Manager App button I
> > immediately get "403 Access Denied" and am not prompted to enter a
> username
> > or password. I have set up roles and a user in conf/tomcat-users.xml in
> my
> > Tomcat install directory (which I have named /opt/tomcat8-dev). Here's
> what
> > that file looks like:
> >
> > <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="admin"/>
> >     <role rolename="admin-gui"/>
> >     <role rolename="manager"/>
> >     <role rolename="manager-gui"/>
> >
> >     <user username="admin" password="[redacted]"
> > roles="admin,admin-gui,manager,manager-gui"/>
> > </tomcat-users>
> >
> > The server I'm running it on is a remote VM without a window manager,
> > however I installed elinks (a command-line web browser) and tested the
> > Manager App and it worked fine there; I was asked for credentials, and
> was
> > able to view the app using the username/password I specified. However,
> this
> > is obviously not an ideal solution.
> >
> > I have tried modifying context.xml as specified in the documentation. I
> > have enabled privileged mode and added a valve allowing any IP to connect
> > (specified using a regex). Here's what my context.xml file looks like
> > currently:
> >
> > <?xml version="1.0" encoding="UTF-8"?>
> > <Context privileged="true"  antiResourceLocking="false"
> > docBase="${catalina.home}/webapps/manager">
> > ​    ​
> > <Valve className="org.apache.catalina.valves.RemoteAddrValve"
> allow="^.*$"
> > />
> >     ​
> > <WatchedResource>WEB-INF/web.xml</WatchedResource>
> > ​
> > ​    ​
> > <WatchedResource>${catalina.base}/conf/web.xml</WatchedResource>
> >     <Manager pathname="" />
> > </Context>
> >
> > Any suggestions for how I can fix this issue?
>
> If you want to allow access from everywhere (not recommended) just
> remove / comment out the Valve.
>
> Where is the context.xml file located?
>
> Unless you have changed the default settings in server.xml for the
> default Host, you should not need to specify a docBase in context.xml.
>
> Mark
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>

Re: Unable to access Manager App from remote machine

Posted by Mark Thomas <ma...@apache.org>.
On 20/07/2016 23:11, Nick Klose wrote:
> Hello,
> 
> I have recently set up Tomcat 8.5.4 on Ubuntu 14.04. I have the default
> page showing on port 8080, but when I click on the Manager App button I
> immediately get "403 Access Denied" and am not prompted to enter a username
> or password. I have set up roles and a user in conf/tomcat-users.xml in my
> Tomcat install directory (which I have named /opt/tomcat8-dev). Here's what
> that file looks like:
> 
> <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="admin"/>
>     <role rolename="admin-gui"/>
>     <role rolename="manager"/>
>     <role rolename="manager-gui"/>
> 
>     <user username="admin" password="[redacted]"
> roles="admin,admin-gui,manager,manager-gui"/>
> </tomcat-users>
> 
> The server I'm running it on is a remote VM without a window manager,
> however I installed elinks (a command-line web browser) and tested the
> Manager App and it worked fine there; I was asked for credentials, and was
> able to view the app using the username/password I specified. However, this
> is obviously not an ideal solution.
> 
> I have tried modifying context.xml as specified in the documentation. I
> have enabled privileged mode and added a valve allowing any IP to connect
> (specified using a regex). Here's what my context.xml file looks like
> currently:
> 
> <?xml version="1.0" encoding="UTF-8"?>
> <Context privileged="true"  antiResourceLocking="false"
> docBase="${catalina.home}/webapps/manager">
> \u200b    \u200b
> <Valve className="org.apache.catalina.valves.RemoteAddrValve" allow="^.*$"
> />
>     \u200b
> <WatchedResource>WEB-INF/web.xml</WatchedResource>
> \u200b
> \u200b    \u200b
> <WatchedResource>${catalina.base}/conf/web.xml</WatchedResource>
>     <Manager pathname="" />
> </Context>
> 
> Any suggestions for how I can fix this issue?

If you want to allow access from everywhere (not recommended) just
remove / comment out the Valve.

Where is the context.xml file located?

Unless you have changed the default settings in server.xml for the
default Host, you should not need to specify a docBase in context.xml.

Mark


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org