Apache on localhost with no internet connection - not starting
I'm trying to run Apache on a laptop. It's setup to listen on localhost:80, but it will not start unless there is an active internet connecection. It spits out an error about the address format not being valid, and then it fails to start Apache. (Sorry I don't have the actual error, but the laptop is not in front of me now.) When I connect to a wifi hotspot or via ethernet, Apache starts with no errors.
Will Apache simply not run without being internet connected? Or do I need to modify the /etc/hosts file or DNS setup in some way? --Akshun J |
I am sure Apache works without Internet connection. Please look out for any scary errors in the log files (httpd). It should help to solve the problem.
|
That's the weird part. I don't get any errors in the log file. Just that initial failure message where apache fails. Suggestions?
|
which os do you use for this? Apache is starting properly or not? see logs for that. what apache log says?
|
I'm trying to help a friend out with his Mandriva laptop. The error logs for Apache are not saying anything, and Apache is not starting. I will post the error message that appears on the commandline when startup fails in a few minutes when I get in to work... Thanks!
--Akshun J |
Below is the error...
Starting httpd: [Thu May 22 11:24:36 2008] [crit] (EAI 9)Address family for hostname not supported: alloc_listener: failed to set up sockaddr for 127.0.0.1 Syntax error on line 160 of /etc/httpd/conf/httpd.conf: Listen setup failed And my line 160 reads: Listen 127.0.0.1:80 So, I'm not sure what the issue is. Any advice? --Akshun J |
Quote:
With which user do you try to start apache on port 80 ? Because that's a privileged port and nothing besides root can do such a thing. |
Permissions was not an issue. I was starting Apache as root, and wanted it to start on-boot. However, I fixed the problem.
I changed both the httpd.conf file and the ssl config file to both listen for *:80. This solved the problem. I think they just needed to both be listening for the same port with the same address format. Thanks for the suggestions, though... --Akshun J |
I have exactly the same problem on Gentoo release 1.12.13 with Apache 2.2.14-r1
Apache won't start when there is no Internet connection, fails with: Quote:
I tried everything after Listen - localhost, *, 0.0.0.0, etc, it doesn't work. But the real question is - why does it work and start up when there is connection to Internet?? |
In your httpd.conf
Try: Listen 80 Rather than: Listen 127.0.0.1:80 |
Thanks jwl17330536!
"Listen 80" alone didn't help, but when I set both Listen directives to just 80 and 443: Quote:
Quote:
|
All times are GMT -5. The time now is 08:22 PM. |