Aug 19 / 12:40pm

Installing wget on OS X

by fruux

We're excited that our website http://fruux.com is much more popular than it used to be before the relaunch. However these additional visitors also result in a lot more traffic and load on the respective frontend servers. We already had that in mind, when we started working on the new website and built it in a way that allows us to use a content management system but still publish the site as a pure static website.

We're using wget in this setup to create the actual "compiled" site that gets published on our production systems. Unfortunately wget is not included in OS X by default, but luckily it's easy to download and built it from source.

If you also need wget on your machine, just copy the following few lines and paste them in Terminal.app.
They'll always download and install the latest version of wget on your machine.

(Update: Alternatively use Homebrew - a straightforward replacement for MacPorts: http://mxcl.github.com/homebrew/. Thanks, Evert.
If you want to remove the manually installed version of wget before switching to Homebrew, just repeat the steps below and replace the line "sudo make install -C ~/Downloads/wget-latest/" with "sudo make uninstall -C ~/Downloads/wget-latest/")

# download latest wget version
curl -o ~/Downloads/wget-latest.tar.gz http://ftp.gnu.org/gnu/wget/wget-latest.tar.gz

# create temp directory for extraction
mkdir ~/Downloads/wget-latest

# extract into temp directory
tar xzf ~/Downloads/wget-latest.tar.gz --strip-components=1 -C ~/Downloads/wget-latest

# build and install wget
cd ~/Downloads/wget-latest/ && ./configure
make -C ~/Downloads/wget-latest/
sudo make install -C ~/Downloads/wget-latest/

# cleanup
rm ~/Downloads/wget-latest.tar.gz
rm -rf ~/Downloads/wget-latest

If you are interested in details about our static website setup, let us know and we'll follow-up with another blog post with more details if our workload allows it.

 

 

Filed under  //  code snippets   development   static website   wget