LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 11-16-2004, 05:36 PM   #1
Boby
Member
 
Registered: Feb 2004
Posts: 781

Rep: Reputation: Disabled
Angry Apache refuses to connect to localhost


Hello!

I had Apache 2.0.50 compiled on my Fedora Core 2 box. It's just for running my PHP scripts and testing my homepage. Then I changed the config file and enabled viewing the local homepage to all on the LAN. This worked great too.
Then once it stoped running. I got always this message "The connection was refused when attempting to connect to localhost.". Tryed http://localhost/ , http://172.17.23.21/ [my IP adress].
I searched the forum for simmilar threads, I found some, but they didn't fix my problem.

So I recompiled my apache 2.0.52, but I still get this error. It's not working either on LAN nor on my local PC.

First, I'd like to say it's no firewall problem, port 80 is not blcked.
I made some changes to the httpd.conf file but it still won't connect.
I get this error when trying to start apache:
Code:
[root@space root]# /usr/local/Apache2/bin/apachectl start
httpd: Could not determine the server's fully qualified domain name, using 127.0.0.1 for ServerName
(98)Address already in use: make_sock: could not bind to address 172.17.23.21:80
no listening sockets available, shutting down
Unable to open logs
[root@space root]#
So if I remove my IP adress from the "Listen" command I'll get this error:
Code:
[root@space root]# /usr/local/Apache2/bin/apachectl start
httpd: Could not determine the server's fully qualified domain name, using 127.0.0.1 for ServerName
[root@space root]#
This is the error_log file:
Code:
[root@space root]# cat /usr/local/Apache2/logs/error_log
[Sun Nov 14 16:04:44 2004] [alert] (EAI 2)Name or service not known: mod_unique_id: unable to find IPv4 address of "space"
Configuration Failed
[Sun Nov 14 16:09:59 2004] [alert] (EAI 2)Name or service not known: mod_unique_id: unable to find IPv4 address of "space"
Configuration Failed
[Tue Nov 16 23:43:30 2004] [alert] (EAI 2)Name or service not known: mod_unique_id: unable to find IPv4 address of "space"
Configuration Failed
[Tue Nov 16 23:52:01 2004] [alert] (EAI 2)Name or service not known: mod_unique_id: unable to find IPv4 address of "space"
Configuration Failed
[Tue Nov 16 23:52:19 2004] [alert] (EAI 2)Name or service not known: mod_unique_id: unable to find IPv4 address of "space"
Configuration Failed
[Tue Nov 16 23:55:57 2004] [alert] (EAI 2)Name or service not known: mod_unique_id: unable to find IPv4 address of "space"
Configuration Failed
[Tue Nov 16 23:56:03 2004] [alert] (EAI 2)Name or service not known: mod_unique_id: unable to find IPv4 address of "space"
Configuration Failed
[Wed Nov 17 00:18:08 2004] [alert] (EAI 2)Name or service not known: mod_unique_id: unable to find IPv4 address of "space"
Configuration Failed
[Wed Nov 17 00:19:14 2004] [alert] (EAI 2)Name or service not known: mod_unique_id: unable to find IPv4 address of "space"
Configuration Failed
[root@space root]#
"space" is my hostname.

What can I do?
Thank you for any help!

Regards, Boby!
 
Old 11-16-2004, 09:10 PM   #2
hw-tph
Senior Member
 
Registered: Sep 2003
Location: Sweden
Distribution: Debian
Posts: 3,032

Rep: Reputation: 58
You need ServerName in your httpd.conf. If you are to only access it from the localhost, naming it "localhost" will do just fine, but if others try to access it this way they will try to connect to their own computers when clicking links or loading images.

Also, do you have a functional hostname? If you type hostname you should get the name of the system. If not you need to set it (the file is /etc/hostname).

Also, the /etc/hosts file may be of interest if name lookup fails. If your computer is called "mybox" you can set up an alias like this:
Code:
127.0.0.1    localhost    royne
The other problem you have is that some other program is listening to tcp/80 it seems. lsof -i will tell you what process is listening to port 80.



Håkan
 
Old 11-17-2004, 02:10 AM   #3
Boby
Member
 
Registered: Feb 2004
Posts: 781

Original Poster
Rep: Reputation: Disabled
Hello Håkan!

Thank you so far for your reply!
I am connected to a LAN and we have a given hostname from the server. Once I changed this in network config and set my hostname to "space" manually. You mentioned to look for my hostname so this ideea came to me. I deleted my manually added hostname and now it works when I type localhost Thank you!
Everything is working fine, but the rest of the LAN cannot access my server. I edited the httpd.conf and wrote this:
Code:
# Listen: Allows you to bind Apache to specific IP addresses and/or
# ports, instead of the default. See also the <VirtualHost>
# directive.
#
# Change this to Listen on specific IP addresses as shown below to 
# prevent Apache from glomming onto all bound IP addresses (0.0.0.0)
#
#Listen 12.34.56.78:80

Listen 172.17.23.21:80
Listen 80
When someone of the LAN types my IP adress in the browser, it just searches and searches for the page. Before this problems it worked fine. So I think there is another problem with the config of my hostname.
These are my settings:
Code:
[boby@space boby]$ cat /etc/sysconfig/network
NETWORKING=yes
HOSTNAME=
and
Code:
[boby@space boby]$ cat /etc/hosts
# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1       localhost.localdomain   localhost
So what else do I have to change so my local page can be viewed by other PC's in my LAN?

Thank you very much!
Boby
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Localhost refuses my connection! osirus Linux - Networking 4 12-30-2004 08:17 AM
HTTP Server enabled but localhost refuses me. Ukee Linux - Software 6 09-16-2004 02:15 PM
Localhost refuses to print... Nichole_knc Slackware 2 09-12-2004 07:21 AM
Apache refuses to connect by domainname arrruken Linux - Networking 2 03-24-2004 04:15 PM
MYSQL refuses to connect edhan Linux - Newbie 15 09-08-2003 05:27 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 07:28 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration