-
Notifications
You must be signed in to change notification settings - Fork 1
/
Unifi_Controller
67 lines (48 loc) · 1.57 KB
/
Unifi_Controller
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
# Download binaries
wget -c https://www.ubnt.com/downloads/unifi/5.4.16/UniFi.unix.zip
# Install mongoDB
sudo zypper in mongodb
# Add system account
sudo useradd -r -U ubnt
# Extract zip file to /opt
sudo unzip -q UniFi.unix.zip -d /opt
# Recreate symbolic link to mongoDB binary
sudo ln -sf /usr/sbin/mongod /opt/UniFi/bin/
# Change directory permissions
sudo chown -R ubnt:ubnt /opt/UniFi
# Create a systemd file
sudo tee -a /etc/systemd/system/unifi.service <<-EOF
#
# Systemd unit file for UniFi Controller
#
[Unit]
Description=UniFi AP Web Controller
After=syslog.target network.target
[Service]
Type=simple
User=ubnt
WorkingDirectory=/opt/UniFi
ExecStart=/usr/bin/java -Xmx1024M -jar /opt/UniFi/lib/ace.jar start
ExecStop=/usr/bin/java -jar /opt/UniFi/lib/ace.jar stop
SuccessExitStatus=143
[Install]
WantedBy=multi-user.target
EOF
# Enable the service to start at boot time
sudo systemctl enable unifi.service
# Reload systemctl
sudo systemctl daemon-reload
# Create a file for SuSEFirewall2 rules
sudo tee -a /etc/sysconfig/SuSEfirewall2.d/services/unifi <<-EOF
## Name: Unifi Controller
## Description: Open ports for Unifi Controller with broadcast allowed.
# space separated list of allowed TCP ports
TCP="8080 8443 8880 8843"
# space separated list of allowed UDP ports
UDP="3478 10001"
# space separated list of allowed UDP ports that accept broadcasts
BROADCAST="3478 10001"
EOF
Open the Firewall in Yast ==> Allowed Services ==> Service to Allow ==> Unifi Controller (in the drop-down box) + Add ==> Next ==> Finish
# Open browser and navigate to
https://localhost:8443