You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Manuel Parra <ma...@gmail.com> on 2015/09/24 14:07:43 UTC

Tomcat deployment from public_html user folder of a war application is not working

Hello I'm trying to deploy .war application from the public_html folder at
user homes.

I've added directive to server.xml :

<Listener className="org.apache.catalina.startup.UserConfig"
directoryName="public_html"
userClass="org.apache.catalina.startup.PasswdUserDatabase"/>

And I try :

http://localhost:8080/~usertest/app

And it return :

404 error

Then I try :

http://localhost:8080/~usertest/app.war

It download app.war but it doesn't serve the app.

User home contains folder :

public_html/app.war

So, what is the problem?

 I'm using tomcat 7

Thanks in advance.

Re: Tomcat deployment from public_html user folder of a war application is not working

Posted by ManuParra <ma...@gmail.com>.
But, each user have public_html folder at home folder, so where I configure what is the war to execute in public_html ?

For instance, in:
http://localhost:8080/~usertest/
Where in filesystem I have: /home/usertest/public_html/app.war , what is the configuration in Tomcat for http://localhost:8080/~usertest/ ,  execute  the app.war ??

The main idea is that each user publish an app (just one) in public_html (homes) folder.

In Tomcat Manager, I can see http://localhost:8080/~<list of users> , but when I click it, 
it return 404 error.



Thanks in advance.
 

Manuel Parra

> On 24 Sep 2015, at 14:22, Konstantin Kolinko <kn...@gmail.com> wrote:
> 
> 2015-09-24 15:07 GMT+03:00 Manuel Parra <ma...@gmail.com>:
>> Hello I'm trying to deploy .war application from the public_html folder at
>> user homes.
>> 
>> I've added directive to server.xml :
>> 
>> <Listener className="org.apache.catalina.startup.UserConfig"
>> directoryName="public_html"
>> userClass="org.apache.catalina.startup.PasswdUserDatabase"/>
>> 
>> And I try :
>> 
>> http://localhost:8080/~usertest/app
>> 
>> And it return :
>> 
>> 404 error
>> 
>> Then I try :
>> 
>> http://localhost:8080/~usertest/app.war
>> 
>> It download app.war but it doesn't serve the app.
>> 
>> User home contains folder :
>> 
>> public_html/app.war
>> 
>> So, what is the problem?
>> 
>> I'm using tomcat 7
> 
> 
> There is no such feature.
> 
> 1. The UserConfig listener creates one web application per user.
> http://localhost:8080/~usertest/  is the one and the only web
> application for usertest user.
> 
> 2. Note that the user running Tomcat usually does not have write
> access to other user's directory. So it cannot unpack a war file owned
> by another user into that user's directory, even if someone were going
> to implement such a feature.
> 
> ---------------------------------------------------------------------
> 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: Tomcat deployment from public_html user folder of a war application is not working

Posted by Konstantin Kolinko <kn...@gmail.com>.
2015-09-24 15:07 GMT+03:00 Manuel Parra <ma...@gmail.com>:
> Hello I'm trying to deploy .war application from the public_html folder at
> user homes.
>
> I've added directive to server.xml :
>
> <Listener className="org.apache.catalina.startup.UserConfig"
> directoryName="public_html"
> userClass="org.apache.catalina.startup.PasswdUserDatabase"/>
>
> And I try :
>
> http://localhost:8080/~usertest/app
>
> And it return :
>
> 404 error
>
> Then I try :
>
> http://localhost:8080/~usertest/app.war
>
> It download app.war but it doesn't serve the app.
>
> User home contains folder :
>
> public_html/app.war
>
> So, what is the problem?
>
>  I'm using tomcat 7
>


There is no such feature.

1. The UserConfig listener creates one web application per user.
http://localhost:8080/~usertest/  is the one and the only web
application for usertest user.

2. Note that the user running Tomcat usually does not have write
access to other user's directory. So it cannot unpack a war file owned
by another user into that user's directory, even if someone were going
to implement such a feature.

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


Re: Tomcat deployment from public_html user folder of a war application is not working

Posted by Manuel Parra <ma...@gmail.com>.
Thanks, yes, I was looking for other solutions.
Thanks again !

On Fri, Sep 25, 2015 at 1:54 PM, Aurélien Terrestris <at...@gmail.com>
wrote:

> As said by Konstantin, the listener doesn't do what you are trying to
> achieve (I tested on my side, it doesn't work).
>
> You can do virtual hosting, but this means that you need either one
> different host name or port for each user. I think it is easier to
> deal with ports, and then you can hide them by using an Apache in
> front of the Tomcat, with some RewriteRules to proxify to the good
> user (guessing the port by the uid, you can automatically build your
> httpd.conf)
>
> A.T.
>
> 2015-09-24 18:28 GMT+02:00 Manuel Parra <ma...@gmail.com>:
> > Do you recommend one HOST for each user with especifically appBase ?
> >
> > Thanks.
> >
> > On Thu, Sep 24, 2015 at 6:18 PM, Manuel Parra <ma...@gmail.com>
> wrote:
> >
> >> Well Im using localhost and myserver.com as a server from I connect
> (URL).
> >> May be this a problem with HOST in server.xml?
> >>
> >> Regards.
> >>
> >> On Thu, Sep 24, 2015 at 6:02 PM, Manuel Parra <ma...@gmail.com>
> wrote:
> >>
> >>> Yes.
> >>> This is my Configuration for the hosts in server.xml:
> >>>
> >>> <Host name="localhost"  appBase="webapps" unpackWARs="true" autoDeploy=
> >>> "true">
> >>>
> >>> ...
> >>>
> >>> <Listener className="org.apache.catalina.startup.UserConfig"
> >>> directoryName="public_html"  userClass=
> >>> "org.apache.catalina.startup.PasswdUserDatabase" />
> >>>
> >>> </host>
> >>>
> >>> Then at user's homes I have:
> >>>
> >>> /home/usertest/public_html/app.war
> >>>
> >>> But in http://localhost:8080/~usertest/     -->
> >>> HTTP Status 404 - /~usertest/
> >>>
> >>> Thanks in advance.
> >>>
> >>>
> >>>
> >>>
> >>> On Thu, Sep 24, 2015 at 3:41 PM, Aurélien Terrestris <
> >>> aterrestris@gmail.com> wrote:
> >>>
> >>>> Hi,
> >>>>
> >>>> first, you should check that the Host is configured with
> >>>> autoDeploy="true"
> >>>>
> >>>> 2015-09-24 14:07 GMT+02:00 Manuel Parra <ma...@gmail.com>:
> >>>> > Hello I'm trying to deploy .war application from the public_html
> >>>> folder at
> >>>> > user homes.
> >>>> >
> >>>> > I've added directive to server.xml :
> >>>> >
> >>>> > <Listener className="org.apache.catalina.startup.UserConfig"
> >>>> > directoryName="public_html"
> >>>> > userClass="org.apache.catalina.startup.PasswdUserDatabase"/>
> >>>> >
> >>>> > And I try :
> >>>> >
> >>>> > http://localhost:8080/~usertest/app
> >>>> >
> >>>> > And it return :
> >>>> >
> >>>> > 404 error
> >>>> >
> >>>> > Then I try :
> >>>> >
> >>>> > http://localhost:8080/~usertest/app.war
> >>>> >
> >>>> > It download app.war but it doesn't serve the app.
> >>>> >
> >>>> > User home contains folder :
> >>>> >
> >>>> > public_html/app.war
> >>>> >
> >>>> > So, what is the problem?
> >>>> >
> >>>> >  I'm using tomcat 7
> >>>> >
> >>>> > Thanks in advance.
> >>>>
> >>>> ---------------------------------------------------------------------
> >>>> 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: Tomcat deployment from public_html user folder of a war application is not working

Posted by Aurélien Terrestris <at...@gmail.com>.
As said by Konstantin, the listener doesn't do what you are trying to
achieve (I tested on my side, it doesn't work).

You can do virtual hosting, but this means that you need either one
different host name or port for each user. I think it is easier to
deal with ports, and then you can hide them by using an Apache in
front of the Tomcat, with some RewriteRules to proxify to the good
user (guessing the port by the uid, you can automatically build your
httpd.conf)

A.T.

2015-09-24 18:28 GMT+02:00 Manuel Parra <ma...@gmail.com>:
> Do you recommend one HOST for each user with especifically appBase ?
>
> Thanks.
>
> On Thu, Sep 24, 2015 at 6:18 PM, Manuel Parra <ma...@gmail.com> wrote:
>
>> Well Im using localhost and myserver.com as a server from I connect (URL).
>> May be this a problem with HOST in server.xml?
>>
>> Regards.
>>
>> On Thu, Sep 24, 2015 at 6:02 PM, Manuel Parra <ma...@gmail.com> wrote:
>>
>>> Yes.
>>> This is my Configuration for the hosts in server.xml:
>>>
>>> <Host name="localhost"  appBase="webapps" unpackWARs="true" autoDeploy=
>>> "true">
>>>
>>> ...
>>>
>>> <Listener className="org.apache.catalina.startup.UserConfig"
>>> directoryName="public_html"  userClass=
>>> "org.apache.catalina.startup.PasswdUserDatabase" />
>>>
>>> </host>
>>>
>>> Then at user's homes I have:
>>>
>>> /home/usertest/public_html/app.war
>>>
>>> But in http://localhost:8080/~usertest/     -->
>>> HTTP Status 404 - /~usertest/
>>>
>>> Thanks in advance.
>>>
>>>
>>>
>>>
>>> On Thu, Sep 24, 2015 at 3:41 PM, Aurélien Terrestris <
>>> aterrestris@gmail.com> wrote:
>>>
>>>> Hi,
>>>>
>>>> first, you should check that the Host is configured with
>>>> autoDeploy="true"
>>>>
>>>> 2015-09-24 14:07 GMT+02:00 Manuel Parra <ma...@gmail.com>:
>>>> > Hello I'm trying to deploy .war application from the public_html
>>>> folder at
>>>> > user homes.
>>>> >
>>>> > I've added directive to server.xml :
>>>> >
>>>> > <Listener className="org.apache.catalina.startup.UserConfig"
>>>> > directoryName="public_html"
>>>> > userClass="org.apache.catalina.startup.PasswdUserDatabase"/>
>>>> >
>>>> > And I try :
>>>> >
>>>> > http://localhost:8080/~usertest/app
>>>> >
>>>> > And it return :
>>>> >
>>>> > 404 error
>>>> >
>>>> > Then I try :
>>>> >
>>>> > http://localhost:8080/~usertest/app.war
>>>> >
>>>> > It download app.war but it doesn't serve the app.
>>>> >
>>>> > User home contains folder :
>>>> >
>>>> > public_html/app.war
>>>> >
>>>> > So, what is the problem?
>>>> >
>>>> >  I'm using tomcat 7
>>>> >
>>>> > Thanks in advance.
>>>>
>>>> ---------------------------------------------------------------------
>>>> 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: Tomcat deployment from public_html user folder of a war application is not working

Posted by Manuel Parra <ma...@gmail.com>.
Do you recommend one HOST for each user with especifically appBase ?

Thanks.

On Thu, Sep 24, 2015 at 6:18 PM, Manuel Parra <ma...@gmail.com> wrote:

> Well Im using localhost and myserver.com as a server from I connect (URL).
> May be this a problem with HOST in server.xml?
>
> Regards.
>
> On Thu, Sep 24, 2015 at 6:02 PM, Manuel Parra <ma...@gmail.com> wrote:
>
>> Yes.
>> This is my Configuration for the hosts in server.xml:
>>
>> <Host name="localhost"  appBase="webapps" unpackWARs="true" autoDeploy=
>> "true">
>>
>> ...
>>
>> <Listener className="org.apache.catalina.startup.UserConfig"
>> directoryName="public_html"  userClass=
>> "org.apache.catalina.startup.PasswdUserDatabase" />
>>
>> </host>
>>
>> Then at user's homes I have:
>>
>> /home/usertest/public_html/app.war
>>
>> But in http://localhost:8080/~usertest/     -->
>> HTTP Status 404 - /~usertest/
>>
>> Thanks in advance.
>>
>>
>>
>>
>> On Thu, Sep 24, 2015 at 3:41 PM, Aurélien Terrestris <
>> aterrestris@gmail.com> wrote:
>>
>>> Hi,
>>>
>>> first, you should check that the Host is configured with
>>> autoDeploy="true"
>>>
>>> 2015-09-24 14:07 GMT+02:00 Manuel Parra <ma...@gmail.com>:
>>> > Hello I'm trying to deploy .war application from the public_html
>>> folder at
>>> > user homes.
>>> >
>>> > I've added directive to server.xml :
>>> >
>>> > <Listener className="org.apache.catalina.startup.UserConfig"
>>> > directoryName="public_html"
>>> > userClass="org.apache.catalina.startup.PasswdUserDatabase"/>
>>> >
>>> > And I try :
>>> >
>>> > http://localhost:8080/~usertest/app
>>> >
>>> > And it return :
>>> >
>>> > 404 error
>>> >
>>> > Then I try :
>>> >
>>> > http://localhost:8080/~usertest/app.war
>>> >
>>> > It download app.war but it doesn't serve the app.
>>> >
>>> > User home contains folder :
>>> >
>>> > public_html/app.war
>>> >
>>> > So, what is the problem?
>>> >
>>> >  I'm using tomcat 7
>>> >
>>> > Thanks in advance.
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>>> For additional commands, e-mail: users-help@tomcat.apache.org
>>>
>>>
>>
>

Re: Tomcat deployment from public_html user folder of a war application is not working

Posted by Manuel Parra <ma...@gmail.com>.
Well Im using localhost and myserver.com as a server from I connect (URL).
May be this a problem with HOST in server.xml?

Regards.

On Thu, Sep 24, 2015 at 6:02 PM, Manuel Parra <ma...@gmail.com> wrote:

> Yes.
> This is my Configuration for the hosts in server.xml:
>
> <Host name="localhost"  appBase="webapps" unpackWARs="true" autoDeploy=
> "true">
>
> ...
>
> <Listener className="org.apache.catalina.startup.UserConfig"
> directoryName="public_html"  userClass=
> "org.apache.catalina.startup.PasswdUserDatabase" />
>
> </host>
>
> Then at user's homes I have:
>
> /home/usertest/public_html/app.war
>
> But in http://localhost:8080/~usertest/     -->
> HTTP Status 404 - /~usertest/
>
> Thanks in advance.
>
>
>
>
> On Thu, Sep 24, 2015 at 3:41 PM, Aurélien Terrestris <
> aterrestris@gmail.com> wrote:
>
>> Hi,
>>
>> first, you should check that the Host is configured with autoDeploy="true"
>>
>> 2015-09-24 14:07 GMT+02:00 Manuel Parra <ma...@gmail.com>:
>> > Hello I'm trying to deploy .war application from the public_html folder
>> at
>> > user homes.
>> >
>> > I've added directive to server.xml :
>> >
>> > <Listener className="org.apache.catalina.startup.UserConfig"
>> > directoryName="public_html"
>> > userClass="org.apache.catalina.startup.PasswdUserDatabase"/>
>> >
>> > And I try :
>> >
>> > http://localhost:8080/~usertest/app
>> >
>> > And it return :
>> >
>> > 404 error
>> >
>> > Then I try :
>> >
>> > http://localhost:8080/~usertest/app.war
>> >
>> > It download app.war but it doesn't serve the app.
>> >
>> > User home contains folder :
>> >
>> > public_html/app.war
>> >
>> > So, what is the problem?
>> >
>> >  I'm using tomcat 7
>> >
>> > Thanks in advance.
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>> For additional commands, e-mail: users-help@tomcat.apache.org
>>
>>
>

Re: Tomcat deployment from public_html user folder of a war application is not working

Posted by Manuel Parra <ma...@gmail.com>.
Yes.
This is my Configuration for the hosts in server.xml:

<Host name="localhost"  appBase="webapps" unpackWARs="true" autoDeploy=
"true">

...

<Listener className="org.apache.catalina.startup.UserConfig"  directoryName=
"public_html"  userClass="org.apache.catalina.startup.PasswdUserDatabase" />

</host>

Then at user's homes I have:

/home/usertest/public_html/app.war

But in http://localhost:8080/~usertest/     -->
HTTP Status 404 - /~usertest/

Thanks in advance.




On Thu, Sep 24, 2015 at 3:41 PM, Aurélien Terrestris <at...@gmail.com>
wrote:

> Hi,
>
> first, you should check that the Host is configured with autoDeploy="true"
>
> 2015-09-24 14:07 GMT+02:00 Manuel Parra <ma...@gmail.com>:
> > Hello I'm trying to deploy .war application from the public_html folder
> at
> > user homes.
> >
> > I've added directive to server.xml :
> >
> > <Listener className="org.apache.catalina.startup.UserConfig"
> > directoryName="public_html"
> > userClass="org.apache.catalina.startup.PasswdUserDatabase"/>
> >
> > And I try :
> >
> > http://localhost:8080/~usertest/app
> >
> > And it return :
> >
> > 404 error
> >
> > Then I try :
> >
> > http://localhost:8080/~usertest/app.war
> >
> > It download app.war but it doesn't serve the app.
> >
> > User home contains folder :
> >
> > public_html/app.war
> >
> > So, what is the problem?
> >
> >  I'm using tomcat 7
> >
> > Thanks in advance.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>

Re: Tomcat deployment from public_html user folder of a war application is not working

Posted by Aurélien Terrestris <at...@gmail.com>.
Hi,

first, you should check that the Host is configured with autoDeploy="true"

2015-09-24 14:07 GMT+02:00 Manuel Parra <ma...@gmail.com>:
> Hello I'm trying to deploy .war application from the public_html folder at
> user homes.
>
> I've added directive to server.xml :
>
> <Listener className="org.apache.catalina.startup.UserConfig"
> directoryName="public_html"
> userClass="org.apache.catalina.startup.PasswdUserDatabase"/>
>
> And I try :
>
> http://localhost:8080/~usertest/app
>
> And it return :
>
> 404 error
>
> Then I try :
>
> http://localhost:8080/~usertest/app.war
>
> It download app.war but it doesn't serve the app.
>
> User home contains folder :
>
> public_html/app.war
>
> So, what is the problem?
>
>  I'm using tomcat 7
>
> Thanks in advance.

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