Fórum

RE: Error with use CDN

thumbnail
Sy Do, modificado 12 Anos atrás.

Error with use CDN

New Member Postagens: 11 Data de Entrada: 22/12/10 Postagens 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!
thumbnail
Sy Do, modificado 12 Anos atrás.

RE: Error with use CDN

New Member Postagens: 11 Data de Entrada: 22/12/10 Postagens Recentes
No one help me?
thumbnail
Amos Fong, modificado 12 Anos atrás.

RE: Error with use CDN

Liferay Legend Postagens: 2047 Data de Entrada: 07/10/08 Postagens 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?
thumbnail
Sy Do, modificado 12 Anos atrás.

RE: Error with use CDN

New Member Postagens: 11 Data de Entrada: 22/12/10 Postagens 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
thumbnail
Sy - Do, modificado 12 Anos atrás.

RE: Error with use CDN

New Member Postagens: 11 Data de Entrada: 22/12/10 Postagens Recentes
emoticon
thumbnail
Olaf Kock, modificado 12 Anos atrás.

RE: Error with use CDN

Liferay Legend Postagens: 6396 Data de Entrada: 23/09/08 Postagens 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
thumbnail
Sy Do, modificado 12 Anos atrás.

RE: Error with use CDN

New Member Postagens: 11 Data de Entrada: 22/12/10 Postagens Recentes
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
Bhuwan Gautam, modificado 10 Anos atrás.

RE: Error with use CDN

New Member Postagens: 22 Data de Entrada: 16/01/13 Postagens Recentes
I have placed
javascript.fast.load=false
in portal-ext.properties and it works for me
thumbnail
Olaf Kock, modificado 10 Anos atrás.

RE: Error with use CDN

Liferay Legend Postagens: 6396 Data de Entrada: 23/09/08 Postagens 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.