Cannot assign requested address: make_sock: could not bind to address - http

Previously my IP was 10.0.6.63 , the apache server was working fine.
On reboot DHCP changed my IP address to 10.0.15.12 Now when i try to start apache it is giving me following error
$service httpd restart
Starting httpd: [Fri Jan 11 16:17:28 2013] [warn] module wsgi_module is already loaded, skipping
(99)Cannot assign requested address: make_sock: could not bind to address 10.0.6.63:80
no listening sockets available, shutting down
Unable to open logs

If you are working with a moving IP address do no use IP based virtualhosts but named based virtulahosts.
Check this apache documentation link

Solved: Sorry guys, mistake. I had another configuration in /etc which was overriding the local configuration . which was configured for old ip.

I think you can check httpd.conf(default config file name) config file.
#Listen 12.34.56.78:80
you can change you server ip address .

I had a similar problem.
I resolved it by disabling or commenting out
this line Listen 192.168.1.80:80 in /etc/httpd/conf.d/ssl.conf.
I am running Virtualmin on a Centos 5.11

In the /etc/httpd/conf.d/ssl.conf file:
#LoadModule ssl_module modules/mod_ssl.so
#Listen 443
Comment out these lines

I was facing similar problem with apache but when i checked , I got that, the particular IP address on which my server is trying to bind is not there as that interface was deleted when my machine was rebooted.
I did following :
run dhclient to get the interface and IP
given command to create the sub interface which I had created for my apache server to listen : ifconfig ens6:1 10.10.0.80/16 up

Related

Laravel Homestead Mailhog Error listening on socket: listen tcp 0.0.0.0:1025: bind: address already in use

I am struggling to make MailHog work in my Laravel Homestead VM.
If I browse http://localhost:8025/, the web browser says it can't find it.
Then, in the command line, when executing $ mailhog, I get the following error:
Error listening on socket: listen tcp 0.0.0.0:1025: bind: address
already in use
Moreover, if I execute $ mailhog --invite-jim then I get:
2021/09/13 22:49:22 Using in-memory storage 2021/09/13 22:49:22 [SMTP]
Binding to address: 0.0.0.0:1025 [HTTP] Binding to address:
0.0.0.0:8025 2021/09/13 22:49:22 Serving under http://0.0.0.0:8025/ 2021/09/13 22:49:22 [SMTP] Error listening on socket: listen tcp
0.0.0.0:1025: bind: address already in use
Here is my .env config file
.env
MAIL_MAILER=smtp
MAIL_HOST=localhost
MAIL_PORT=1025
MAIL_USERNAME=null
MAIL_PASSWORD=null
MAIL_ENCRYPTION=null
MAIL_FROM_ADDRESS=reply#app.io
MAIL_FROM_NAME="${APP_NAME}"
Does anyone know or can shed some light how to make MailHog work?
Mailhog web interface is clearly listening at the 8025 port. The localhost or 127.0.0.1 address may not work by default.
Take a look at both the /etc/hosts and Homestead.yml file
$ sudo vim /etc/hosts
$ vim Homestead.yml
Look for the address that Homestead is working on. In this case it's 192.168.10.10 or 192.168.56.56
So now try
http://192.168.10.10:8025 or http://192.168.56.56:8025
And it should be working now

initial setup,apache restart failing

doing the initial setup for apache, and myphp, I get this message when I try to restart my apache:
AH00558: httpd: Could not reliably determine the server's fully qualified domain name, using 192.168.1.72. Set the 'ServerName' directive globally to suppress this message
This should be a warning not a problem with Apache server.
If you insert below line in either httpd.conf or apache2.conf in /etc/apache2 and restart apache the notice will disappear.
ServerName localhost
It will not work for virtual host. Make sure you have defined server name inside /etc/hosts with specific ip address

Nginx- error: bind() to 0.0.0.0:80 failed. permission denied

I am trying to run Nginx, but I am getting the error below:
bind() to 0.0.0.0:80 failed (10013: An attempt was made to access a
socket in a way forbidden by its access permissions)
Please provide some help on what changes I need to do to make it working?
I have tried running on ports other than 80 and it works. but I need it to be running on 80.
Note: I am running on Windows 7 with command prompt running as Administrator.
If the port is already in use, you can change the default port of 80 to a different port that is not in use (maybe 8070). In conf\nginx.conf:
server {
listen 8070;
...
}
After startup, you should be able to hit localhost:8070.
tl;dr
netsh http add iplisten ipaddress=::
Faced similar issue. Run the above command in command prompt.
This should free up port 80, and you'd be able to run nginx.
Description:
netsh http commands are used to query and configure HTTP.sys settings and parameters.
add iplisten :
Adds a new IP address to the IP listen list, excluding the port number.
"::" means any IPv6 address.
For more netsh http commands refer the netsh http commands documentation.
Hope this helps!!
You have to be admin or root to bind port 80. Something you can do if you cannot run as root, is that your application listens to other port, like 8080, and then you redirect messages directed to 80 to 8080. If you are using Linux you redirect messages with iptables.
nginx: [emerg] bind() to 0.0.0.0:80 failed (10013: An attempt was made to access a socket in a way forbidden by its access permissions)
I got a similar problem, My 80 port was listening to IIS (windows machine). Stopping IIS freed up 80 port.
The problem got resolved...!!
Please check if another Proxy is running under port 80 ---> in my case IIS was running as a reverse proxy, so nginx could not start..
Stopping IIS, and starting of NGXIN solved the problem
My Tomcat server was running on port 80. Changed the port number in conf\nginx.conf file and it started to work.
This is an old question but since I had this problem recently I thought of posting another possible reason in this problem.
If the user is using Docker and has already tried all proposed solutions as stated above and is wondering why port 80 is trying to bind although on your configurations you are overwriting the port to non root port e.g. listen 8080; it seems that the newer NGINX images have a default nginx.conf file in /etc/nginx/conf.d.
Sample:
$ grep -r 80 /etc/nginx/
/etc/nginx/conf.d/default.conf: listen 80;
On my case I removed it on my Dockerfile:
RUN set -x \
&& rm -f /etc/nginx/nginx.conf \
&& rm -f /etc/nginx/conf.d/default.conf
Next step pass from my custom configurations:
COPY ["conf/nginx.conf", "/etc/nginx/nginx.conf"]

why i am getting this error "Installation failed. Failed to receive heartbeat from agent." in cloudera installtion

I am installing cloudera manager on local machine.
When trying to add new host getting following error
Installation failed. Failed to receive heartbeat from agent.
Ensure that the host's hostname is configured properly.
Ensure that port 7182 is accessible on the Cloudera Manager server
(check firewall rules).
Ensure that ports 9000 and 9001 are free on the host being added.
Check agent logs in /var/log/cloudera-scm-agent/ on the host being
added
(some of the logs can be found in the installation details).
i checked the logs,it shows like hostname differs from canonical name
So I also changed the hostname from /etc/resolv.conf
But still getting sam error
I had the same error for a simple mistake in the file /etc/hosts :
Have you checked you have DNS and reverse DNS ?
Then to check if your port is open 7182, you should do a telnet IP 7182 (replace IP by the host of Cloudera Manager Server).
If there are still some problems, maybe you have forgotten to deactivate the firewall (iptables).
Regards, K.
To resolve this issue you need to check first all port opened on your server service listing to the port no, use command: sudo netstat -lpten
Check if any thing is running on 9000 or 90001, mostly java services required for set up is running on port 9000, and cloudera-scm-agent listner also runs on port 9000. to over come this issue you can re-configure theports as well in /etc/cloudera-scm-agent/config.ini by changing as below:
--------------------------------------------------
## It should not normally be necessary to modify these.
# Port that the CM agent should listen on.
listening_port=9001
-------------------------------------------------
and then restart the cloudera-scm-agent service by command:
service cloudera-scm-agent restart
To verify this port is not activated for other sshd service check Ports opened in /etc/ssh/sshd_config.
I hope this resolution will work for others too.
Cheers,
Ankit Gupta

Could not resolve hostname, ping works

I have installed RasPi Raspbian, and now I can't do ssh or git clone, only local host names are being resolved it seems. And yet ping works:
pi ~ $ ssh test.com
ssh: Could not resolve hostname test.com: Name or service not known
pi ~ $ git clone gitosis#test.com:test.git
Cloning into 'test'...
ssh: Could not resolve hostname test.com: Name or service not known
fatal: The remote end hung up unexpectedly
pi ~ $ ping test.com
PING test.com (174.36.85.72) 56(84) bytes of data.
I sort of worked around it for github by using http://github.com instead of git://github.com, but this is not normal and I would like to pinpoint the problem.
Googling for similar issues but the solutions offered was either typo correction, or adding domains to hosts file.
This sounds like a DNS issue. Try switching to another DNS server and see if it works.
OpenDNS
208.67.222.222
208.67.220.220
GoogleDNS
8.8.8.8
8.8.4.4
Try reseting te contents of the DNS client resolver cache.
(For windows) Fireup a command prompt and type:
ipconfig /flushdns
If you are a linux or mac user, they have their own way of flushing the dns.
Had the same error, I just needed to specify a folder:
localmachine $ git pull ssh://someusername#127.0.0.1:38765
ssh: Could not resolve hostname : No address associated with hostname
fatal: The remote end hung up unexpectedly
localmachine $ git pull ssh://someusername#127.0.0.1:38765/
someusername#127.0.0.1's password:
That error message is just misleading.
if you've a network-manager installed
check /etc/nsswitch.conf
if you've got a line
hosts: files mdns4_minimal [NOTFOUND=return] dns mdns4
remove the **[NOTFOUND=return]**
restart /etc/init.d/networking
the [NOTFOUND=return] prevents futher lookups if the first nameservwe doesn't respond correctly
This may be an issue with the proxy. Kindly unset and try.
git config --global --unset http.proxy
git config --global --unset https.proxy

Resources