About SELinux
来自cslt Wiki
semanage - SELinux Policy Management tool I introduce this command because several service need obtain the permission of SElinux. 2 example:
- change mysql datadir.
1) semanage fcontext -a -s system_u -t mysqld_db_t "/var/data/mysql(/.*)?" (/var/data/mysql is the datadir you want use) 2) restorecon -Rv /var/data/mysql
- grant www/apache to read files in a directory.
1) semanage fcontext -a -t httpd_sys_rw_content_t '/var/www/html(/.*)?' 2) restorecon -R /var/www/html