Reputation: 20810
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.
Upvotes: 67
Views: 209629
Reputation: 1
If someone works with Windows and has installed Linux with WSL. For me i had this issue:
** Restarting Apache httpd web server apache2 (13)Permission denied: AH00072: make_sock: could not bind to address 0.0.0.0:80 no listening sockets available, shutting down AH00015: Unable to open logs Action 'start' failed. The Apache error log may have more information.*
And to fix it i opend a powershell as administrator and taped this:
net stop http
tap Y and try again the command to start apache.
Upvotes: 0
Reputation: 1
Check security state
getenforce
Check firewall state
firewall-cmd --zone=public --list-all
Check excution permission
Go to httpd/bin
#chown root:[YOUR ACCOUNT] ./httpd
#chmod +s ./httpd
And re-running services
Upvotes: 0
Reputation: 1029
The actual solution here is to modify the existing port if it exists. For instance, when:
semanage port -a -t http_port_t -p tcp 88
ends up with:
ValueError: Port tcp/88 already defined
then it's very likely the port is having a different type, and to modify it, simply use:
semanage port -m -t http_port_t -p tcp 88
and then, you need to open that port via firewall-cmd
if has been closed in your zone.
Also: disabling SELinux is a potential security vulnerability, don't do this on production instances!
Upvotes: 0
Reputation: 352
after disable SELINUX, any port is aviable.
sudo -s;
setenforce 0;
sed -i 's/SELINUX=enforcing/SELINUX=disabled/g' /etc/selinux/config;
Upvotes: 1
Reputation: 1
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:
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 )
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.
sudo systemctl start httpd
Now it is working fine.
Upvotes: 0
Reputation: 17
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.
Upvotes: 0
Reputation: 1
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.
Upvotes: 0
Reputation: 161
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
Upvotes: 0
Reputation: 444
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
Upvotes: 6
Reputation: 450
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
Upvotes: 21
Reputation: 49
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
Upvotes: 3
Reputation: 1307
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...
Upvotes: -1
Reputation: 21522
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.
Upvotes: 7
Reputation: 1
First kill all the hanged instances of httpd, and then try restarting Apache:
service httpd restart
Upvotes: -5
Reputation: 27812
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:
semanage
tools: sudo yum -y install policycoreutils-python
sudo semanage port -a -t http_port_t -p tcp 88
sudo semanage port -a -t http_port_t -p tcp 8445
Upvotes: 135
Reputation: 3031
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.
Upvotes: 8
Reputation: 1198
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.
Upvotes: 56