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

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

Postby trednet » Feb 13th, '14, 18:40

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.
Last edited by trednet on Feb 15th, '14, 11:19, edited 1 time in total.
trednet
 
Posts: 3
Joined: Feb 13th, '14, 17:58

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

Postby doktor5000 » Feb 13th, '14, 22:29

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.
Cauldron is not for the faint of heart!
Caution: Hot, bubbling magic inside. May explode or cook your kittens!
----
Disclaimer: Beware of allergic reactions in answer to unconstructive complaint-type posts
User avatar
doktor5000
 
Posts: 18050
Joined: Jun 4th, '11, 10:10
Location: Leipzig, Germany

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

Postby trednet » Feb 13th, '14, 23:02

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.
trednet
 
Posts: 3
Joined: Feb 13th, '14, 17:58

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

Postby doktor5000 » Feb 13th, '14, 23:44

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.
Cauldron is not for the faint of heart!
Caution: Hot, bubbling magic inside. May explode or cook your kittens!
----
Disclaimer: Beware of allergic reactions in answer to unconstructive complaint-type posts
User avatar
doktor5000
 
Posts: 18050
Joined: Jun 4th, '11, 10:10
Location: Leipzig, Germany

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

Postby trednet » Feb 15th, '14, 11:17

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.
trednet
 
Posts: 3
Joined: Feb 13th, '14, 17:58

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

Postby doktor5000 » Feb 15th, '14, 19:51

Next time best make sure you have an entry for your hostname in /etc/hosts if you refer to it somewhere by hostname ;)
Cauldron is not for the faint of heart!
Caution: Hot, bubbling magic inside. May explode or cook your kittens!
----
Disclaimer: Beware of allergic reactions in answer to unconstructive complaint-type posts
User avatar
doktor5000
 
Posts: 18050
Joined: Jun 4th, '11, 10:10
Location: Leipzig, Germany


Return to Networking

Who is online

Users browsing this forum: No registered users and 1 guest