Page 1 of 1

[SOLVED] httpd fails to start if not connected to internet

PostPosted: Feb 13th, '14, 18:40
by trednet
It just said failed (timeout). So I figured it was trying to talk to the internet. I plugged in the internet cable and systemctl start httpd worked immediately. After it starts I can disconnect the cable and httpd keeps on going. I didn't have this problem in Mageia 3 with recent updates. It's probably just the way it is configured in Mageia 4.

I am just setting up zoneminder on a local network. I don't want to have to connect it to the internet every time I need to restart for some reason.

Re: Apache httpd fails to start if not connected to internet

PostPosted: Feb 13th, '14, 22:29
by doktor5000
Could you also show the output from systemctl or journalctl for your httpd in case internet cable is not plugged?
Also some more hints about your network setup could be useful for people trying to help you.

Re: Apache httpd fails to start if not connected to internet

PostPosted: Feb 13th, '14, 23:02
by trednet
I have one computer and 2 network cameras connected to a network switch. All IP's manually configured. This is working fine with zoneminder after getting the httpd started. The systemctl status basically said failed (time out). I can get more later. Fortunately I still have all the config files from the Mageia 3 setup in /etc for httpd so I can go through and compare. I am creating problems faster than I can solve them. I wish I understood networks better. I'm out of time now.

Re: Apache httpd fails to start if not connected to internet

PostPosted: Feb 13th, '14, 23:44
by doktor5000
Probably because without the internet cable you don't have a default route/gateway, although I may be off there.

Please post the output as root of
Code: Select all
route -n
ifconfig -a

with and without internet cable

Also it would be good to show the configuration of your httpd, at least which interfaces it does listen on.

Re: Apache httpd fails to start if not connected to internet

PostPosted: Feb 15th, '14, 11:17
by trednet
With no cable at all httpd started right up cause the resolv.conf is empty. The problem was related to the DNS servers. I guess httpd tries to determine the server name by doing a lookup if there are DNS servers configured. On the local only network the DNS is configured to servers it can not access because I manually configured it that way. I seen in the httpd.conf file that the ServerName can be specified.
ServerName 192.168.1.4:80

This solved the problem. :D Thanks for your help.

Re: [SOLVED] httpd fails to start if not connected to intern

PostPosted: Feb 15th, '14, 19:51
by doktor5000
Next time best make sure you have an entry for your hostname in /etc/hosts if you refer to it somewhere by hostname ;)