Centos 7 apache cannot bind port 80

Decagrog asked:

I’ve a freshly installed Centos 7 with just the basics and apache-php-mysql but I cannot find a way to run apache on port 80.

Since the machine is used just locally I’ve disabled selinux and firewall, when I try to run apache I get:

(13)Permission denied: AH00072: make_sock: could not bind to address 
no listening sockets available, shutting down 
AH00015: Unable to open logs

I’ve already checked on port 80 with netstat -tlnp
but there is nothing running

My answer:

This has nothing to do with SELinux (which you should not have disabled).

You cannot start Apache as a regular user and bind to port 80. You must start it as root, and you should use the included systemd unit to do so.

sudo systemctl start httpd

View the full question and any other answers on Server Fault.

Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.