掲示板

Installation from Tomcat Bundle

thumbnail
9年前 に Mesfin Teshome によって更新されました。

Installation from Tomcat Bundle

New Member 投稿: 7 参加年月日: 13/03/31 最新の投稿
Greetings all,
I have been trying to install Liferay 6.2 CE GA2 with the Tomcat bundle on Ubuntu 14.04 & 12.04. When I try to start the tomcat server the first time using this command sudo sh /opt/liferay/tomcat-7.0.42/bin/startup.sh, it does not start. If I look at the catalina.out log, it shows the error message below
SEVERE: The web application [] appears to have started a thread named [org.python.google.common.base.internal.Finalizer] but has failed to stop it. This is very likely to create a memory leak.
Oct 15, 2014 10:05:58 AM org.apache.coyote.AbstractProtocol stop
INFO: Stopping ProtocolHandler ["ajp-bio-8009"]
Oct 15, 2014 10:05:58 AM org.apache.coyote.AbstractProtocol stop
INFO: Stopping ProtocolHandler ["http-bio-8080"]
Oct 15, 2014 10:05:58 AM org.apache.coyote.AbstractProtocol destroy
INFO: Destroying ProtocolHandler ["http-bio-8080"]
Oct 15, 2014 10:05:58 AM org.apache.coyote.AbstractProtocol destroy
INFO: Destroying ProtocolHandler ["ajp-bio-8009"]

If I stop tomcat using sudo sh /opt/liferay/tomcat-7.0.42/bin/shutdown.sh and try to start it again, all goes well. What could be the issue?

Regards,
thumbnail
9年前 に James Falkner によって更新されました。

RE: Installation from Tomcat Bundle

Liferay Legend 投稿: 1399 参加年月日: 10/09/17 最新の投稿
Mesfin Teshome:
Greetings all,
I have been trying to install Liferay 6.2 CE GA2 with the Tomcat bundle on Ubuntu 14.04 & 12.04. When I try to start the tomcat server the first time using this command sudo sh /opt/liferay/tomcat-7.0.42/bin/startup.sh, it does not start. If I look at the catalina.out log, it shows the error message below
SEVERE: The web application [] appears to have started a thread named [org.python.google.common.base.internal.Finalizer] but has failed to stop it. This is very likely to create a memory leak.
Oct 15, 2014 10:05:58 AM org.apache.coyote.AbstractProtocol stop
INFO: Stopping ProtocolHandler ["ajp-bio-8009"]
Oct 15, 2014 10:05:58 AM org.apache.coyote.AbstractProtocol stop
INFO: Stopping ProtocolHandler ["http-bio-8080"]
Oct 15, 2014 10:05:58 AM org.apache.coyote.AbstractProtocol destroy
INFO: Destroying ProtocolHandler ["http-bio-8080"]
Oct 15, 2014 10:05:58 AM org.apache.coyote.AbstractProtocol destroy
INFO: Destroying ProtocolHandler ["ajp-bio-8009"]

If I stop tomcat using sudo sh /opt/liferay/tomcat-7.0.42/bin/shutdown.sh and try to start it again, all goes well. What could be the issue?

Regards,


There is probably a more severe error earlier on in the log file. Can you look for the *first* error and post here? That 'failed to stop thread' error is common during shutdown but usually poses no issues as the portal is on the way down anyway. Also, I believe using sudo will cause the Java process to run with root privileges - probably want to change that when in production.
thumbnail
9年前 に Patrick Wolf によって更新されました。

RE: Installation from Tomcat Bundle

Regular Member 投稿: 127 参加年月日: 10/09/15 最新の投稿
Also, I believe using sudo will cause the Java process to run with root privileges - probably want to change that when in production.


I think that for any Unix or Linux operating system, when you shut down or start a service such as Tomcat, Apache, etc, you need to get the root privilege to do it. That is why Mesfin uses the sudo command.

Mesfin, what are the settings of your JVM and which one do you use? The OpenJDK downloaded from the Ubuntu's repository or the Oracle's JDK? By experience, I have never succeeded in getting Liferay working properly with the OpenJDK. Maybe there is some trick?
You may not have the right values regarding the JVM in your setenv.sh or catalina.sh file which must fit your RAM.

The error regarding the google thing is harmless. By the way, why Liferay introduced legacy software such as Google in the open source community edition?
thumbnail
9年前 に James Falkner によって更新されました。

RE: Installation from Tomcat Bundle

Liferay Legend 投稿: 1399 参加年月日: 10/09/17 最新の投稿
Patrick Wolf:
Also, I believe using sudo will cause the Java process to run with root privileges - probably want to change that when in production.


I think that for any Unix or Linux operating system, when you shut down or start a service such as Tomcat, Apache, etc, you need to get the root privilege to do it. That is why Mesfin uses the sudo command.


That's only true if the process is requires privileged resources (like a port number < 1024) - The default setting for Tomcat is to bind to port 8080 (and a few others in the 8k region) so it's possible (and common) to run as an 'ordinary' user (or some other system user created that doesn't have root privs), or to run with root privs but rely on the process to drop them via setuid/setgid immediately after starting (like mysql).
thumbnail
9年前 に Patrick Wolf によって更新されました。

RE: Installation from Tomcat Bundle

Regular Member 投稿: 127 参加年月日: 10/09/15 最新の投稿
OK then, I understand your point James. But for production, is it wise to run it as an 'ordinary' user? To test it locally on once computer, that is OK of course and that is what Mesfin is probably trying to do.
I assume that Mesfin gets something wrong in its configuration. Usually, you uncompress the Tomcat/Liferay bundle archive, run the startup shell script and that's it. It takes more or less time depending on the memory you get.
thumbnail
9年前 に James Falkner によって更新されました。

RE: Installation from Tomcat Bundle

Liferay Legend 投稿: 1399 参加年月日: 10/09/17 最新の投稿
Patrick Wolf:
OK then, I understand your point James. But for production, is it wise to run it as an 'ordinary' user? To test it locally on once computer, that is OK of course and that is what Mesfin is probably trying to do.
I assume that Mesfin gets something wrong in its configuration. Usually, you uncompress the Tomcat/Liferay bundle archive, run the startup shell script and that's it. It takes more or less time depending on the memory you get.


Yeah you brought up a great point regarding memory - if you try to allocate too much, it'll not start up properly. Or if you have an old JVM, or some weird one that we've never tested emoticon (but we do use OpenJDK regularly, and even on Ubuntu). Definitely something for Mesfin to check, but the fact that it starts up normally the second time suggests something else. Mesfin, what version of Java are you using? There was an issue with image decoding that caused errors on first startup, but not second, last year.

For production, running as a non-root user is a good idea - that way, if the system is compromised you will have the OS protections to hopefully stop whatever evil is attempted. It's not always 100% effective, but it's pretty good and way better than running as root. Here's an (old) article from Olaf Kock on the subject - notice he recommends not running as root (but many people do; you have to weigh the cost of additional config against the potential loss/damage that could occur if you do not).
thumbnail
9年前 に Patrick Wolf によって更新されました。

RE: Installation from Tomcat Bundle

Regular Member 投稿: 127 参加年月日: 10/09/15 最新の投稿
For production, running as a non-root user is a good idea - that way, if the system is compromised you will have the OS protections to hopefully stop whatever evil is attempted.


Sorry for the misunderstanding James. I did not mean running as root but as a system user. For instance, you create a system user with the uid and gid "liferay", then you may create a service with the right run levels if you install Liferay bundled with the application server. If you use an already freshly installed application server, this should be already done for you. Then Liferay is running as user "liferay", not root.
To start Liferay as a system user, you of course need to run the start script as root.
thumbnail
9年前 に James Falkner によって更新されました。

RE: Installation from Tomcat Bundle

Liferay Legend 投稿: 1399 参加年月日: 10/09/17 最新の投稿
Patrick Wolf:
For production, running as a non-root user is a good idea - that way, if the system is compromised you will have the OS protections to hopefully stop whatever evil is attempted.


Sorry for the misunderstanding James. I did not mean running as root but as a system user. For instance, you create a system user with the uid and gid "liferay", then you may create a service with the right run levels if you install Liferay bundled with the application server. If you use an already freshly installed application server, this should be already done for you. Then Liferay is running as user "liferay", not root.
To start Liferay as a system user, you of course need to run the start script as root.



Ah ok - then we are thinking the exact same thing then emoticon Yep, running as a non-root, system user is the way to go. Often times, in rc scripts you'll find 'su - <system_user> startup.sh' or something like that. That's run as root of course (because it's an rc script), but the resulting process runs as <system_user>.
thumbnail
9年前 に Patrick Wolf によって更新されました。

RE: Installation from Tomcat Bundle

Regular Member 投稿: 127 参加年月日: 10/09/15 最新の投稿
Exactly!

That does not solve Mesfin's problem emoticon

Mesfin, if you are short of memory on your system, try this in your setenv.sh or catalina.sh file:

-XX:NewSize=700m -XX:MaxNewSize=700m -Xms1024 -Xmx1024m -XX:MaxPermSize=200m -XX:SurvivorRatio=6
-XX:TargetSurvivorRatio=90 -XX:MaxTenuringThreshold=15
thumbnail
9年前 に Jack Bakker によって更新されました。

RE: Installation from Tomcat Bundle

Liferay Master 投稿: 978 参加年月日: 10/01/03 最新の投稿
Patrick Wolf:
Exactly!

That does not solve Mesfin's problem emoticon

Mesfin, if you are short of memory on your system, try this in your setenv.sh or catalina.sh file:

-XX:NewSize=700m -XX:MaxNewSize=700m -Xms1024 -Xmx1024m -XX:MaxPermSize=200m -XX:SurvivorRatio=6
-XX:TargetSurvivorRatio=90 -XX:MaxTenuringThreshold=15


This may not solve Mesfin's problem either. I really can't even guess at root cause from initial post. Tho the sidetrack into running as non-root might be useful for some reading.
thumbnail
9年前 に Patrick Wolf によって更新されました。

RE: Installation from Tomcat Bundle

Regular Member 投稿: 127 参加年月日: 10/09/15 最新の投稿
I really can't even guess at root cause from initial post. Tho the sidetrack into running as non-root might be useful for some reading.


The question asked by Mesfin is when starting Liferay for the first time, it does not start at all and he gets a bunch of errors in his log file. After stopping it and restarting it again, Liferay starts smoothly and everything is fine. He wonders why. Do you have any idea?
Please read from the start of this thread to follow.
thumbnail
9年前 に Mesfin Teshome によって更新されました。

RE: Installation from Tomcat Bundle

New Member 投稿: 7 参加年月日: 13/03/31 最新の投稿
Thank you all. These discussions gave me a lot of pointers. I am running openjdk installed with the ubuntu server.
java version "1.7.0_65"
OpenJDK Runtime Environment (IcedTea 2.5.2) (7u65-2.5.2-3~14.04)
OpenJDK Server VM (build 24.65-b04, mixed mode)

and here is the setting in the setenv.sh
CATALINA_OPTS="$CATALINA_OPTS -Dfile.encoding=UTF8 -Djava.net.preferIPv4Stack=true -Dorg.apache.catalina.loader.WebappClassLoader.ENABLE_CLEAR_REFERENCES=false -Duser.timezone=GMT -Xmx1024m -XX:MaxPermSize=256m"

The test server has 8GB ram.

I tried installing liferay from the war file but Ubuntu's implementation of Tomcat is quite different from other distros. So it is a bit complicated. I have not succeeded in that. I found the bundle installation simpler.

Thank you again. I appreciate it.
thumbnail
9年前 に Patrick Wolf によって更新されました。

RE: Installation from Tomcat Bundle

Regular Member 投稿: 127 参加年月日: 10/09/15 最新の投稿
You are welcome.
I tried installing liferay from the war file but Ubuntu's implementation of Tomcat is quite different from other distros. So it is a bit complicated. I have not succeeded in that. I found the bundle installation simpler.

Yes, Ubuntu lies in Debian whereas distros such as CentOs, Redhat, SuSe, etc, have a different file system. I installed Liferay on an Ubuntu Tomcat from the Liferay 6.1 WAR file some time ago. I think that's the best way to do it for running it in production. This should be the same installation procedures as for 6.2. I can provide you with a detailed tutorial if you wish.
thumbnail
9年前 に Mesfin Teshome によって更新されました。

RE: Installation from Tomcat Bundle

New Member 投稿: 7 参加年月日: 13/03/31 最新の投稿
That would be such a great help, Patrick. I will owe you one emoticon
thumbnail
9年前 に Patrick Wolf によって更新されました。

RE: Installation from Tomcat Bundle

Regular Member 投稿: 127 参加年月日: 10/09/15 最新の投稿
OK then. Give me some time to write it down and I post it somewhere on Monday.
thumbnail
9年前 に Jack Bakker によって更新されました。

RE: Installation from Tomcat Bundle

Liferay Master 投稿: 978 参加年月日: 10/01/03 最新の投稿
Patrick Wolf:

Please read from the start of this thread to follow.

What's not to follow. Good luck with some sort of tutorial on installing over Ubuntu to address whatever the initial issue was. If installation info needed, you might look at Liferay documentation itself. I've been leaning to the new and pretty cool dev.liferay.com lately.
thumbnail
9年前 に Patrick Wolf によって更新されました。

RE: Installation from Tomcat Bundle

Regular Member 投稿: 127 参加年月日: 10/09/15 最新の投稿
It is not worth being so aggressive in your response. This is a place where people ask for some help or some more information on Liferay. Whatever the question is, it does not harm to give a nice and smart reply and show some respect.

Regarding the online documentation, especially the installation part, if it were accurate and without any mistakes, people would not have any problem installing Liferay. I myself followed the documentation step by step, coma after coma, to deploy Liferay WAR file on Tomcat and on JBoss. I did not succeed the first time without any errors and problems.
thumbnail
9年前 に Jack Bakker によって更新されました。

RE: Installation from Tomcat Bundle

Liferay Master 投稿: 978 参加年月日: 10/01/03 最新の投稿
Patrick Wolf:
It is not worth being so aggressive in your response. This is a place where people ask for some help or some more information on Liferay. Whatever the question is, it does not harm to give a nice and smart reply and show some respect.

Hey Patrick, thanks for expressing your feelings. I think Liferay documentation is quite good and recently got much better with dev.liferay.com. I do think this thread was a bit mixed up wrt to trying to narrow in on a focused root cause. I look forward to sharing more.
thumbnail
9年前 に Jack Bakker によって更新されました。

RE: Installation from Tomcat Bundle

Liferay Master 投稿: 978 参加年月日: 10/01/03 最新の投稿
From your profile: "Currently leading Sage France Liferay CE 6.0.5 portal and administering it. Looking for a change and interested in roles related to the Liferay collaborative platform."

CE 6.0.5 ? for the CE v6.0 series you should upgrade to v6.0.6, but even then that is really old now.

ok, off I go now ; salut
thumbnail
9年前 に Mesfin Teshome によって更新されました。

RE: Installation from Tomcat Bundle

New Member 投稿: 7 参加年月日: 13/03/31 最新の投稿
Thanks everyone for your input. I might have pinpointed the problem. I have tomcat7 installed on ubuntu and I am trying to run liferay with bundled tomcat. I have changed the tomcat7 port but there is another port it complained about in the error message which is related to port 8005. I changed both ports. It seems to start ok now. I will monitor it and see.
It would be nice to be able to install on the existing tomcat server. Unfortunately the documentation on installation of liferay on existing tomcat is not as detailed especially for ubuntu because ubuntu handles tomcat configuration and folder structures quite differently from the other distros such as ROOT, webpps folders etc...
Thank you for pointing me to dev.liferay.com, Jack Bakker. There is a wealth of info on liferay there. I will make it may home emoticonemoticon
thumbnail
9年前 に Jack Bakker によって更新されました。

RE: Installation from Tomcat Bundle

Liferay Master 投稿: 978 参加年月日: 10/01/03 最新の投稿
Mesfin Teshome:
Thanks everyone for your input. I might have pinpointed the problem. I have tomcat7 installed on ubuntu and I am trying to run liferay with bundled tomcat. I have changed the tomcat7 port but there is another port it complained about in the error message which is related to port 8005. I changed both ports. It seems to start ok now. I will monitor it and see.
It would be nice to be able to install on the existing tomcat server. Unfortunately the documentation on installation of liferay on existing tomcat is not as detailed especially for ubuntu because ubuntu handles tomcat configuration and folder structures quite differently from the other distros such as ROOT, webpps folders etc...

Glad you discovered the issue. If you don't need the tomcat that came with Ubuntu, you could just configure so it just doesn't start at startup of the host. However, if you do need multiple tomcats running then, yeah, changing the ports is needed.
Mesfin Teshome:

Thank you for pointing me to dev.liferay.com, Jack Bakker. There is a wealth of info on liferay there. I will make it may home emoticonemoticon

Cheers, I really like it too.
thumbnail
9年前 に Patrick Wolf によって更新されました。

RE: Installation from Tomcat Bundle

Regular Member 投稿: 127 参加年月日: 10/09/15 最新の投稿
CE 6.0.5 ? for the CE v6.0 series you should upgrade to v6.0.6, but even then that is really old now.


Thank you for visiting my profile and for your suggestion. Maybe you should write to my managers who gave me the order not to upgrade when 75% was completed to run Liferay 6.1? emoticon So I am stuck with this old and now deprecated release.
thumbnail
9年前 に Jack Bakker によって更新されました。

RE: Installation from Tomcat Bundle

Liferay Master 投稿: 978 参加年月日: 10/01/03 最新の投稿
Patrick Wolf:
CE 6.0.5 ? for the CE v6.0 series you should upgrade to v6.0.6, but even then that is really old now.


Thank you for visiting my profile and for your suggestion. Maybe you should write to my managers who gave me the order not to upgrade when 75% was completed to run Liferay 6.1? emoticon So I am stuck with this old and now deprecated release.

Hey Patrick, an upgrade from v6.0.5 to v6.0.6 CE isn't as much effort as going to v6.1. There were many fixes applied when they went from v6.0.5 to v6.0.6. Enjoy the day !
thumbnail
9年前 に David H Nebinger によって更新されました。

RE: Installation from Tomcat Bundle

Liferay Legend 投稿: 14916 参加年月日: 06/09/02 最新の投稿
I'm with Jack on this one... You should always be on the latest minor version, if only for bug fixes, patches, and stability improvements. They do not introduce new functionality or change APIs in the minor releases, so it poses no issues upgrading from 6.0.5 to 6.0.6.

Not doing the upgrade exposes you to bugs, etc., and is worse than not doing it because of management concerns.
thumbnail
9年前 に Jack Bakker によって更新されました。

RE: Installation from Tomcat Bundle

Liferay Master 投稿: 978 参加年月日: 10/01/03 最新の投稿
Or at least update your profile so you look better here in the forums...emoticon
thumbnail
9年前 に Patrick Wolf によって更新されました。

RE: Installation from Tomcat Bundle

Regular Member 投稿: 127 参加年月日: 10/09/15 最新の投稿
Or at least update your profile so you look better here in the forums...emoticon


I appreciate your sense of humour and cynism and I thank you for this outstanding comment. I am not ashamed of my profile.
To cut a long story short, my company's sensible board of directors decided to replace the current Liferay portal by some legacy website while the upgrade to 6.1 was under way and 75% of it completed.
thumbnail
9年前 に Jack Bakker によって更新されました。

RE: Installation from Tomcat Bundle

Liferay Master 投稿: 978 参加年月日: 10/01/03 最新の投稿
Patrick Wolf:
Or at least update your profile so you look better here in the forums...emoticon


I appreciate your sense of humour and cynism and I thank you for this outstanding comment. I am not ashamed of my profile.
To cut a long story short, my company's sensible board of directors decided to replace the current Liferay portal by some legacy website while the upgrade to 6.1 was under way and 75% of it completed.


Yeah, was trying to inject some humour. Sorry your efforts weren't appreciated by the board.
thumbnail
9年前 に Jack Bakker によって更新されました。

RE: Installation from Tomcat Bundle

Liferay Master 投稿: 978 参加年月日: 10/01/03 最新の投稿
Olaf also gave good presentation at Boston Symposium LRNAS2014 with sys admin ideas on how to config to run as non-root ; not sure if there is a video of his presentations or text on what he said.