I am unable to create a proper AppArmor profile for apache2 on Ubuntu 18.
When I follow these steps, I am unable to scan and build a profile for apache2 because my website fails during the genprof procedure as follows:
Note: before I do anything I stop apache with "service apache2 stop"
I run aa-genprof apache2
I get the message to start my service and scan
I then "service apache2 start" in another terminal.
I then try to hit my drupal website and it fails with a "filelock" error.
The only way I can get my website back is to disable the profile as follows:
sudo ln -s /etc/apparmor.d/usr.sbin.apache2 /etc/apparmor.d/disable/
sudo apparmor_parser -R /etc/apparmor.d/usr.sbin.apache2
I've removed the disable sym link and the apparmor apache2 config many times and tried to rerun aa-genprof many times but it fails every time.
I've also tried to put apache2 in aa-complain mode and tried aa-logprof too. I can't seem to get any apache apparmor logs to go to the syslog...
What do you recommend I do. I want to use aa-genprof to help me build an apparmor config for apache2.