Reputation: 21
I am trying to configure two sites on different ports of same ip address.
(13)Permission denied: make_sock: could not bind to address [::]:9000
I am getting error . what is reason to this error and how to solve this error ?
my httpd.conf
file is
Listen 80
NameVirtualHost 192.168.2.10:80
<VirtualHost 192.168.2.10:80>
DocumentRoot /var/www/html/white-socks
ServerName www.white-socks.com
</VirtualHost>
Listen 9000
NameVirtualHost 192.168.2.10:9000
<VirtualHost 192.168.2.10:9000>
DocumentRoot /var/www/html/black-socks
ServerName www.black-socks.com
</VirtualHost>
I am getting error like below.
[root@ram conf]# service httpd start
Starting httpd: httpd: apr_sockaddr_info_get() failed for ram
httpd: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1 for ServerName
(13)Permission denied: make_sock: could not bind to address [::]:9000
(13)Permission denied: make_sock: could not bind to address 0.0.0.0:9000
no listening sockets available, shutting down
Unable to open logs
[FAILED]
[root@ram conf]#
what i have to do fix this ?
Upvotes: 2
Views: 13304
Reputation: 411
There are two issues that need to be resolved:
sudo httpd
sudo allows you to run commands as root. If it works as normal then its a permissions issue.
sudo bash -x /usr/sbin/apachectl -k stop
Will stop the default server in MacOS
sudo launchctl unload /System/Library/LaunchDaemons/org.apache.httpd.plist
Will stop future running at startup
Upvotes: 1
Reputation: 1837
Many a times this error occurs if you are using Selinux ( Only for RedHat base OS) and it is not configured properly. Try disabling Selinux by setenforce 0
or if you don't want to disable selinux than properly configure selinux by :-
semanage port -l | grep http
semanage port -a -t http_port_t -p tcp 9000
Restart your apache server and check.
Also you can check the netstat command ouput to see if ports are already been used or not.
netstat -tunalp | grep :9000
netstat -tunalp | grep :80
Upvotes: 1