RE: Application gets started twice

2009-10-12 Thread Maciej Zabielski
Chuck, thank you for your advice and patience :)

I have found context element nested inside host element on some tutorial long 
time ago and that where all the troubles started (It was probably meant for 
pre 5 Tomcat). Now, following your advice, I have chosen the ROOT approach to 
be perfectly legal.

My last problem is the possibility to make the localhost:8080 (used for mod_jk) 
also available under localhost:8080/app (as internal endpoints)
Is there any legal/simple way to accomplish this?

Otherwise I will have put my application back to localhost:8080/app
And try to reconfigure mod_jk so that it will show it under mydomain.com 
instead of mydomain.com/app

Thanks, 
Maciej

--

[Chuck]
You probably don't want to get rid of the Context elements, but they really 
should not be in server.xml, at least not on Tomcat 5.0 or newer.  Also, if you 
want a particular webapp to be the default webapp for a Host, it should be 
named ROOT, not anything else.

[Chuck]
Again, Context elements should not be in server.xml, and the default webapp 
for the Host should be named ROOT.  Following standard practice makes things 
much easier; if you were to do that, you could eliminate the Context element 
altogether, and simply place your webapp in:
  /usr/local/apache-tomcat-5.5.28/AlfrescoApp/ROOT.war

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



RE: Application gets started twice

2009-10-12 Thread Maciej Zabielski
Yes, that sounds like a good idea.
For now I have tried something similar that has only one drawback - it is 
visible from outside.
Because I didn't want to mess with alfresco endpoints, I have moved alfresco to 
regular webapps folder, 
Share site is under its own host.

Therefore Share site works directly like this share.domain.com
And for Alfresco I use alfresco.domain.com with auto rewrite to 
alfresco.domain.com/alfresco 
That is rather fine with me.

Locally Alfresco is available under regular address localhost:8080/alfresco and 
Share application can access all the endpoints without any modifications.

Inside HTTPD virtual host for Alfresco I have added:
RewriteEngine On
RewriteCond %{REQUEST_URI} !^/alfresco/
RewriteRule ^/. http://alfresco.tessel.pl/alfresco/ [R]


Once more - big thanks for your support


Regards
Maciej

-Original Message-
From: Caldarale, Charles R [mailto:chuck.caldar...@unisys.com] 
Sent: Monday, October 12, 2009 3:19 PM
To: Tomcat Users List
Subject: RE: Application gets started twice

 From: Maciej Zabielski [mailto:m...@tessel.pl]
 Subject: RE: Application gets started twice
 
 My last problem is the possibility to make the localhost:8080 (used for
 mod_jk) also available under localhost:8080/app (as internal endpoints)
 Is there any legal/simple way to accomplish this?

Since you want this to be effective on port 8080 (httpd not involved), you can 
use the rewrite filter:
http://tuckey.org/urlrewrite/

Alternatively, you could install a dummy webapp at either ROOT or app that 
simply forwards all requests to the correct one.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY 
MATERIAL and is thus for use only by the intended recipient. If you received 
this in error, please contact the sender and delete the e-mail and its 
attachments from all computers.


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


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



RE: Application gets started twice

2009-10-09 Thread Maciej Zabielski
Thank you for your time so far!
And sorry for a long mail this time :)

Because I had some other problems with missing libraries I have decided to get 
a new installation of Tomcat from apache.org - It solved many problems as 
compared to Centos yum installation. I have a script that will start it as a 
service under tomcat account.

It is not that easy for me to get rid of Context element as when I do that, my 
mod_jk stops working 
I can use it like mydomain.com/alfresco but not mydomain.com
When I add Context element that points directly to alfresco, it works fine 
(mydomain.com).

Mikolaj wrote: move webapp to folder different than webapps and update docBase
Well, that alone did not fix my problem, I believe What is needed additionally 
is 
deployOnStartup=false - does this option set to true deployes only to default 
location? (not the one specified in context?)

Chuck wrote: docBase should point to some directory or .war file directly 
*underneath* the appBase directory.

I'm confused as documentation says:

When using automatic deployment, the docBase defined by an XML Context file 
should be outside of the appBase directory. If this is not the case 
difficulties may be experienced deploying the web application or the 
application may be deployed twice.

Finally, note that if you are defining contexts explicitly, you should probably 
turn off automatic application deployment. Otherwise, your context will be 
deployed twice each, and that may cause problems for your app.

Taking all of that into account, I have created this HOST definition, and I 
copy unpacked WAR manually to docBase dir.

Host name=localhost debug=0 
appBase=/usr/local/apache-tomcat-5.5.28/AlfrescoApp unpackWARs=true
autoDeploy=false xmlValidation=false xmlNamespaceAware=false 
deployOnStartup=false
Context path= 
docBase=/usr/local/apache-tomcat-5.5.28/AlfrescoDocBase/alfresco/
Aliasalfresco.domain.com/Alias
/Host

Host name=share.tessel.pl debug=0 
appBase=/usr/local/apache-tomcat-5.5.28/ShareApp unpackWARs=true 
autoDeploy=false xmlValidation=false xmlNamespaceAware=false 
deployOnStartup=false
Context path= 
docBase=/usr/local/apache-tomcat-5.5.28/ShareDocBase/share/
Aliasshare.domain.com/Alias
/Host


My virtual host for Apache looks like this:

VirtualHost *:80
ServerName alfresco.domain.com
DocumentRoot /usr/local/apache-tomcat-5.5.28/AlfrescoDocBase/alfresco
#DirectoryIndex index.jsp

Alias /alfresco 
/usr/local/apache-tomcat-5.5.28/AlfrescoDocBase/alfresco

JkMount /* alfresco_wrk

JkUnMount /images/* alfresco_wrk
JkUnMount /css/* alfresco_wrk
JkUnMount /scripts/* alfresco_wrk
JkUnMount /yui/* alfresco_wrk
JkUnMount /*.gif alfresco_wrk
JkUnMount /*.jpg alfresco_wrk
JkUnMount /*.html alfresco_wrk

Options FollowSymLinks

Directory /usr/local/apache-tomcat-5.5.28/AlfrescoDocBase/alfresco
AllowOverride None
Allow from all
/Directory

Directory 
/usr/local/apache-tomcat-5.5.28/AlfrescoDocBase/alfresco/WEB-INF/
AllowOverride None
deny from all
/Directory
Directory 
/usr/local/apache-tomcat-5.5.28/AlfrescoDocBase/alfresco/META-INF/
AllowOverride None
deny from all
/Directory
/VirtualHost


Final questions:
Is this configuration reasonable, or is it a total mess? :)
Can I be sure that applications will not get started twice now?

Can you please suggest best solution so that application Alfresco that is now 
available under
http://localhost:8080/
would be at the same time available under
http://localhost:8080/alfresco
? This is needed for multiple endpoints that Share site refers to.

Thank you!
Maciej

-Original Message-
From: Mark Thomas [mailto:ma...@apache.org] 
Sent: Thursday, October 08, 2009 1:57 PM
To: Tomcat Users List
Subject: Re: Application gets started twice

Maciej Zabielski wrote:
 Hi, 
 I couldn't find anything related to my configuration problem.
 I have Alfresco application installed under webapps/alfresco. The host looks 
 like this:
 
 Host name=localhost debug=0 appBase=webapps unpackWARs=true 
 autoDeploy=false  xmlValidation=false xmlNamespaceAware=false
Context path= docBase=/var/lib/tomcat5/webapps/alfresco/ 
Aliasalfresco.mydomain.com/Alias
 /Host

deployOnStartup is deploying the affresco dir as /alfresco when Tomcat starts.
Set deployOnStartup to false or delete the above context element and rename
/var/lib/tomcat5/webapps/alfresco to /var/lib/tomcat5/webapps/ROOT

Mark


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


-
To unsubscribe

RE: mod_jk problem related to multiple hosts on Apache and Tomcat

2009-10-08 Thread Maciej Zabielski
Well Andre, you are right, but when I started reading what is the easiest way 
to 
make Tomcat available on port 80 (under Centos 5.3) the most common answer was: 
use Apache HTTPD.

Other solutions looked even more complicated as:
1 - Ports below 1024 are available only to root user, and I wanted to run 
Tomcat under default Tomcat user
2 - I have removed aliases and exclusions from host configurations and left 
parts relevant to my question, so not everything will be served by Tomcat.
3 - The applications that I'm using have multiple endpoints defined (more than 
10 I believe) in different configuration files, and as far as I know it might 
be the case that not all of them are configurable. Because of that I still need 
localhost:8080 to serve the same application. This is going to be solved in 
some future releases of Alfresco so it is going to be possible to set main 
endpoint as just one configuration value.
4 - I can still use Apache HTTPD to host other applications on that server, 
that are PHP based. (I know you can make PHP work on Tomcat somehow, but I 
believe it is recommended or advised to run PHP on Apache HTTPD if possible?) 
 

Regards,
Maciej

-Original Message-
From: André Warnier [mailto:a...@ice-sa.com] 
Sent: Thursday, October 08, 2009 2:14 AM
To: Tomcat Users List
Subject: Re: mod_jk problem related to multiple hosts on Apache and Tomcat

One real question is why you are bothering with an Apache httpd in 
front, since unless I saw this wrong, you are proxying absolutely 
everything to Tomcat, in both virtual hosts.
JkMount /* etc..

Why not just turn off Apache, and have Tomcat listen on port 80 ?
You would save yourself some complication and some overhead.


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


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



Application gets started twice

2009-10-08 Thread Maciej Zabielski
Hi, 
I couldn't find anything related to my configuration problem.
I have Alfresco application installed under webapps/alfresco. The host looks 
like this:

Host name=localhost debug=0 appBase=webapps unpackWARs=true 
autoDeploy=false  xmlValidation=false xmlNamespaceAware=false
   Context path= docBase=/var/lib/tomcat5/webapps/alfresco/   
   Aliasalfresco.mydomain.com/Alias
/Host

When I look at the application log, or catalina.out I can see, that the 
application is started twice.
(there are two application started entries)
That happens for each restart of Tomcat...

(alias is used for my Apache HTTPD connection, I use Tomcat5, Centos 5.3)

Thanks for your great support!
Mike

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



mod_jk problem related to multiple hosts on Apache and Tomcat

2009-10-07 Thread Maciej Zabielski
Hello, 

I have a mod_jk problem related to multiple hosts on Apache and Tomcat

My setup is
Centos 5.3 + Apache HTTPD 2.2.3 + Tomcat 5

httpd.conf contains (Just before section 3) Basic mod_jk directives.
At the end it contains two virtual hosts:
(all sections are placed in proper files, but I have grouped them to make it 
easier to read)


VirtualHost *:80
ServerName share.domain.com
DocumentRoot /var/lib/tomcat5/ShareApp/share/
Alias / /var/lib/tomcat5/ShareApp/share
JkMount /* share_wrk
Options FollowSymLinks
/VirtualHost

Worker file defined: 
worker.list=share_wrk
worker.share_wrk.port=8009
worker.share_wrk.host=share.domain.com
worker.share_wrk.type=ajp13
worker.share_wrk.lbfactor=1

Tomcat host:
Host name=share.tessel.pl debug=0 
appBase=/var/lib/tomcat5/ShareApp unpackWARs=true autoDeploy=true
xmlValidation=false xmlNamespaceAware=false
Context path= docBase=/var/lib/tomcat5/ShareApp/share/
Aliasshare.domain.com/Alias
/Host
-

VirtualHost *:80
ServerName alfresco.domain.com  
DocumentRoot /var/lib/tomcat5/webapps/alfresco
Alias /alfresco /var/lib/tomcat5/webapps/alfresco/
   JkMount /alfresco/* alfresco_wrk
Options FollowSymLinks
/VirtualHost

Worker file:
worker.list=alfresco_wrk
worker.alfresco_wrk.port=8009
worker.alfresco_wrk.host=localhost
worker.alfresco_wrk.type=ajp13
worker.alfresco_wrk.lbfactor=1

Tomcat Host
Host name=localhost debug=0 appBase=webapps unpackWARs=true 
autoDeploy=true
xmlValidation=false xmlNamespaceAware=false
Context path= docBase=/var/lib/tomcat5/webapps/   
Aliasalfresco.domain.com/Alias
/Host
-

Problem description:
Share site has dedicated host in Tomcat and is linked to dedicated host in 
Apache - it works perfectly.
By typing address like share.domain.com I get the proper index document 
processed by Tomcat (from the root of the app: /index.jsp)

Alfresco site on the other hand is located in the Tomcat Localhost subdirectory 
/alfresco (webapps/alfresco/index.jsp)
When I use this config:   JkMount /* alfresco_wrk
I can access this site by typing alfresco.domain.com/alfresco but that is not 
what I need :( (I want direct access without /alfresco)

So when I change config to point directly into alfresco root:
JkMount /alfresco/* alfresco_wrk
And navigate to alfresco.domain.com I get unprocessed JSP file (displayed as 
text) so it looks like it was not passed to Tomcat?
(But I ended in a proper place, because index.html is displayed properly by 
Apache itself)

I can’t move alfresco to separate site as I need acees to it locally via 
localhost:8080/alfresco address.

I would greatly appretiate any suggestions!
Thank you!

Best regards,
Mike


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



RE: mod_jk problem related to multiple hosts on Apache and Tomcat

2009-10-07 Thread Maciej Zabielski
Thank you both for your support!
You are absolutely right.

My thinking (rather unexperienced, because this is my first month with linux / 
tomcat)
was that by setting:
docBase=/var/lib/tomcat5/webapps/alfresco
alfresco would become root of localhost (as it actually does?)
and therefore would be not accessible via http://localhost:8080/alfresco (but 
it still is!)
As I have said, this address is needed for Share site as changing endpoints 
does not always work

I beleive this solves my problem for now - I will have to do some test 
tomorrow, but looks promising!

What I still don't know, how to achieve that sort of functionality for many 
hosts using only localhost.
Example:
a_domain.com - localhost:8080/app1
b_domain.com - localhost:8080/app2

As opposed to the solution that I have now:
a_domain.com - localhost:8080/app1
b_domain.com - host2:8080/app2

Well, I would have to think it over tommorow as its almost midnight in country! 
:)
Once more, thank you very much for pointing out my mistake!
___
From: Tsirkin Evgeny [tsir...@gmail.com]
Sent: Wednesday, October 07, 2009 8:50 PM
To: Tomcat Users List
Subject: Re: mod_jk problem related to multiple hosts on Apache and Tomcat

What Chuck means is that you need
docBase=/var/lib/tomcat5/webapps/alfresco

On Wed, Oct 7, 2009 at 8:51 PM, Caldarale, Charles R 
chuck.caldar...@unisys.com wrote:

  From: Maciej Zabielski [mailto:m...@tessel.pl]
  Subject: mod_jk problem related to multiple hosts on Apache and Tomcat
 
  Tomcat Host
  Host name=localhost debug=0 appBase=webapps unpackWARs=true
 autoDeploy=true
xmlValidation=false xmlNamespaceAware=false
Context path= docBase=/var/lib/tomcat5/webapps/
Aliasalfresco.domain.com/Alias
  /Host

 I can't advise you about the httpd-related stuff, but the above is clearly
 wrong.  The docBase attribute of a Context must not be the same as the
 Host appBase; docBase should point to some directory or .war file directly
 *underneath* the appBase directory.  (Your other Host element is correct.)

  - Chuck


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