What Are SELinux Booleans?
Booleans are policy switches that enable or disable common service behaviors without writing custom policy modules. They're the safest way to adjust SELinux behavior.
Listing Booleans
getsebool -a | grep httpdShows booleans like:
httpd_can_network_connect --> off
httpd_can_network_connect_db --> off
httpd_enable_homedirs --> off
httpd_can_sendmail --> offMaster this topic with hands-on labs
Go beyond reading — build real projects in sandboxed environments with expert video guidance.
Browse Courses →Changing Booleans
Runtime only (lost on reboot):
setsebool httpd_can_network_connect onPersistent (survives reboot):
setsebool -P httpd_can_network_connect onAlways use -P for production.
Essential httpd Booleans
| Boolean | Purpose |
|---|---|
httpd_can_network_connect | Outbound TCP connections |
httpd_can_network_connect_db | Database connections |
httpd_enable_homedirs | Serve user home dirs |
httpd_can_sendmail | Send emails |
httpd_use_nfs | Serve NFS content |
Get weekly IT automation tips
Docker, Ansible, Terraform, MLOps — curated insights delivered to your inbox. No spam.
Subscribe Free →Real-World Example: PHP-FPM over TCP
Apache connecting to PHP-FPM on 127.0.0.1:9000:
curl http://localhost/index.php
# 503 Service UnavailableAVC log shows name_connect denied. Fix:
setsebool -P httpd_can_network_connect onBoolean Discovery Workflow
- Hit a denial → check AVC logs
- Run
audit2allow→ see if it suggests a boolean - Verify with
getsebool boolean_name - Enable with
setsebool -P boolean_name on - Verify the service works
Learn to use booleans in our SELinux for System Admins course.
---
Ready to go deeper? Check out our hands-on course: SELinux for System Admins — practical exercises you can follow along on your own machine.
Ready to learn by doing?
Stop reading tutorials — start building. Expert video courses with hands-on labs in real sandboxed environments.
Related Articles
SELinux Cheat Sheet for RHEL
Quick reference for essential SELinux commands on RHEL 9/10. Modes, contexts, labels, booleans, logs, and troubleshooting in one page.
SELinux Upload Directories Guide
Properly label writable upload directories for Apache with SELinux. Use httpd_sys_rw_content_t to allow writes without disabling security.
SELinux for Apache and PHP-FPM
Configure Apache with PHP-FPM over TCP on RHEL with SELinux enforcing. Diagnose and fix name_connect denials using the correct SELinux boolean and audit tools.
SELinux DAC vs MAC Explained
Understand the difference between Discretionary and Mandatory Access Control. Learn why MAC stops attacks that DAC cannot prevent.
SELinux File Contexts and Labels
Master SELinux file labeling with semanage fcontext and restorecon. The persistent labeling workflow every sysadmin needs to know.
SELinux Policy with sesearch
Use sesearch to query SELinux policy rules. Learn to inspect what httpd_t is allowed to do and verify policy before making changes.
Explore topics
Browse more articles on the topics covered here.