| 1 | == Install Ubiquiti Networks !UniFi Controller on CentOS 5 == |
| 2 | |
| 3 | The following installation was performed on a {{{EL5.i386}}} server. |
| 4 | |
| 5 | {{{ |
| 6 | # uname -nri |
| 7 | hamster 2.6.18-348.4.1.el5 i386 |
| 8 | # |
| 9 | }}} |
| 10 | |
| 11 | 1. Download, install MongoDB server package. **No need to start the server.** |
| 12 | |
| 13 | {{{ |
| 14 | # url=http://downloads-distro.mongodb.org/repo/redhat/os/i686/RPMS |
| 15 | # wget -q $url/mongo18-10gen-1.8.4-mongodb_1.i686.rpm |
| 16 | # wget -q $url/mongo18-10gen-server-1.8.4-mongodb_1.i686.rpm |
| 17 | # rpm -i mongo18-10gen* |
| 18 | # chkconfig mongod off |
| 19 | # |
| 20 | }}} |
| 21 | |
| 22 | 2. Install Java **1.6** JDK. |
| 23 | |
| 24 | {{{ |
| 25 | # yum install java-1.6.0-openjdk |
| 26 | [...] |
| 27 | Installed: |
| 28 | java-1.6.0-openjdk.i386 1:1.6.0.0-1.40.1.11.11.el5_9 |
| 29 | |
| 30 | Dependency Installed: |
| 31 | alsa-lib.i386 0:1.0.17-1.el5 |
| 32 | giflib.i386 0:4.1.3-7.3.3.el5 |
| 33 | jpackage-utils.noarch 0:1.7.3-1jpp.3.el5 |
| 34 | libXtst.i386 0:1.0.1-3.1 |
| 35 | tzdata-java.i386 0:2013b-1.el5 |
| 36 | |
| 37 | Complete! |
| 38 | # |
| 39 | # which java |
| 40 | /usr/bin/java |
| 41 | # java -version |
| 42 | java version "1.6.0_24" |
| 43 | OpenJDK Runtime Environment (IcedTea6 1.11.11) (rhel-1.40.1.11.11.el5_9-i386) |
| 44 | OpenJDK Client VM (build 20.0-b12, mixed mode) |
| 45 | # |
| 46 | }}} |
| 47 | |
| 48 | 3. Download !UniFi software from the Ubiquiti Networks web site @ http://www.ubnt.com/eula/?BACK=/downloads/unifi/2.3.9/UniFi.unix.zip |
| 49 | |
| 50 | 4. Create a shell user that will be used to run the daemon (instead of {{{root}}}). |
| 51 | |
| 52 | {{{ |
| 53 | # groupadd -r unifi |
| 54 | # useradd -r -g unifi -c UniFi -M -d /opt/UniFi -s /bin/bash unifi |
| 55 | # |
| 56 | }}} |
| 57 | |
| 58 | 5. Unpack the !UniFi software, assign an owner. |
| 59 | |
| 60 | {{{ |
| 61 | # unzip -q UniFi.unix-2.3.9.zip -d /opt |
| 62 | # chown -R unifi.unifi /opt/UniFi |
| 63 | # |
| 64 | }}} |
| 65 | |
| 66 | 6. Create a run-control script. |
| 67 | |
| 68 | {{{ |
| 69 | # vi /etc/rc.d/init.d/unifi |
| 70 | # chmod 755 /etc/rc.d/init.d/unifi |
| 71 | # |
| 72 | # pr -to3 /etc/rc.d/init.d/unifi |
| 73 | #!/bin/sh |
| 74 | # |
| 75 | # unifi This shell script takes care of starting and stopping |
| 76 | # Ubiquiti Networks UniFi Controller |
| 77 | # |
| 78 | # chkconfig: - 84 16 |
| 79 | # description: Ubiquiti Networks UniFi Controller for Linux |
| 80 | # |
| 81 | |
| 82 | PROG=`basename $0 .sh` |
| 83 | LOCKFILE=/var/lock/subsys/$PROG |
| 84 | |
| 85 | UNIFI_USER=unifi |
| 86 | UNIFI_HOME=/opt/UniFi |
| 87 | |
| 88 | start() { |
| 89 | echo $"Starting Ubiquiti Networks UniFi Controller: " |
| 90 | /bin/su - $UNIFI_USER -c "(cd $UNIFI_HOME ; java -jar lib/ace.jar start)" & |
| 91 | RETVAL=$? |
| 92 | [ $RETVAL -eq 0 ] && touch $LOCKFILE |
| 93 | return $RETVAL |
| 94 | } |
| 95 | |
| 96 | stop() { |
| 97 | echo $"Stopping Ubiquiti Networks UniFi Controller: " |
| 98 | /bin/su - $UNIFI_USER -c "(cd $UNIFI_HOME ; java -jar lib/ace.jar stop)" |
| 99 | RETVAL=$? |
| 100 | [ $RETVAL -eq 0 ] && rm -f $LOCKFILE |
| 101 | return $RETVAL |
| 102 | } |
| 103 | |
| 104 | # See how we were called. |
| 105 | case "$1" in |
| 106 | start) |
| 107 | start |
| 108 | ;; |
| 109 | stop) |
| 110 | stop |
| 111 | ;; |
| 112 | *) |
| 113 | echo $"Usage: $PROG {start|stop}" |
| 114 | exit 2 |
| 115 | esac |
| 116 | |
| 117 | exit $? |
| 118 | |
| 119 | ### End-Of-File |
| 120 | # |
| 121 | # chkconfig --add unifi |
| 122 | # chkconfig unifi on |
| 123 | # chkconfig --list unifi |
| 124 | unifi 0:off 1:off 2:on 3:on 4:on 5:on 6:off |
| 125 | # |
| 126 | }}} |
| 127 | |
| 128 | 7. Start the daemon. About half a minute later check the processes running. |
| 129 | |
| 130 | {{{ |
| 131 | # service unifi start |
| 132 | Starting Ubiquiti Networks UniFi Controller: |
| 133 | # |
| 134 | # sleep 30 |
| 135 | # ps -ef |grep unifi |grep -v grep |
| 136 | root 6614 6360 0 14:05 pts/2 00:00:00 su - unifi -c (cd /opt/UniFi ; java -jar lib/ace.jar start) |
| 137 | unifi 6615 6614 0 14:05 ? 00:00:00 -bash -c (cd /opt/UniFi ; java -jar lib/ace.jar start) |
| 138 | unifi 6635 6615 0 14:05 ? 00:00:00 -bash -c (cd /opt/UniFi ; java -jar lib/ace.jar start) |
| 139 | unifi 6636 6635 48 14:05 ? 00:00:29 java -jar lib/ace.jar start |
| 140 | unifi 6658 6636 4 14:05 ? 00:00:01 bin/mongod --dbpath /opt/UniFi/data/db --port 27117 --logappend --logpath logs/mongod.log --nohttpinterface --bind_ip 127.0.0.1 |
| 141 | # |
| 142 | }}} |
| 143 | |
| 144 | 8. Check the TCP ports in use. |
| 145 | |
| 146 | {{{ |
| 147 | # netstat -tanp | egrep 'PID|java' |
| 148 | Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name |
| 149 | tcp 0 0 0.0.0.0:8843 0.0.0.0:* LISTEN 6636/java |
| 150 | tcp 0 0 0.0.0.0:8880 0.0.0.0:* LISTEN 6636/java |
| 151 | tcp 0 0 0.0.0.0:8080 0.0.0.0:* LISTEN 6636/java |
| 152 | tcp 0 0 127.0.0.1:8081 0.0.0.0:* LISTEN 6636/java |
| 153 | tcp 0 0 0.0.0.0:8443 0.0.0.0:* LISTEN 6636/java |
| 154 | tcp 0 0 127.0.0.1:54890 127.0.0.1:27117 ESTABLISHED 6636/java |
| 155 | tcp 0 0 127.0.0.1:54891 127.0.0.1:27117 ESTABLISHED 6636/java |
| 156 | tcp 0 0 127.0.0.1:54888 127.0.0.1:27117 ESTABLISHED 6636/java |
| 157 | tcp 0 0 127.0.0.1:54889 127.0.0.1:27117 ESTABLISHED 6636/java |
| 158 | # |
| 159 | # netstat -tanp | egrep 'PID|mongo' |
| 160 | Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name |
| 161 | tcp 0 0 127.0.0.1:27117 0.0.0.0:* LISTEN 6658/bin/mongod |
| 162 | tcp 0 0 127.0.0.1:27117 127.0.0.1:54889 ESTABLISHED 6658/bin/mongod |
| 163 | tcp 0 0 127.0.0.1:27117 127.0.0.1:54888 ESTABLISHED 6658/bin/mongod |
| 164 | tcp 0 0 127.0.0.1:27117 127.0.0.1:54891 ESTABLISHED 6658/bin/mongod |
| 165 | tcp 0 0 127.0.0.1:27117 127.0.0.1:54890 ESTABLISHED 6658/bin/mongod |
| 166 | # |
| 167 | }}} |
| 168 | |
| 169 | 9. Connect to the !UniFi controller in a web browser. Perform initial configuration, then adopt your !UniFi AP(s). |
| 170 | |
| 171 | {{{ |
| 172 | #!html |
| 173 | <div align="center"><a href="/img/ubnt/UniFi-hamster-20130512-1.png"><img src="/img/ubnt/UniFi-hamster-20130512-1.png" width="887" height="610"></a></div> |
| 174 | }}} |
| 175 | |
| 176 | |
| 177 | === See Also === |
| 178 | |
| 179 | http://community.ubnt.com/t5/UniFi/UniFi-Release-2-3-9/td-p/218731 \\ !UniFi - Release 2.3.9 |
| 180 | |
| 181 | http://www.ubnt.com/downloads/guides/UniFi/UniFi_AP_AP-LR_User_Guide.pdf \\ !UniFi AP / AP-LR User Guide |
| 182 | |
| 183 | http://www.ubnt.com/unifi \\ !UniFi | Ubiquiti Networks, Inc. |
| 184 | |
| 185 | |
| 186 | |