There is "small" difference between
and
The first one only set contex for specified file, but when file id deleted and created again or restored from backup (ie. tar without --selinux attribute) the changed context is not restored.
To permanently change context to file or some files, even created you have to use semanage:
to change context to directory /some/dir and all files in this directory.
If you want to use Submin, or any other web application that resides outside default Apache directory (/var/www/html) you have to set proper SELinux context for all files. In this case all files are located in /var/lib/submin directory. Without this you will get some error messages in /var/log/audit/audit.log:
and in /var/log/messages:
You should change context of /var/lib/submin/cgi-bin/submin.cgi to httpd_sys_script_exec_t and whole /var/lib/submin/conf/ directory to httpd_sys_script_rw_t:
additionally if You want Submin to work with Apache on different port (ie. 88), you have to change http_vhost options:
note there is no tailing slash (/) in address.
Add comment