フォーラム

ホーム » Liferay Portal » English » 3. Development

構造的に表示 平面上に表示 ツリー上に表示
スレッド [ 前へ | 次へ ]
toggle
Sy Do
Error with use CDN
2012/02/29 2:29
答え

Sy Do

ランク: New Member

投稿: 11

参加年月日: 2010/12/21

最近の投稿

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!
画像の固定

添付ファイル: cdn-error.jpg (21.3k)
Sy Do
RE: Error with use CDN
2012/03/01 22:47
答え

Sy Do

ランク: New Member

投稿: 11

参加年月日: 2010/12/21

最近の投稿

No one help me?
Amos Fong
RE: Error with use CDN
2012/03/02 0:36
答え

Amos Fong

LIFERAY STAFF

ランク: Liferay Legend

投稿: 1896

参加年月日: 2008/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?
Sy Do
RE: Error with use CDN
2012/03/02 1:23
答え

Sy Do

ランク: New Member

投稿: 11

参加年月日: 2010/12/21

最近の投稿

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
Sy Do
RE: Error with use CDN
2012/03/06 1:20
答え

Sy Do

ランク: New Member

投稿: 11

参加年月日: 2010/12/21

最近の投稿

emoticon
Olaf Kock
RE: Error with use CDN
2012/03/06 11:09
答え

Olaf Kock

LIFERAY STAFF

ランク: Liferay Legend

投稿: 3427

参加年月日: 2008/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
Sy Do
RE: Error with use CDN
2012/03/06 22:49
答え

Sy Do

ランク: New Member

投稿: 11

参加年月日: 2010/12/21

最近の投稿

Thank for your reply!

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

How can I fix?
Bhuwan Gautam
RE: Error with use CDN
2014/01/09 17:45
答え

Bhuwan Gautam

ランク: New Member

投稿: 22

参加年月日: 2013/01/16

最近の投稿

I have placed
1javascript.fast.load=false
in portal-ext.properties and it works for me
Olaf Kock
RE: Error with use CDN
2014/02/11 23:48
答え

Olaf Kock

LIFERAY STAFF

ランク: Liferay Legend

投稿: 3427

参加年月日: 2008/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.