“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....”为内容创建页面)
(没有差异)

2016年11月3日 (四) 04:05的版本

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