LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 12-10-2009, 12:47 AM   #1
shihao
Member
 
Registered: Aug 2009
Posts: 33

Rep: Reputation: 15
Centos apache unable to start correctly


Hello guys,

I have encounter with an apache problem, when I try to restart the apache

/etc/init.d/httpd restart
Stopping httpd: [ OK ]
Starting httpd: httpd: apr_sockaddr_info_get() failed for server1.mikrotik.digitallinx.com
httpd: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1 for ServerName
[ OK ]

my /etc/hosts is

127.0.0.1 localhost.localdomain localhost


And I am going to publish the websites without hosts name and domain name.

Someone can help me please??


Thanks and regards
Shi Hao
 
Old 12-10-2009, 01:59 AM   #2
RDove
LQ Newbie
 
Registered: Jul 2004
Posts: 22

Rep: Reputation: 16
Add server1.mikrotik.digitallinx.com next to localhost in /etc/hosts file. What is the official hostname of your system? That should be next to localhost line. For example mine looks like this because my hostname is ronalddove:

127.0.0.1 ronalddove.com ronalddove sls-ea4p14.superbservers.com sls-ea4p14 localhost.localdomain localhost
 
Old 12-10-2009, 02:12 AM   #3
shihao
Member
 
Registered: Aug 2009
Posts: 33

Original Poster
Rep: Reputation: 15
When I tail -f the messages, it shows:

Dec 10 17:49:23 server1 avahi-daemon[3188]: iface.c: interface_mdns_mcast_join() called but no local address available.
Dec 10 17:49:23 server1 avahi-daemon[3188]: Interface eth0.IPv6 no longer relevant for mDNS.
Dec 10 17:49:23 server1 kernel: ADDRCONF(NETDEV_UP): eth0: link is not ready
Dec 10 17:49:25 server1 kernel: e1000: eth0: e1000_watchdog_task: NIC Link is Up 100 Mbps Full Duplex, Flow Control: RX
Dec 10 17:49:25 server1 kernel: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready
Dec 10 17:49:25 server1 kernel: eth0: IPv6 duplicate address detected!
Dec 10 17:49:27 server1 avahi-daemon[3188]: New relevant interface eth0.IPv4 for mDNS.
Dec 10 17:49:27 server1 avahi-daemon[3188]: Joining mDNS multicast group on interface eth0.IPv4 with address 67.222.140.183.
Dec 10 17:49:27 server1 avahi-daemon[3188]: Registering new address record for 67.222.140.183 on eth0.
Dec 10 18:39:24 server1 restorecond: Will not restore a file with more than one hard link (/etc/resolv.conf) No such file or directory


How I going to solve it ?
 
Old 12-10-2009, 02:17 AM   #4
shihao
Member
 
Registered: Aug 2009
Posts: 33

Original Poster
Rep: Reputation: 15
Dear RDove,

I boss ask me to publish it without domain name and host name,
the URL is something like 66.100.2.140/orderform ...

My other server is able to publish without domain name, so I think this one should be able to do so.

I have not given any domain name and host name

Thanks and regards
Shi Hao
 
Old 12-10-2009, 02:43 AM   #5
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,165
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
Hi,

Open httpd.conf and look for the ServerName directive. Change it to be:
Code:
ServerName localhost.localdomain
if you don't need a read hostname
 
Old 12-10-2009, 03:40 AM   #6
shihao
Member
 
Registered: Aug 2009
Posts: 33

Original Poster
Rep: Reputation: 15
hi Bathory,

izit in /etc/httpd/conf/httpd.conf? Is a big file..

I put 127.0.0.1 localhost.localdomain localhost
before <IfModule prefork.c>, but it return me error:

Starting httpd: Syntax error on line 101 of /etc/httpd/conf/httpd.conf:
Invalid command '127.0.0.1', perhaps misspelled or defined by a module not included in the server configuration
 
Old 12-10-2009, 03:51 AM   #7
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,165
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
You need just a name or an IP address, not both. So you can use just one of the following:
Code:
ServerName localhost.localdomain
or
ServerName 127.0.0.1
or 
ServerName 66.100.2.140
so apache stops complaining about it.

Regards
 
Old 12-10-2009, 04:13 AM   #8
shihao
Member
 
Registered: Aug 2009
Posts: 33

Original Poster
Rep: Reputation: 15
hi Bathory,

After adding the code
[root@server1 log]# service httpd restart
Stopping httpd: [ OK ]
Starting httpd: [ OK ]

It works, but my web pages still doesn'st appear for some reason. Guys, any clues?
Anyway thanks to Bathory!

The var/log/messages still the same:
Dec 10 17:49:23 server1 avahi-daemon[3188]: iface.c: interface_mdns_mcast_join() called but no local address available.
Dec 10 17:49:23 server1 avahi-daemon[3188]: Interface eth0.IPv6 no longer relevant for mDNS.
Dec 10 17:49:23 server1 kernel: ADDRCONF(NETDEV_UP): eth0: link is not ready
Dec 10 17:49:25 server1 kernel: e1000: eth0: e1000_watchdog_task: NIC Link is Up 100 Mbps Full Duplex, Flow Control: RX
Dec 10 17:49:25 server1 kernel: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready
Dec 10 17:49:25 server1 kernel: eth0: IPv6 duplicate address detected!
Dec 10 17:49:27 server1 avahi-daemon[3188]: New relevant interface eth0.IPv4 for mDNS.
Dec 10 17:49:27 server1 avahi-daemon[3188]: Joining mDNS multicast group on interface eth0.IPv4 with address 67.222.140.183.
Dec 10 17:49:27 server1 avahi-daemon[3188]: Registering new address record for 67.222.140.183 on eth0.
Dec 10 18:39:24 server1 restorecond: Will not restore a file with more than one hard link (/etc/resolv.conf) No such file or directory
 
Old 12-10-2009, 04:19 AM   #9
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,165
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
You should check the apache error log (maybe /var/log/httpd/error_log) to see what is the problem.
You could also post httpd.conf to get better help.
 
Old 12-10-2009, 04:46 AM   #10
shihao
Member
 
Registered: Aug 2009
Posts: 33

Original Poster
Rep: Reputation: 15
My var/log/httpd/error_log is:
[Thu Dec 10 20:52:02 2009] [notice] mod_python: Creating 4 session mutexes based on 256 max processes and 0 max threads.
[Thu Dec 10 20:52:02 2009] [notice] Apache/2.2.3 (CentOS) configured -- resuming normal operations
[Thu Dec 10 20:54:55 2009] [notice] caught SIGTERM, shutting down
[Thu Dec 10 20:55:50 2009] [notice] SELinux policy enabled; httpd running as context root:system_r:httpd_t:s0
[Thu Dec 10 20:55:50 2009] [notice] suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)
[Thu Dec 10 20:55:56 2009] [notice] Digest: generating secret for digest authentication ...
[Thu Dec 10 20:55:56 2009] [notice] Digest: done
[Thu Dec 10 20:55:56 2009] [notice] mod_python: Creating 4 session mutexes based on 256 max processes and 0 max threads.
[Thu Dec 10 20:55:56 2009] [notice] Apache/2.2.3 (CentOS) configured -- resuming normal operations
[Thu Dec 10 20:56:00 2009] [notice] caught SIGTERM, shutting down
[Thu Dec 10 20:56:02 2009] [notice] SELinux policy enabled; httpd running as context root:system_r:httpd_t:s0
[Thu Dec 10 20:56:02 2009] [notice] suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)
[Thu Dec 10 20:56:03 2009] [notice] Digest: generating secret for digest authentication ...
[Thu Dec 10 20:56:03 2009] [notice] Digest: done
[Thu Dec 10 20:56:03 2009] [notice] mod_python: Creating 4 session mutexes based on 256 max processes and 0 max threads.
[Thu Dec 10 20:56:03 2009] [notice] Apache/2.2.3 (CentOS) configured -- resuming normal operations
[Thu Dec 10 20:58:10 2009] [notice] caught SIGTERM, shutting down
[Thu Dec 10 20:59:09 2009] [notice] SELinux policy enabled; httpd running as context root:system_r:httpd_t:s0
[Thu Dec 10 20:59:09 2009] [notice] suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)
[Thu Dec 10 20:59:10 2009] [notice] Digest: generating secret for digest authentication ...
[Thu Dec 10 20:59:10 2009] [notice] Digest: done
[Thu Dec 10 20:59:10 2009] [notice] mod_python: Creating 4 session mutexes based on 256 max processes and 0 max threads.
[Thu Dec 10 20:59:10 2009] [notice] Apache/2.2.3 (CentOS) configured -- resuming normal operations
[Thu Dec 10 20:59:12 2009] [notice] caught SIGTERM, shutting down
[Thu Dec 10 20:59:14 2009] [notice] SELinux policy enabled; httpd running as context root:system_r:httpd_t:s0
[Thu Dec 10 20:59:14 2009] [notice] suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)
[Thu Dec 10 20:59:15 2009] [notice] Digest: generating secret for digest authentication ...
[Thu Dec 10 20:59:15 2009] [notice] Digest: done
[Thu Dec 10 20:59:15 2009] [notice] mod_python: Creating 4 session mutexes based on 256 max processes and 0 max threads.
[Thu Dec 10 20:59:15 2009] [notice] Apache/2.2.3 (CentOS) configured -- resuming normal operations
[Thu Dec 10 21:10:12 2009] [notice] caught SIGTERM, shutting down
[Thu Dec 10 21:10:13 2009] [notice] SELinux policy enabled; httpd running as context root:system_r:httpd_t:s0
[Thu Dec 10 21:10:13 2009] [notice] suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)
[Thu Dec 10 21:10:13 2009] [notice] Digest: generating secret for digest authentication ...
[Thu Dec 10 21:10:13 2009] [notice] Digest: done
[Thu Dec 10 21:10:13 2009] [notice] mod_python: Creating 4 session mutexes based on 256 max processes and 0 max threads.
[Thu Dec 10 21:10:13 2009] [notice] Apache/2.2.3 (CentOS) configured -- resuming normal operations
[Thu Dec 10 21:20:20 2009] [notice] caught SIGTERM, shutting down
[Thu Dec 10 21:20:21 2009] [notice] SELinux policy enabled; httpd running as context root:system_r:httpd_t:s0
[Thu Dec 10 21:20:21 2009] [notice] suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)
[Thu Dec 10 21:20:21 2009] [notice] Digest: generating secret for digest authentication ...
[Thu Dec 10 21:20:21 2009] [notice] Digest: done
[Thu Dec 10 21:20:21 2009] [notice] mod_python: Creating 4 session mutexes based on 256 max processes and 0 max threads.
[Thu Dec 10 21:20:21 2009] [notice] Apache/2.2.3 (CentOS) configured -- resuming normal operations
[Thu Dec 10 21:33:33 2009] [notice] caught SIGTERM, shutting down
[Thu Dec 10 21:33:34 2009] [notice] SELinux policy enabled; httpd running as context root:system_r:httpd_t:s0
[Thu Dec 10 21:33:34 2009] [notice] suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)
[Thu Dec 10 21:33:34 2009] [notice] Digest: generating secret for digest authentication ...
[Thu Dec 10 21:33:34 2009] [notice] Digest: done
[Thu Dec 10 21:33:34 2009] [notice] mod_python: Creating 4 session mutexes based on 256 max processes and 0 max threads.
[Thu Dec 10 21:33:34 2009] [notice] Apache/2.2.3 (CentOS) configured -- resuming normal operations
 
Old 12-10-2009, 04:58 AM   #11
shihao
Member
 
Registered: Aug 2009
Posts: 33

Original Poster
Rep: Reputation: 15
httpd.conf files
Attached Files
File Type: txt httpd.txt (33.1 KB, 43 views)
 
Old 12-10-2009, 05:09 AM   #12
shihao
Member
 
Registered: Aug 2009
Posts: 33

Original Poster
Rep: Reputation: 15
Sorry, too messy, I try to make it clean a bit
Attached Files
File Type: txt httpd.txt (33.3 KB, 37 views)
 
Old 12-10-2009, 05:17 AM   #13
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,165
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
I don't see any errors in error_log and your httpd.conf looks OK.
What exactly happens when you try to access your server at http://localhost
Maybe it's a SELinux problem. Try to disable it by running:
Code:
setenforce 0
and see if you get anything.
 
Old 12-10-2009, 05:37 AM   #14
shihao
Member
 
Registered: Aug 2009
Posts: 33

Original Poster
Rep: Reputation: 15
Quote:
What exactly happens when you try to access your server at http://localhost
Is a remote server, I only able to putty it.
Quote:
Maybe it's a SELinux problem. Try to disable it by running:
setenforce 0.
Still the same problem persists.
 
Old 12-10-2009, 05:42 AM   #15
shihao
Member
 
Registered: Aug 2009
Posts: 33

Original Poster
Rep: Reputation: 15
Is a Centos 5.4. suppose after I put the test.php code at /var/www/html,
I will able to see by typing following example URL:
66.200.100.199/test.php

What I see is the apache problem, or u see anythings else ??
 
  


Reply



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
Unable to start apache on CentOS Linux with error Starting httpd: Syntax error on lin pkumar2533 Linux - Newbie 9 08-26-2009 07:48 AM
CentOS v5.2 - Unable to start udev Arty Ziff Linux - Server 3 12-03-2008 07:16 AM
CentOS 4.2, Making Apache, and VsFTP Start at bootup adnonimape Linux - Software 1 03-22-2006 05:08 AM
Unable to start Apache anjanesh Linux - General 14 01-03-2006 12:23 PM
not able to start up apache correctly due to fqdn issue Robin01 Linux - Newbie 4 11-23-2003 03:43 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 01:38 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
Open Source Consulting | Domain Registration