From FreeNATS Wiki
Jump to: navigation, search

You can test your FreeNATS version and see if an update is required at the top of the main or admin pages.

Upgrading from version 0.xx to 1.xx?
Please read this document first!

Upgrading FreeNATS Virtual Appliance

This information applies only to virtual appliance release 3a or later and only concerns updating the FreeNATS software. For further information on upgrading the operating system etc please see the advanced section of the documentation.

To upgrade the virtual appliance simply login as the "root" user (either on the VM console or remotely via SSH) and execute the command:


This will automatically download the current FreeNATS release and execute the vm-upgrade.sh script.

You will need to confirm you wish to proceed and upgrade. The directory location defaults will be correct (pointing to /opt/freenats and /srv/www) and can just be accepted by pressing return.

Once the file structure has been updated you will be prompted to upgrade the database schema. You can choose a fresh (f) install where all existing configuration and history is lost or an upgrade (u) where data is maintained. Although the upgrade process is experimental and generates a lot of (expected) SQL errors it does seem to work ok and you can always come back and re-run /root/freenats/upgrade and choose the fresh option if you encounter problems.

After the upgrade is complete the script will delete all temporary files and return you to the prompt. You should now be running the latest version (if you chose a fresh schema upgrade then the admin user will have its default password again).

Users behind proxies may have a problem as by default the script relies on direct internet access.

Proxy users can try typing the following into the shell before doing a /root/freenats/upgrade:

export http_proxy="http://proxy.goes.here:port"

As an alternative to the upgrade script you can manually download the latest version by typing the following into the virtual appliance shell:

wget http://www.purplepixie.org/freenats/download.php?DirectCurrent=1

Proxy users can use the following:

export http_proxy="http://proxy.goes.here:port"
wget --proxy=on --proxy-username=user --proxy-password=password \

Some users may not be able to get any internet access for the appliance. In this case you should yourself download the latest version and make it available somewhere on your network to the virtual appliance. From the shell of the appliance you can then either:

  • Type wget http://somehost/freenats.tar.gz to download via HTTP
  • Type smbclient -U username //somehost/share to connect to a Windows/SMB/CIFS share on the network, "cd" to the location and then "get freenats.tar.gz" the file
  • Use VMWare server and map a directory containing the update as a drive then mount it.

Once you have downloaded the file to the virtual appliance you will need to unzip it (gzip -d freenats.tar.gz) and untar it (tar -xvf freenats.tar). Change into the new directory and type ./vm-upgrade.sh

The upgrade process should now begin and you can follow the prompts as detailed above.

Upgrading FreeNATS Source Install

To update your system you can manually copy/replace the files (keeping what configuration you need) or use the scripts provided.

Download the latest copy of the FreeNATS software and extract it to a suitable location.

First run your appropriate script (as a user with the necessary permissions). For FreeNATS Virtual Appliance users this is vm-upgrade.sh and for all other users shell-install.sh.

Follow the instructions. You will need to confirm the update type and set/accept the directory locations. This process will then update all the necessary FreeNATS files for your installation.

Once this process is complete you should rename the web/firstrun-.php file to be web/firstrun.php (in your web published directory) and then browse there.

Follow the instructions to either replace your existing database with the shiny new setup (recommended) or try the experimental upgrade script.

If you choose the upgrade script then you will see a lot of errors you can probably ignore. You can always come back and do a fresh install later on.

Make sure you rename the firstrun.php script back to firstrun-.php to avoid anyone messing with it.