Forums de discussion

static files with mod_jk

Morad Ahmad, modifié il y a 8 années.

static files with mod_jk

Junior Member Publications: 71 Date d'inscription: 16/06/10 Publications récentes
Hi all,

I configured apache with mod_jk to load static files with apache not liferay. However I become errors that files ".../compass" and ".../mixins" could not be found. I guess this has to do with dynamic css files for liferay. But how can I generate this files or allow apache to be able to load this resources?

Thank you,
Morad.
thumbnail
Patrick Wolf, modifié il y a 8 années.

RE: static files with mod_jk

Regular Member Publications: 127 Date d'inscription: 15/09/10 Publications récentes
Can you please give more details on your configuration?
Morad Ahmad, modifié il y a 8 années.

RE: static files with mod_jk

Junior Member Publications: 71 Date d'inscription: 16/06/10 Publications récentes
Hi


I use the same configuration as described in many documentation. It works also well and static files (e.g. images, css also) are served threw apache http.
But I got error messages like:

14:24:02,863 WARN [ajp-bio-8099-exec-6][code_jsp:?] {code="404", msg="/html/portlet/announcements/css/compass", uri=/html/portlet/announcements/css/compass}

and has Problems to display the website correctly.



Here my configuration:


<IfModule jk_module>

JkWorkersFile /etc/libapache2-mod-jk/workers.properties

JkLogFile /var/log/apache2/mod_jk.log

# Our JK log level (trace,debug,info,warn,error)
JkLogLevel debug

JkShmFile /var/log/apache2/jk-runtime-status

JkWatchdogInterval 60
JkMount /* ajp13_worker

JkUnmount /*.jpg ajp13_worker
JkUnmount /*.jpeg ajp13_worker
JkUnmount /*.gif ajp13_worker
JkUnmount /*.png ajp13_worker
JkUnmount /*.ico ajp13_worker
JkUnmount /*.css ajp13_worker
JkUnmount /*.js ajp13_worker

</IfModule>


workers.properties:

workers.tomcat_home=/home/portango/portango/production/prod-install/liferay-portal-6.2-ce-ga4/tomcat-7.0.42
workers.java_home=/usr/lib/jvm/default-java
ps=/
worker.list=ajp13_worker
worker.ajp13_worker.port=8099
worker.ajp13_worker.host=localhost
worker.ajp13_worker.type=ajp13
worker.ajp13_worker.lbfactor=1
worker.loadbalancer.type=lb
worker.loadbalancer.balance_workers=ajp13_worker


VirtualHost (potango) :

<VirtualHost *:80>
ServerAdmin admin@portango.de
ServerName portango
ServerAlias www.portango.de

JkMountCopy On
</VirtualHost>
Morad Ahmad, modifié il y a 8 années.

RE: static files with mod_jk

Junior Member Publications: 71 Date d'inscription: 16/06/10 Publications récentes
for example I got these messages recently:

14:31:03,598 WARN [ajp-bio-8099-exec-9][code_jsp:?] {code="404", msg="/html/portlet/login/css/compass", uri=/html/portlet/login/css/compass}
14:31:05,248 WARN [ajp-bio-8099-exec-9][code_jsp:?] {code="404", msg="/html/css/portal/compass", uri=/html/css/portal/compass}
14:31:05,253 WARN [ajp-bio-8099-exec-15][code_jsp:?] {code="404", msg="/html/css/portal/mixins", uri=/html/css/portal/mixins}
14:31:05,262 WARN [ajp-bio-8099-exec-5][code_jsp:?] {code="404", msg="/html/css/taglib/mixins", uri=/html/css/taglib/mixins}


Should I compile the css files manually? Or (can) do I have to install campass on apache http?? Fact is that request to these urls ".../compass/..." and ".../mixins/..." cause an error...

Thanks,
Morad.
Morad Ahmad, modifié il y a 8 années.

RE: static files with mod_jk

Junior Member Publications: 71 Date d'inscription: 16/06/10 Publications récentes
I commented out the "unmont" for *.css files in my "jk.conf". It solves the problem, the page renders correctly, because css files are loaded by liferay:

# JkUnmount /*.css ajp13_worker

But I want to serve css files with apache for performance...

As I understand the *.css files of deployed themes/portlets are in "compass/sass" format. Liferay generates in ".sass-cache" static css files and use these files.
If I want to css files by apache http not liferay, then I have to provide "compiled" static css files.

- What is the best way to generate static css files instead of sass to use them apache?
- Should I compile all plugins manually with compass
- Or is there some kind of plugin/module for apache to hanlde sass files ?

Thank you for help,
Morad.
thumbnail
David H Nebinger, modifié il y a 8 années.

RE: static files with mod_jk

Liferay Legend Publications: 14919 Date d'inscription: 02/09/06 Publications récentes
Liferay css are not static, they get compiled by compass/sass.

You might consider using instead a caching appliance such as Varnish. Varnish caches results and can return them, not static paths like mod_jk.
Morad Ahmad, modifié il y a 8 années.

RE: static files with mod_jk

Junior Member Publications: 71 Date d'inscription: 16/06/10 Publications récentes
Thanks David!
My Question now: Is it really an important performance issue to serve css from apache/mod_jk? Or is the effect so small so that effort doesn't make sense?
thumbnail
David H Nebinger, modifié il y a 8 années.

RE: static files with mod_jk

Liferay Legend Publications: 14919 Date d'inscription: 02/09/06 Publications récentes
Once it's compiled, the same css will be returned for every incoming request. Liferay has a number of filters, etc that will be invoked for requests that may or may not impact service of the css.

Personally I think it's always a good idea to offload whatever work you can from the application server. This means solr for indexing and search to take off backend work and using a caching appliance to offload work from the front end.

The application server is the heart of your system, so the more you can reasonably offload the better off you're going to be.

Besides, you don't want to consume app server resources returning the same file to multiple callers... Let the caching appliance take care of it so the app server can handle serving real requests.