| 1 | == Install Ubiquiti Networks !UniFi Controller on CentOS 6 == |
| 2 | |
| 3 | The following installation was performed on a {{{EL6.x86_64}}} server. |
| 4 | |
| 5 | {{{ |
| 6 | # uname -nri |
| 7 | hamster 2.6.32-696.16.1.el6.x86_64 x86_64 |
| 8 | # |
| 9 | }}} |
| 10 | |
| 11 | 1. Download, install MongoDB **2.4.14** server package. **No need to start the server.** |
| 12 | |
| 13 | {{{ |
| 14 | # url=http://downloads-distro.mongodb.org/repo/redhat/os/x86_64/RPMS |
| 15 | # wget $url/mongo-10gen-2.4.14-mongodb_1.x86_64.rpm |
| 16 | # wget $url/mongo-10gen-server-2.4.14-mongodb_1.x86_64.rpm |
| 17 | # rpm -i mongo-10gen*-2.4.14-mongodb_1.x86_64.rpm |
| 18 | # chkconfig mongod off |
| 19 | # |
| 20 | }}} |
| 21 | |
| 22 | 2. Install Java **1.8** JDK. |
| 23 | |
| 24 | {{{ |
| 25 | # yum install java-1.8.0-openjdk |
| 26 | [...] |
| 27 | Complete! |
| 28 | # |
| 29 | # rpm -qa --last |head -7 |
| 30 | java-1.8.0-openjdk-1.8.0.151-1.b12.el6_9.x86_64 Tue 26 Dec 2017 07:25:03 PM PST |
| 31 | xorg-x11-fonts-Type1-7.2-11.el6.noarch Tue 26 Dec 2017 07:25:01 PM PST |
| 32 | ttmkfdir-3.0.9-32.1.el6.x86_64 Tue 26 Dec 2017 07:25:01 PM PST |
| 33 | java-1.8.0-openjdk-headless-1.8.0.151-1.b12.el6_9.x86_64 Tue 26 Dec 2017 07:25:00 PM PST |
| 34 | xorg-x11-font-utils-7.2-11.el6.x86_64 Tue 26 Dec 2017 07:24:53 PM PST |
| 35 | libXfont-1.5.1-2.el6.x86_64 Tue 26 Dec 2017 07:24:53 PM PST |
| 36 | libfontenc-1.1.2-3.el6.x86_64 Tue 26 Dec 2017 07:24:53 PM PST |
| 37 | # |
| 38 | # which java |
| 39 | /usr/bin/java |
| 40 | # java -version |
| 41 | openjdk version "1.8.0_151" |
| 42 | OpenJDK Runtime Environment (build 1.8.0_151-b12) |
| 43 | OpenJDK 64-Bit Server VM (build 25.151-b12, mixed mode) |
| 44 | # |
| 45 | }}} |
| 46 | |
| 47 | 3. Download !UniFi software from the Ubiquiti Networks web site @ http://dl.ubnt.com/unifi/5.6.26/UniFi.unix.zip |
| 48 | |
| 49 | 4. Create a shell user that will be used to run the daemon (instead of {{{root}}}). |
| 50 | |
| 51 | {{{ |
| 52 | # groupadd -r unifi |
| 53 | # useradd -r -g unifi -c UniFi -M -d /opt/UniFi -s /bin/bash unifi |
| 54 | # |
| 55 | }}} |
| 56 | |
| 57 | 5. Unpack the !UniFi software, assign an owner. |
| 58 | |
| 59 | {{{ |
| 60 | # unzip -q UniFi.unix.zip -d /opt |
| 61 | # chown -R unifi.unifi /opt/UniFi |
| 62 | # |
| 63 | # mv /opt/UniFi /opt/UniFi-5.6.26 |
| 64 | # ln -s UniFi-5.6.26 /opt/UniFi |
| 65 | # |
| 66 | }}} |
| 67 | |
| 68 | 6. Create a run-control script. |
| 69 | |
| 70 | {{{ |
| 71 | # vi /etc/rc.d/init.d/unifi |
| 72 | # chmod 755 /etc/rc.d/init.d/unifi |
| 73 | # |
| 74 | # pr -to3 /etc/rc.d/init.d/unifi |
| 75 | #!/bin/sh |
| 76 | # |
| 77 | # unifi This shell script takes care of starting and stopping |
| 78 | # Ubiquiti Networks UniFi Controller |
| 79 | # |
| 80 | # chkconfig: - 84 16 |
| 81 | # description: Ubiquiti Networks UniFi Controller for Linux |
| 82 | # |
| 83 | |
| 84 | PROG=`basename $0 .sh` |
| 85 | LOCKFILE=/var/lock/subsys/$PROG |
| 86 | |
| 87 | UNIFI_USER=unifi |
| 88 | UNIFI_HOME=/opt/UniFi |
| 89 | |
| 90 | start() { |
| 91 | echo $"Starting Ubiquiti Networks UniFi Controller: " |
| 92 | /bin/su - $UNIFI_USER -c "(cd $UNIFI_HOME ; java -Xmx1024M -jar lib/ace.jar start)" & |
| 93 | RETVAL=$? |
| 94 | [ $RETVAL -eq 0 ] && touch $LOCKFILE |
| 95 | return $RETVAL |
| 96 | } |
| 97 | |
| 98 | stop() { |
| 99 | echo $"Stopping Ubiquiti Networks UniFi Controller: " |
| 100 | /bin/su - $UNIFI_USER -c "(cd $UNIFI_HOME ; java -jar lib/ace.jar stop)" |
| 101 | RETVAL=$? |
| 102 | [ $RETVAL -eq 0 ] && rm -f $LOCKFILE |
| 103 | return $RETVAL |
| 104 | } |
| 105 | |
| 106 | # See how we were called. |
| 107 | case "$1" in |
| 108 | start) |
| 109 | start |
| 110 | ;; |
| 111 | stop) |
| 112 | stop |
| 113 | ;; |
| 114 | *) |
| 115 | echo $"Usage: $PROG {start|stop}" |
| 116 | exit 2 |
| 117 | esac |
| 118 | |
| 119 | exit $? |
| 120 | |
| 121 | ### End-Of-File |
| 122 | # |
| 123 | # chkconfig --add unifi |
| 124 | # chkconfig unifi on |
| 125 | # chkconfig --list unifi |
| 126 | unifi 0:off 1:off 2:on 3:on 4:on 5:on 6:off |
| 127 | # |
| 128 | }}} |
| 129 | |
| 130 | 7. Start the daemon. About half a minute later check the processes running. |
| 131 | |
| 132 | {{{ |
| 133 | # service unifi start |
| 134 | Starting Ubiquiti Networks UniFi Controller: |
| 135 | # |
| 136 | # sleep 30 |
| 137 | # ps -ef |grep unifi |grep -v grep |
| 138 | root 9165 1 0 20:26 pts/3 00:00:00 /bin/su - unifi -c (cd /opt/UniFi ; java -Xmx1024M -jar lib/ace.jar start) |
| 139 | unifi 9167 9165 0 20:26 ? 00:00:00 -bash -c (cd /opt/UniFi ; java -Xmx1024M -jar lib/ace.jar start) |
| 140 | unifi 9176 9167 0 20:26 ? 00:00:00 -bash -c (cd /opt/UniFi ; java -Xmx1024M -jar lib/ace.jar start) |
| 141 | unifi 9177 9176 2 20:26 ? 00:02:04 java -Xmx1024M -jar lib/ace.jar start |
| 142 | unifi 10013 9177 0 20:26 ? 00:00:42 bin/mongod --dbpath /opt/UniFi-5.6.26/data/db --port 27117 --unixSocketPrefix /opt/UniFi-5.6.26/run --logappend --logpath /opt/UniFi-5.6.26/logs/mongod.log --nohttpinterface --bind_ip 127.0.0.1 |
| 143 | # |
| 144 | }}} |
| 145 | |
| 146 | 8. Check the TCP ports in use. |
| 147 | |
| 148 | {{{ |
| 149 | # netstat -tanp | egrep 'PID|LISTEN.*java' |
| 150 | Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name |
| 151 | tcp 0 0 0.0.0.0:6789 0.0.0.0:* LISTEN 9177/java |
| 152 | tcp 0 0 0.0.0.0:8843 0.0.0.0:* LISTEN 9177/java |
| 153 | tcp 0 0 0.0.0.0:8880 0.0.0.0:* LISTEN 9177/java |
| 154 | tcp 0 0 0.0.0.0:8080 0.0.0.0:* LISTEN 9177/java |
| 155 | tcp 0 0 0.0.0.0:8443 0.0.0.0:* LISTEN 9177/java |
| 156 | # |
| 157 | # netstat -tanp | egrep 'PID|LISTEN.*mongod' |
| 158 | Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name |
| 159 | tcp 0 0 127.0.0.1:27117 0.0.0.0:* LISTEN 10013/bin/mongod |
| 160 | # |
| 161 | }}} |
| 162 | |
| 163 | 9. Connect to the !UniFi controller in a web browser. Perform initial configuration, then adopt your !UniFi AP(s). |
| 164 | |
| 165 | {{{ |
| 166 | #!html |
| 167 | <div align="center"><a href="/img/ubnt/UniFi-hamster-20171226-1.png"><img src="/img/ubnt/UniFi-hamster-20171226-1.png" width="1103" height="610"></a></div> |
| 168 | }}} |
| 169 | |
| 170 | |
| 171 | === See Also === |
| 172 | |
| 173 | https://community.ubnt.com/t5/UniFi-Updates-Blog/UniFi-5-6-26-Stable-has-been-released/ba-p/2165432 \\ !UniFi 5.6.26 Stable has been released |
| 174 | |
| 175 | |