httpd Server not started: (13)Permission denied: make_sock: could not bind to address [::]:88

ApacheCentos

Apache Problem Overview


I am trying to start httpd server on centos 6. It throws following error :

[root@machine ~]# service httpd start
Starting httpd: (13)Permission denied: make_sock: could not bind to address [::]:88
(13)Permission denied: make_sock: could not bind to address 0.0.0.0:88
no listening sockets available, shutting down
Unable to open logs
                                                           [FAILED]

I have also checked for port 88, It is not is use. I also checked with semanage, but it didn't help.

Any help will be appreciated.

Apache Solutions


Solution 1 - Apache

I happened to run into this problem because of missing SELinux permissions. By default, SELinux only allowed apache/httpd to bind to the following ports:

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

So binding to my httpd.conf-configured Listen 88 HTTP port and config.d/ssl.conf-configured Listen 8445 TLS/SSL port would fail with that default SELinux configuration.

To fix my problem, I had to add ports 88 and 8445 to my system's SELinux configuration:

  1. Install semanage tools: sudo yum -y install policycoreutils-python
  2. Allow port 88 for httpd: sudo semanage port -a -t http_port_t -p tcp 88
  3. Allow port 8445 for httpd: sudo semanage port -a -t http_port_t -p tcp 8445

Solution 2 - Apache

Seems like you are running it not as "root". Only root can bind to this port (80). Check your configuration in the conf/httpd.conf file, Listen line and change the port to higher one.

Solution 3 - Apache

This is an addition to the answer by Abdull somewhere in this thread:

I had to modify instead of adding a port

semanage port -m -t http_port_t -p tcp 5000

because I get this error on adding the port

ValueError: Port tcp/5000 already defined

Solution 4 - Apache

At terminal run this command with root permission:

sudo /etc/init.d/apache2 start

You must be root for starting a webserver otherwise you would get similar error.

Solution 5 - Apache

With my centos 6.7 installation, not only did I have the problem starting httpd with root but also with xauth (getting /usr/bin/xauth: timeout in locking authority file /.Xauthority with underlying permission denied errors)

# setenforce 0

Fixed both issues.

Solution 6 - Apache

Disable SELinux

Disable SELinux temporarily

sudo setenforce 0

Restart httpd service

service httpd restart

Disable SELinux persistently (after reboot)

vi /etc/selinux/config

Add line and save

SELINUX=disabled

Solution 7 - Apache

In my case, I tried to first use port 88 instead, and even then the httpd won't start.

I used the below command, i.e. modify instead of add, as suggested by one of users, and was able to run httpd.

semanage port -a -t http_port_t -p tcp 88

Solution 8 - Apache

I edited /etc/selinux/config, set SELINUX=disabled, then reboot; then it worked. Alternately, you can run setenforce 0; you don't need reboot, but this is once used.

Solution 9 - Apache

In Linux(Centos 6 or higher) ports from 0 to 1024 are reserved for system use. you can force the system to bind to address any port lower than 1024 if you use root or privileged user.

I installed Apache-2.4 from source with non-root user and I solved this problem by allowing port higher than 1024(ex:8080) and modified http.conf file. chang Listen 80 to Listen 8080

Solution 10 - Apache

I had similar error while trying to start httpd service for openstack train installation in RHEL 7.5 too.

-- Unit httpd.service has begun starting up.
Jan 31 10:11:16 controller httpd[1631]: (13)Permission denied: AH00072: make_sock: could not bind to address 10.0.0.11:5000
Jan 31 10:11:16 controller httpd[1631]: no listening sockets available, shutting down
Jan 31 10:11:16 controller httpd[1631]: AH00015: Unable to open logs
Jan 31 10:11:16 controller systemd[1]: httpd.service: main process exited, code=exited, status=1/FAILURE
Jan 31 10:11:16 controller kill[1632]: kill: cannot find process ""
Jan 31 10:11:16 controller systemd[1]: httpd.service: control process exited, code=exited status=1
Jan 31 10:11:16 controller systemd[1]: Failed to start The Apache HTTP Server.
-- Subject: Unit httpd.service has failed

Solution: It got resolved by disabling SElinux.

Solution 11 - Apache

Just to add more info about this error, I had the similar error on CentOS 8.2:

sudo journalctl -xe

Error: Permission denied: AH00072: make_sock: could not bind to address 0.0.0.0:8081

So, I used the commands from Abdull and Ulrich-Lorenz Schlüter as a follow:

  1. Install semanage tools for CentOS 8.2: sudo yum -y install policycoreutils-python-utils (For more info: https://www.cyberciti.biz/faq/redhat-install-semanage-selinux-command-rpm )

  2. Allow port 8081 for httpd: sudo semanage port -a -t http_port_t -p tcp 8081

I got the following output: ValueError: Port tcp/8081 already defined

So, I ran:

sudo semanage port -m -t http_port_t -p tcp 8081

As Ulrich-Lorenz Schlüter mentioned.

  1. Then: sudo systemctl start httpd

Now it is working fine.

Solution 12 - Apache

Start with root user or with sudo, it works fine, here is sample output:

[ec2-user@ip-172-31-12-164 ~]$ service httpd start
Starting httpd: (13)Permission denied: make_sock: could not bind to address [::]:80
(13)Permission denied: make_sock: could not bind to address 0.0.0.0:80
no listening sockets available, shutting down
Unable to open logs
                                                           **[FAILED]**
[ec2-user@ip-172-31-12-164 ~]$ sudo service httpd start
Starting httpd:                                            [  OK  ]
[ec2-user@ip-172-31-12-164 ~]$ sudo service httpd status
httpd (pid  3077) is running...

Solution 13 - Apache

First kill all the hanged instances of httpd, and then try restarting Apache:

service httpd restart

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionNishu TayalView Question on Stackoverflow
Solution 1 - ApacheAbdullView Answer on Stackoverflow
Solution 2 - ApacheIgor ZilbermanView Answer on Stackoverflow
Solution 3 - ApacheUlrich-Lorenz SchlüterView Answer on Stackoverflow
Solution 4 - ApacheSohail xIN3NView Answer on Stackoverflow
Solution 5 - ApacheSebasView Answer on Stackoverflow
Solution 6 - ApacheJonnyView Answer on Stackoverflow
Solution 7 - ApacheSanjayMDView Answer on Stackoverflow
Solution 8 - ApacheFZZFView Answer on Stackoverflow
Solution 9 - ApacheBongSeyView Answer on Stackoverflow
Solution 10 - ApacheNepolean LuwangView Answer on Stackoverflow
Solution 11 - ApacheAlessandro C.View Answer on Stackoverflow
Solution 12 - ApacheChandraView Answer on Stackoverflow
Solution 13 - ApacheDevenView Answer on Stackoverflow