Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

apache

centos

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.

like image 208
Nishu Tayal Avatar asked Jun 13 '13 05:06

Nishu Tayal


3 Answers

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
like image 142
Abdull Avatar answered Oct 20 '22 09:10

Abdull


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.

like image 30
Igor Zilberman Avatar answered Oct 20 '22 09:10

Igor Zilberman


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

like image 16
Ulrich-Lorenz Schlüter Avatar answered Oct 20 '22 08:10

Ulrich-Lorenz Schlüter