View previous topic :: View next topic |
Author |
Message |
PM17E5 Apprentice
Joined: 10 Feb 2009 Posts: 241
|
Posted: Wed May 09, 2012 11:01 pm Post subject: mod-less for lesscss and apache |
|
|
I was just curious if anyone here has tried using lesscss for their websites? I found this link of an apache module someone wrote, and was wondering what are the chances of ever seeing it end up as a use flag for apache?
http://www.behance.net/gallery/mod-less-LESS-css-apache-module/3278017
For those that haven't heard of lesscss, you can visit the website at:
http://lesscss.org/ |
|
Back to top |
|
|
PM17E5 Apprentice
Joined: 10 Feb 2009 Posts: 241
|
Posted: Sun May 13, 2012 2:22 pm Post subject: |
|
|
I found a better reference on how to install it.
https://github.com/waleedq/libapache2-mod-less_beta1
I downloaded the binary modules from git and put them in /usr/lib/apache2/modules/. However there was no /etc/apache/mods-available so I simply put the contents of less.load and less.conf into /etc/apache/httpd.conf. If I'm doing anything wrong I would appreciate someone correcting me.
Code: | LoadModule less_module /usr/lib/apache2/modules/mod_less.so
<FilesMatch "\.css$">
SetHandler less
</FilesMatch> |
Edit:
still doesn't work |
|
Back to top |
|
|
PM17E5 Apprentice
Joined: 10 Feb 2009 Posts: 241
|
Posted: Wed May 16, 2012 2:37 pm Post subject: |
|
|
Can anyone help me? I'd really like to try this out without having to rely on client side compiling by the javascript. |
|
Back to top |
|
|
waleedq n00b
Joined: 21 May 2012 Posts: 2
|
Posted: Mon May 21, 2012 7:51 pm Post subject: |
|
|
hello man, this module is written by me , sorry for the confusion about how to install it, can you please give more information on which apache version you are using ? and what linux dist you are on ??
thank you, |
|
Back to top |
|
|
PM17E5 Apprentice
Joined: 10 Feb 2009 Posts: 241
|
Posted: Mon May 28, 2012 1:40 am Post subject: |
|
|
Oh cool, I bet you probably noticed all of this through your website statistics?
I'm using apache-2.2.22-r1 with the following use flags:
Code: | www-servers/apache-2.2.22-r1 USE="ssl -debug -doc -ldap (-selinux) -static -suexec -threads" APACHE2_MODULES="actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias -asis -auth_digest -authn_dbd -cern_meta -charset_lite -dbd -dumpio -ident -imagemap -log_forensic -proxy -proxy_ajp -proxy_balancer -proxy_connect -proxy_ftp -proxy_http -proxy_scgi -reqtimeout -substitute -version" APACHE2_MPMS="-event -itk -peruser -prefork -worker" 0 kB |
Also, I'm using Gentoo linux, as you can guess by the forums . |
|
Back to top |
|
|
RoaringSky n00b
Joined: 28 May 2012 Posts: 1
|
Posted: Mon May 28, 2012 9:05 pm Post subject: |
|
|
waleedq wrote: | hello man, this module is written by me , sorry for the confusion about how to install it, can you please give more information on which apache version you are using ? and what linux dist you are on ??
thank you, |
Hello Waleed,
I am NOT using Gentoo ~ I have a Solaris system to work on. When I setup your binary Apache complains about a wrong ELF type: I need to recompile your src I think to run on this 64 bit system. Can you tell me where the src should be, and what -L paths to feed it? I have access to the Solaris cc compiler or gcc. I have root access so all system libs are available to me. Thanks a bunch for writing this, BTW.
Cheers,
Erik |
|
Back to top |
|
|
waleedq n00b
Joined: 21 May 2012 Posts: 2
|
Posted: Tue May 29, 2012 9:42 am Post subject: |
|
|
@RoaringSky recompiling the module form source would fix the wrong ELF issue, you can find the source code from here https://github.com/waleedq/libapache2-mod-less_beta1
@PM17E5 can you please try to compile it from source cuz the binaries that are online are compiled using ubuntu and a different apache version |
|
Back to top |
|
|
ghevan n00b
Joined: 14 Feb 2007 Posts: 2
|
Posted: Fri Nov 02, 2012 4:03 am Post subject: |
|
|
Thanks for the links I was able to know the module existence and configure it to work
What I did was to compile the module as instructed in the webpage. as root in the src folder I ran
Code: | apxs2 -c -i mod_less.c |
I was in doubt as to where to copy the configuration files but I supposed the correct place was /etc/apache2/modules.d/ so I made a copy of the files following the name scheme.
Code: |
cp libapache2-mod-less_beta1/bin/less.load /etc/apache2/modules.d/99_mod_lessLoad.conf
cp libapache2-mod-less_beta1/bin/less.conf /etc/apache2/modules.d/99_mod_less.conf
|
Then It was just a matter of reloading Apache to get it working. Just as a reminder, the module does write a file to the folder so it needs permissions. I got into this trouble because I have my vhost root inside a subfolder of my home. but setting the correct permissions for the folder fixes everything. One thing I didn't like is that it parses every single css file and writes a .less copy of it. To fix that behavior I made a little change in the configuration to keep it only to compile less files.
I changed less.config to
Code: |
<FilesMatch "\.less$">
SetHandler less
</FilesMatch>
|
And edited the .htaccess file to add less as a mime type text/css
Code: | AddType text/css .less |
So now I can use
Code: | <link rel="stylesheet" href="../css/main01.less"> |
To compile less files and leave css files untouched (The only downside is that you end up with files with names like "style.less.less"). It is for a development server, I'm pleased with the results.
Hope someone finds it useful |
|
Back to top |
|
|
|