How to run httpd from a custom location as a non-root user with SELinux confinement

Solution Verified - Updated -

Issue

  • We want to run httpd with a custom ServerRoot and have it executed directly as a non-root user (instead of using apache's User and Group directives to transition). This works, but unfortunately the httpd process runs unconfined by SELinux (as unconfined_u:unconfined_r:unconfined_t). How can we ensure this httpd runs under the normal httpd_t domain?

Environment

  • Red Hat Enterprise Linux 6

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.

Current Customers and Partners

Log in for full access

Log In
Close

Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.