summaryrefslogtreecommitdiff
path: root/_site_build
diff options
context:
space:
mode:
authordavidtsadler <davidtsadler@googlemail.com>2012-05-05 16:56:35 +0100
committerdavidtsadler <davidtsadler@googlemail.com>2012-05-05 16:56:35 +0100
commitd1fcacc019e96d50a58bada3bf610968616d14c2 (patch)
tree3f817375381ef945b5413dd0690782115d54ed22 /_site_build
parent5b2629f3350cd448ab02f87c89dd972bc607e52a (diff)
Start on second post.
Diffstat (limited to '_site_build')
-rw-r--r--_site_build/_posts/2012-05-04-installing-node-js-on-ubuntu.markdown131
1 files changed, 131 insertions, 0 deletions
diff --git a/_site_build/_posts/2012-05-04-installing-node-js-on-ubuntu.markdown b/_site_build/_posts/2012-05-04-installing-node-js-on-ubuntu.markdown
new file mode 100644
index 0000000..c8b0f02
--- /dev/null
+++ b/_site_build/_posts/2012-05-04-installing-node-js-on-ubuntu.markdown
@@ -0,0 +1,131 @@
+---
+layout: post
+title: Installing Node.js on Ubuntu
+author: David T. Sadler
+description: This guide will show you how to install Node.js on Ubuntu.
+categories: ["Node.js","Ubuntu"]
+robots: follow, noodp, noydir, noarchive
+comments: true
+google_plus: true
+twitter_share: true
+facebook_like: true
+published: true
+licensed: true
+---
+Node.js is ...... This guide will show you how to install Node.js on Ubuntu from either the source code or Git repository. I'm going to assume that you are using Ubuntu 12.04 (Precise Pangolin) and that you wish to install version 0.6.17 of Node.js. You're results may vary if you are using different versions.
+
+## Getting started.
+
+There are a few things that we require before we can install Node.js. Firstly we need a compiler which can be got by installing the `build-essential` package. This contains tools (such as the gcc complier, make tool, etc) for compiling/building software from source.
+
+{% highlight bash %}
+sudo apt-get update
+sudo apt-get install build-essential -y
+{% endhighlight %}
+
+You will need `Git` if you are going to install from the repository.
+
+{% highlight bash %}
+sudo apt-get install git -y
+{% endhighlight %}
+
+Node.js itself requires very little in the way of dependencies.
+
+* python - Version 2.6 or 2.7.
+* libssl-dev - You will need this if you plan to use SSL/TLS encryption.
+
+{% highlight bash %}
+sudo apt-get install python libssl-dev -y
+{% endhighlight %}
+
+Wtih the dependencies installed we can now move onto installing Node.js itself. Since there is a very good chance that Node.js has been updated since this was written, you should check the <a href="http://nodejs.org/#download" rel="external nofollow" target="_blank" title="Go to the Node.js website">website</a> for the latest version number and subsitue it for the one used in the rest of this post. You have two options when it comes to the installation. You can download the source code or clone the Git repository. The process is similiar for both methods and so you should choose which ever one you are confortable with. I personally use Git as I find it easier to update Node.js to the latest version.
+
+* [Installing from source.](#from-source)
+* [Installing with Git.](#via-git)
+
+<h2 id="from-source">Installing from source.</h2>
+
+You will need to download the tar archive of the source code and unpack it into a suitable directory. We will create this directory in `/usr/local/src`. Note that you will have to use the `sudo` command in order to write to this directory.
+
+{% highlight bash %}
+cd /usr/local/src
+sudo mkdir node
+cd node
+sudo wget http://nodejs.org/dist/v0.6.17/node-v0.6.17.tar.gz
+sudo tar -xzvf node-v0.6.17.tar.gz
+{% endhighlight %}
+
+We now need to enter the extracted directory and configure the code. The `configure` script checks your system to see if the required dependencies are present. Since we have installed these earlier it should report that everything is ok. Note that by default the `configure` script will ensure that Node.js is installed globally for the whole system. If you wish to install it for use by a single user you can follow the extra instructions [here](#single-user).
+
+{% highlight bash %}
+cd node-v0.6.17
+sudo ./configure
+{% endhighlight %}
+
+The `make` command can now be used to compile and install Node.js.
+
+{% highlight bash %}
+sudo make
+sudo make install
+{% endhighlight %}
+
+This will result in the commands `node` and `npm` been installed into the `/usr/local/bin` directory. Now that Node.js has been installed you may wish to try the example [code](#code).
+
+### Upgrading from source.
+
+To upgrade Node.js from source simply download the latest tar archive and repeat the above installation process. The updated version will overwrite the previous version.
+
+<h2 id="via-git">Installing with Git.</h2>
+
+The first step is to clone the repository into a suitable directory. For this guide we will use `/usr/local/src`. Note that you will have to use the `sudo` command in order to write to this directory.
+
+{% highlight bash %}
+cd /usr/local/src
+sudo git clone git://github.com/joyent/node.git
+{% endhighlight %}
+
+We can now enter the cloned repository and checkout the v0.6.17 branch.
+
+{% highlight bash %}
+cd node
+sudo git checkout v0.6.17
+{% endhighlight %}
+
+We now need to configure the source code by using the provided `configure` script. This checks your system to see if the required dependencies are present. Since we have installed these earlier it should report that everything is ok. Note that by default the `configure` script will ensure that Node.js is installed globally for the whole system. If you wish to install it for use by a single user you can follow the extra instructions [here](#single-user).
+
+{% highlight bash %}
+sudo ./configure
+{% endhighlight %}
+
+The `make` command can now be used to compile and install Node.js.
+
+{% highlight bash %}
+sudo make
+sudo make install
+{% endhighlight %}
+
+This will result in the commands `node` and `npm` been installed into the `/usr/local/bin` directory. Now that Node.js has been installed you may wish to try the example [code](#code).
+
+### Upgrading via Git.
+
+To upgrade Node.js you need to go back into the cloned repository and pull down the latest source code.
+
+{% highlight bash %}
+cd /usr/local/src/node
+sudo git checkout master
+sudo git pull origin master
+{% endhighlight %}
+
+You can then checkout the version branch that you wish to upgrade to. To check which versions are available use the `git tag` command. The upgrade is then performed by using the normall install commands.
+
+{% highlight bash %}
+sudo git checkout vx.x.x
+sudo ./configure
+sudo make
+sudo make install
+{% endhighlight %}
+
+## Installing into a alternative directory.
+
+
+## Checking the install