Control SELinux File Contexts Flashcards

1
Q

What command do you use to create a directory for Apache in a non-standard location?

A

mkdir /custom

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What command do you use to configure Apache to use a new directory location?

A

vim /etc/httpd/conf/httpd.conf

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What command do you use to start and enable the Apache web service?

A

systemctl enable –now httpd

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What command do you use to verify Apache web service is running?

A

systemctl status httpd

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What command do you use to define the SELinux file context rule that sets the context type to httpd_sys_content_t?

A

semange fcontext -a -t httpd_sys_content_t ‘/custom(/.*)?’

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What command is used to correct file contexts in the /custom directory?

A

restorecon -Rv /custom

How well did you know this?
1
Not at all
2
3
4
5
Perfectly