Skip to content

Commit 1206ada

Browse files
docs: add AppArmor configuration section to Ubuntu/Debian install guide
Show how to add a local override profile for Apache rather than disabling AppArmor system-wide. Includes deny-check, profile snippet, reload command, and post-apply verification. Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>
1 parent 07d8f2b commit 1206ada

1 file changed

Lines changed: 36 additions & 0 deletions

File tree

Installing-Under-Ubuntu-Debian.md

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,42 @@ The system is now ready to finialise the steps by browsing to
144144
[http://serverip/cacti](http://serverip/cacti) to start the cacti initialization
145145
wizard.
146146

147+
### AppArmor Configuration
148+
149+
Ubuntu and Debian ship with AppArmor enabled by default. Cacti requires that
150+
Apache and PHP can read its files and write to several directories. If AppArmor
151+
denials appear in `/var/log/syslog` or `dmesg`, add a local override profile
152+
rather than disabling AppArmor system-wide.
153+
154+
Check whether denials exist:
155+
156+
```console
157+
grep -i "apparmor.*DENIED" /var/log/syslog | grep -E "apache|php"
158+
```
159+
160+
Create a local override for Apache to allow access to the Cacti directories
161+
(adjust the path if Cacti is not installed under `/var/www/html/cacti`):
162+
163+
```console
164+
cat > /etc/apparmor.d/local/usr.sbin.apache2 << 'EOF'
165+
# Cacti: allow Apache to read web root and write to RRD/log/cache dirs
166+
/var/www/html/cacti/** r,
167+
/var/www/html/cacti/rra/** rw,
168+
/var/www/html/cacti/log/** rw,
169+
/var/www/html/cacti/cache/** rw,
170+
EOF
171+
172+
apparmor_parser -r /etc/apparmor.d/usr.sbin.apache2
173+
systemctl restart apache2
174+
```
175+
176+
Verify AppArmor is enforcing (not complaining) and no new denials appear:
177+
178+
```console
179+
aa-status | grep apache2
180+
grep -i "apparmor.*DENIED" /var/log/syslog | grep apache | tail -5
181+
```
182+
147183
### Considerations when using Proxys in front of Cacti (Cacti 1.2.23+)
148184

149185
For optimal security, only specify the HTTP headers that are set by your proxy

0 commit comments

Comments
 (0)