Ubiquiti

HOWTO: UNIFI INSTALLATION
The Unifi Controller from Ubiquiti Networks is a software management solution for their range of WiFi access point devices.

UNIFI CONTROLLER - LINUX SERVER FROM .DEB FILE:
This method will install the latest version of Ubiquiti's Unifi Controller.

DOWNLOAD THE DEB FILE

 * Proceed to the Ubiquiti download page
 * Click on "Unifi Switching & Routing" on the left hand side of the page
 * Locate the file called "unifi_sysvinit_all.deb" and download it

INSTALL ORACLE JAVA 8
Add repository and install:

sudo add-apt-repository ppa:webupd8team/java sudo apt-get update && sudo apt-get install oracle-java8-installer oracle-java8-set-default

Check the installed version:

java -version

INSTALL MONGODB
Edit the following file adding the lines shown in bold at the end of the file:

sudo nano /etc/apt/sources.list '''deb http://downloads-distro.mongodb.org/repo/ubuntu-upstart dist 10gen

Save and close the file, then add the keyserver and install:

sudo apt-key adv --keyserver keyserver.ubuntu.com --recv 7F0CEB10 sudo apt-get update sudo apt-get install mongodb

INSTALL .DEB FILE
sudo dpkg -i --force-depends unifi_sysvinit_all.deb

UNIFI CONTROLLER - LINUX SERVER FROM REPOSITORY:
The following is an installation on Ubuntu Server 14.04.

Repositories & Key Servers:
Edit the following file adding the lines shown in bold at the end of the file:

sudo nano /etc/apt/sources.list # Ubiquiti Unifi deb http://www.ubnt.com/downloads/unifi/distros/deb/ubuntu ubuntu ubiquiti # Mongodb '''deb http://downloads-distro.mongodb.org/repo/ubuntu-upstart dist 10gen

Add the following key servers, the first for Unifi itself the second for mongodb: sudo apt-key adv --keyserver keyserver.ubuntu.com --recv C0A52C50 sudo apt-key adv --keyserver keyserver.ubuntu.com --recv 7F0CEB10 sudo apt-get update

Required Ports:
Open ports on the server's firewall (in this example UFW):

For internal connection: sudo ufw allow from 192.168.0.0/24 to any port 8080 proto tcp sudo ufw allow from 192.168.0.0/24 to any port 8081 proto tcp sudo ufw allow from 192.168.0.0/24 to any port 8443 proto tcp sudo ufw allow from 192.168.0.0/24 to any port 8843 proto tcp sudo ufw allow from 192.168.0.0/24 to any port 8880 proto tcp sudo ufw allow from 192.168.0.0/24 to any port 27117 proto tcp sudo ufw allow from 192.168.0.0/24 to any port 3478 proto udp

Details of the ports required by Unifi can be found here.

Port 3478 UDP relates to STUN server usage so if you are not using VOIP hardware this port is not needed.

If your server already uses any of the ports listed above how to change those used by Unifi can be found here.

The file to alter to use different ports can be found in the following location:

/usr/lib/unifi/data/system.properties

Installation:
Install Unifi (all dependencies such as mongodb will be installed as well): sudo apt-get install unifi stable, or sudo apt-get install unifi-rapid better than standard not as bleeding edged as beta sudo apt-get install unifi-beta

If your server does not already have a flavour of Java installed, then Open JavaDK will be installed. However regardless of which version ends up being installed you will need to undertake the next step.

Defining The Java Version:
Edit the following file, locate the line shown and alter it to include the path to your Java (in this example v7) installation: sudo nano /etc/init.d/unifi JAVA_HOME= JAVA_HOME=/usr/lib/jvm/java-7-openjdk-amd64

NOTE: If you change versions of Java you will need to edit the above file again to reflect the changes to your system.

Accessing The Web Interface:
https://your.server.ip:8443/manage

All being well you should see similar to the picture below:



UNIFI CONTROLLER - RASPBERRYPI:
Instructions here.

Download here.

START, STOP OR RESTART
sudo service unifi start|stop|restart

VIEW LOG FILE
cat /var/log/unifi/server.log

KEYSTORE MISSING
If the the following is listed in the error log file:

/usr/lib/unifi/data/keystore (No such file or directory)

FIX

sudo service unifi stop sudo keytool -genkey -keyalg RSA -alias selfsigned -keystore /usr/lib/unifi/data/keystore -storepass aircontrolenterprise -validity 365 -keysize 2048 -destalias unifi

Answer the following questions by pressing enter up until the line starting "Is CN=" when you will need to answer "Y" then press enter:

What is your first and last name? [Unknown]: What is the name of your organizational unit? [Unknown]: What is the name of your organization? [Unknown]: What is the name of your City or Locality? [Unknown]: What is the name of your State or Province? [Unknown]: What is the two-letter country code for this unit? [Unknown]: Is CN=Unknown, OU=Unknown, O=Unknown, L=Unknown, ST=Unknown, C=Unknown correct? [no]:

Finally start Unifi:

sudo service unifi start

Thanks to Calvin Bui.

LINKS
https://community.ubnt.com/t5/UniFi-Updates-Blog/UniFi-3-2-7-is-released/ba-p/1085473

https://community.ubnt.com/t5/UniFi-Wireless/Unifi-4-2-Controller-Install-Guide-Linux-Ubuntu-Server-14-10/td-p/1158280

https://community.ubnt.com/t5/UniFi-Wireless/UNIFI-controller-for-linux/m-p/962877

https://community.ubnt.com/t5/UniFi-Wireless/UniFi-controller-on-Debian-v7-1-x64-not-working/td-p/523245

http://wiki.ubnt.com/UniFi_FAQ#Operation_and_Deployment

http://sunstatetechnology.com/docs/UniFiControllerInstallation.pdf

https://calvin.me/install-unifi-controller-ubuntu/

Error related:

https://community.ubnt.com/t5/UniFi-Wireless/UniFi-Apache-500-Error/td-p/948953

https://community.ubnt.com/t5/UniFi-Wireless/UniFi-on-Ubuntu-help-needed/td-p/238635

http://community.ubnt.com/t5/UniFi-Wireless/HTTP-Status-400/td-p/621497

http://community.ubnt.com/t5/UniFi-Wireless/Apache-Tomcat-HTTP-Status-400/m-p/654089/highlight/true

http://forum.thecus.com/viewtopic.php?f=36&t=8004