Solve SELINUX can’t start after the Apache changes the port

systemctl start httpd # After changing the default port of Apache to 90, it prompts failure when starting Apache

< span style="font-size: 16px;">systemctl status httpd # View the status of Apache

You can see the prompt: Permission denied: AH00072: make_sock: could not bind to address [::]:90, meaning that permission was denied: AH00072: make_sock: could not bind to address [::]:90

share picture

This is caused by the SELinux security mechanism

Solution :

semanage port -l | grep http # View the httpd ports currently supported

http_port_t tcp 80, 81, 443, 488, 8008, 8009, 8443, 9000

You can see that there is no port 90 at http_port_t

share picture

semanage port -a -t http_port_t -p tcp 90 # Add port 90 to SELinux

share picture

systemctl restart httpd # Restart the Apache server

netstat -ntlp | grep http # View the port status, as shown below , Indicating successful startup

share picture

Leave a Comment

Your email address will not be published.