Skip to content

ahawthorne/less-handler

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 

Repository files navigation

Apache 2 LESS handler

Overview

The purpose is to have Apache handle serving LESS documents. This allows LESS to be served directly by the server without the need to compile manually. LESS is compiled on the server using node.js and lessc. The compiled files are cached in the temporary directory and then passed through to the browser. Compiled code is returned as text/css.

Error Handling

When an error occurs while compiling the server will return a 500 status code and the STDERR output from the lessc command as text/plain.

Options

There are several query string flags that can be set to perform some specific tasks.

##Installation

Requirements

  • Apache 2.2.x
  • PHP 5.x
  • nodejs >= 6.x
  • less >= 1.x

###Fedora / CentOS / RHEL

Execute the following with root permissions i.e. sudo.

rpm --import http://nodejs.tchol.org/RPM-GPG-KEY-tchol
yum localinstall --nogpgcheck http://nodejs.tchol.org/repocfg/fedora/nodejs-stable-release.noarch.rpm
yum install nodejs npm
npm install -g less
ln -svf /usr/lib/node_modules/less/bin/lessc /usr/bin/lessc
ln -svf /usr/bin/nodejs /usr/bin/node

cp ./less.conf /etc/httpd/conf.d/less.conf
cp -r ./less-compiler /etc/httpd/conf.d/

Debian / Mint / Ubuntu

Execute the following with root permissions i.e. sudo.

apt-get install python-software-properties
add-apt-repository ppa:chris-lea/node.js
apt-get update
apt-get install nodejs npm
npm install -g less

cp less.conf /etc/apache2/conf.d/less.conf
cp -r ./less-compiler /etc/apache2/conf.d/

About

LESS CSS handler for Apache 2

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages