掲示板

RE: Error with use CDN

thumbnail
12年前 に Sy Do によって更新されました。

Error with use CDN

New Member 投稿: 11 参加年月日: 10/12/22 最新の投稿
I'm using liferay portal 6.0.6 bundled tomcat 6.0.29 on ubuntu.
I use Apache server to host static content.
I configured CDN in portal-ext.properties file:

cdn.host.http=http://127.0.0.1/cdnliferay

and then I copied mytheme and html folder (from webapps/ROOT) to /var/www/cdnliferay folder of Apache server.
then I restarted tomcat server of liferay, after that There was a bug on that ( see more on attached file below)

Please go through that case and give me feedback as soon as posible !

Thank you so much!

添付ファイル:

thumbnail
12年前 に Sy Do によって更新されました。

RE: Error with use CDN

New Member 投稿: 11 参加年月日: 10/12/22 最新の投稿
No one help me?
thumbnail
12年前 に Amos Fong によって更新されました。

RE: Error with use CDN

Liferay Legend 投稿: 2047 参加年月日: 08/10/07 最新の投稿
Hi Sy,

Essentially what the property does is for certain URLs (like images, css, etc.) Liferay will replace the host to use the CDN host. For example:
http://www.liferay.com/image/user_male_portrait?img_id=11144008&t=1330670928347

Will be changed to:
http://cdn.www.liferay.com/image/user_male_portrait?img_id=11144008&t=1330670928347

Is your CDN handling this correctly?
thumbnail
12年前 に Sy Do によって更新されました。

RE: Error with use CDN

New Member 投稿: 11 参加年月日: 10/12/22 最新の投稿
Yes Amos!

this is my link http://127.0.0.1/cdnliferay/image/user_male_portrait?img_id=25302&t=1330679293205

I guess the wrong path to the YUI library of Liferay but I do not know how to fix
thumbnail
12年前 に Sy - Do によって更新されました。

RE: Error with use CDN

New Member 投稿: 11 参加年月日: 10/12/22 最新の投稿
emoticon
thumbnail
12年前 に Olaf Kock によって更新されました。

RE: Error with use CDN

Liferay Legend 投稿: 6396 参加年月日: 08/09/23 最新の投稿
Use Firebug or LiveHttpHeaders (both firefox plugins) or something similar to monitor which requests your browser sends out and if they return error status codes or similar. Then identify if the problematic URL is constructed correctly, how it would be handled correctly and where the actual problem is. Might be JS or CSS related, but you'll see it when you see that you get 404 or other errors on some URLs
thumbnail
12年前 に Sy Do によって更新されました。

RE: Error with use CDN

New Member 投稿: 11 参加年月日: 10/12/22 最新の投稿
Thank for your reply!

after I test by using Firebug, i got some error messages as belows:
[indent]1. illegal XML character (barebone.jsp file)
2. Liferay.Portlet is undefined
3. Liferay.Util is undefined
4. AUI is not defined[/indent]

How can I fix?
thumbnail
10年前 に Bhuwan Gautam によって更新されました。

RE: Error with use CDN

New Member 投稿: 22 参加年月日: 13/01/16 最新の投稿
I have placed
javascript.fast.load=false
in portal-ext.properties and it works for me
thumbnail
10年前 に Olaf Kock によって更新されました。

RE: Error with use CDN

Liferay Legend 投稿: 6396 参加年月日: 08/09/23 最新の投稿
This might be long cleared for you, but others might run into this and I found a few more things in your described configuration:

You say that you're using Apache to serve static content - however, this is (or can be) something completely different than a CDN: A CDN works like a reverse- & caching proxy: If it doesn't have some resources itself, it will forward the request to the underlying server, retrieve the resource, cache for future reference and deliver to the client.

I'm assuming that you have not configured such an integration with Apache - rather you deliver some content, like images etc. - through Apache. This is correct as well, but you shouldn't configure Liferay's CDN integration for this. What happens is this:

Liferay minifies CSS and Javascript. While this is dynamically generated, the content is supposed to be static. A CDN would handle it as a static resource, fetch once then cache. A regular Apache reverse(-noncaching-)proxy does not deliver this minified version, as it's not present in the directory that you copied into your /var/www/cdnliferay directory. Thus you get weird CSS effects and problems with Javascript not being properly initialized.

The solution: Don't configure cdn.host.http, rather use Apache mod_proxy or (my recommendation) mod_jk and specifically serve real static files (like /my-theme/images/ etc.) through Apache, the rest through Liferay. Another solution: Configure a proper CDN. The first solution is easy, the second is somewhat harder.