Ubuntu 安裝UniFi Controller

1.準備UniFi Controller APT
2.啟動服務
3.開啟SSH登入AP

1.準備UniFi Controller APT

#sudo apt-get update && sudo apt-get install ca-certificates apt-transport-https
echo 'deb https://www.ui.com/downloads/unifi/debian stable ubiquiti' | sudo tee /etc/apt/sources.list.d/100-ubnt-unifi.list
#sudo apt-get update && wget -qO - https://www.mongodb.org/static/pgp/server-3.4.asc | sudo apt-key add -
#echo "deb https://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/3.4 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-3.4.list
#sudo apt-get update
#sudo wget -O /etc/apt/trusted.gpg.d/unifi-repo.gpg https://dl.ui.com/unifi/unifi-repo.gpg 
#sudo apt-get install unifi -y 

2.啟動服務
啟動服務時,發生了一些問題

#sudo service unifi start
#sudo service unifi status

Sep 10 20:17:32 iZj6cazkp6fzfq80buv47dZ unifi.init[18138]: * Starting Ubiquiti UniFi Controller unifi
Sep 10 20:17:32 iZj6cazkp6fzfq80buv47dZ unifi.init[18307]: Cannot locate Java Home

因為/etc/init.d/unifi 上定義了JAVA_HOME=/usr/lib/jvm/java-8-openjdk-${arch}
嘗試安裝openjdk-8-jdk

#sudo apt-get install openjdk-8-jdk
#sudo service unifi restart
#sudo service unifi status

● unifi.service – unifi
Loaded: loaded (/lib/systemd/system/unifi.service; enabled; vendor preset: enabled)
Active: active (running) since Thu 2020-09-10 21:27:23 CST; 7s ago
Process: 32502 ExecStart=/usr/lib/unifi/bin/unifi.init start (code=exited, status=0/SUCCESS)
Main PID: 32692 (jsvc)
Tasks: 119 (limit: 1037)
Memory: 472.3M
CGroup: /system.slice/unifi.service
├─32692 unifi -cwd /usr/lib/unifi -home /usr/lib/jvm/java-8-openjdk-amd64 -cp /usr/share/java/commons-daemon.jar:/usr/lib/unifi/lib/ace.jar -pidfile /var/run/unifi.pid -procname unifi -outfile SYSLOG -errfile SYSLOG -umask>
├─32693 unifi -cwd /usr/lib/unifi -home /usr/lib/jvm/java-8-openjdk-amd64 -cp /usr/share/java/commons-daemon.jar:/usr/lib/unifi/lib/ace.jar -pidfile /var/run/unifi.pid -procname unifi -outfile SYSLOG -errfile SYSLOG -umask>
├─32694 unifi -cwd /usr/lib/unifi -home /usr/lib/jvm/java-8-openjdk-amd64 -cp /usr/share/java/commons-daemon.jar:/usr/lib/unifi/lib/ace.jar -pidfile /var/run/unifi.pid -procname unifi -outfile SYSLOG -errfile SYSLOG -umask>
├─32711 /usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java -Dfile.encoding=UTF-8 -Djava.awt.headless=true -Dapple.awt.UIElement=true -Dunifi.core.enabled=false -Xmx1024M -XX:+ExitOnOutOfMemoryError -XX:+CrashOnOutOfMemoryError>
└─32739 bin/mongod –dbpath /usr/lib/unifi/data/db –port 27117 –unixSocketPrefix /usr/lib/unifi/run –logRotate reopen –logappend –logpath /usr/lib/unifi/logs/mongod.log –pidfilepath /usr/lib/unifi/run/mongod.pid –bi>

Sep 10 21:27:11 iZj6cazkp6fzfq80buv47dZ systemd[1]: Stopped unifi.
Sep 10 21:27:11 iZj6cazkp6fzfq80buv47dZ systemd[1]: Starting unifi…
Sep 10 21:27:11 iZj6cazkp6fzfq80buv47dZ unifi.init[32502]: * Starting Ubiquiti UniFi Controller unifi
Sep 10 21:27:23 iZj6cazkp6fzfq80buv47dZ unifi.init[32502]: …done.
Sep 10 21:27:23 iZj6cazkp6fzfq80buv47dZ systemd[1]: Started unifi.

3.開啟SSH登入AP
Launch the UniFi Network Controller and go to Settings > Site and enable Advanced Features. Save changes and refresh the screen.

Now you should see a Device Authentication section under Settings > Site. Note that if you had previously enabled SSH Authentication and then disabled Advanced Features, this section would be visible without requiring Advanced Features to be enabled in step 1.

Facebook Comments