Blog Post

Install and Use LESS on Dreamhost

I am working on a few websites and recently started using LESS CSS for creating my CSS. Anyways, I am using a Dreamhost shared server for not only my website, but other projects I am working on. Unfortunately with a shared server account, you don’t have access to sudo, so you can’t install applications. I got tired of editing my LESS files on the server, copying them locally or doing the git push and pull boogie, running a make file to build the css, and then pushing the css back to the server. I searched and searched for the answer and never found out. However, I did remember that I used to do a lot of Debian and Ubuntu packaging not all that long ago and figured I could just download all the files I need from the Ubuntu archive, extract them, and put them in their proper place. After doing all of this manually and testing it that everything worked just how I needed, I decided to write a script to do all the work. That way there I didn’t have to use this blog to provide step-by-step instructions.

Getting the script

If you grab the script from the above link, you will need to make it executable:

chmod +x dh_less_inst.sh

Running the script

Here comes the easy part:

./dh_less_inst.sh

What does the script do?

The script simply downloads the necessary packages from the Ubuntu archive, or a tarball if it isn’t in the archive. The following is a list of everything that gets downloaded and installed as well as where it gets placed: NOTE:$PREFIX defaults to ~/.local/usr

lesscss – git clone of the lesscss source. bin/lessc and lib/less moved to $PREFIX

I found this blog entry since I was also having the same issue, but have also found several discussions saying that running the node daemon is against TOS. This method would probably be frowned upon and get your site removed.

Subscribe to nixternal.com

Archives

Who is Richard A. Johnson?

My name is Richard A. Johnson. I am a professional developer, as
well as an open source enthusiast, advocate, and author. I spend
any free time I can get cycling.

Back in 1994 I was introduced to the world of open source
software by installing Linux on a PC I had purchased from the
Navy Exchange. At that time I had no idea what I was going up
against, but never once did I let myself get frustrated, as
Windows had already done that to me. Since then, I have
completely immersed myself into the open source world and have
been an active contributor.