Allowing Apache to listen on a different port with SELinux

I wanted to set up a virtual host in Apache today using a different port than the standard but kept getting a permissions error when I tried to start Apache. The problem turned out to be SELinux not allowing the port to be used. In order to fi it I just needed to add the port as one of the allowed ports for Apache.

For example, to allow Apache (httpd) to listen on port 12345 the command is

# semanage port -a -t http_port_t -p tcp 12345

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.