Fóruns

Início » Liferay Portal » English » 3. Development

Visualização combinada Visão plana Exibição em árvore
Tópicos [ Anterior | Próximo ]
toggle
Sy Do
Error with use CDN
29 de Fevereiro de 2012 02:29
Resposta

Sy Do

Ranking: New Member

Mensagens: 11

Data de entrada: 21 de Dezembro de 2010

Mensagens recentes

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!
Anexo

Anexos: cdn-error.jpg (21,3k)
Sy Do
RE: Error with use CDN
1 de Março de 2012 22:47
Resposta

Sy Do

Ranking: New Member

Mensagens: 11

Data de entrada: 21 de Dezembro de 2010

Mensagens recentes

No one help me?
Amos Fong
RE: Error with use CDN
2 de Março de 2012 00:36
Resposta

Amos Fong

LIFERAY STAFF

Ranking: Liferay Legend

Mensagens: 1841

Data de entrada: 7 de Outubro de 2008

Mensagens recentes

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
2 de Março de 2012 01:23
Resposta

Sy Do

Ranking: New Member

Mensagens: 11

Data de entrada: 21 de Dezembro de 2010

Mensagens recentes

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
6 de Março de 2012 01:20
Resposta

Sy Do

Ranking: New Member

Mensagens: 11

Data de entrada: 21 de Dezembro de 2010

Mensagens recentes

emoticon
Olaf Kock
RE: Error with use CDN
6 de Março de 2012 11:09
Resposta

Olaf Kock

LIFERAY STAFF

Ranking: Liferay Legend

Mensagens: 1581

Data de entrada: 23 de Setembro de 2008

Mensagens recentes

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
6 de Março de 2012 22:49
Resposta

Sy Do

Ranking: New Member

Mensagens: 11

Data de entrada: 21 de Dezembro de 2010

Mensagens recentes

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
9 de Janeiro de 2014 17:45
Resposta

Bhuwan Gautam

Ranking: New Member

Mensagens: 15

Data de entrada: 16 de Janeiro de 2013

Mensagens recentes

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

Olaf Kock

LIFERAY STAFF

Ranking: Liferay Legend

Mensagens: 1581

Data de entrada: 23 de Setembro de 2008

Mensagens recentes

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.