Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

apache is not starting 1

Status
Not open for further replies.

piti

Technical User
Apr 12, 2001
627
SK
i have recompiled kernel (just added one netcard module) and changed the machine ip, network ip, gateway, nameserver, host and domain name
as there's nothing like linuxconf, i changed the values in the network related files in /etc/sysconfig/
now i have problem starting apache (running virtual hosts)
i'm getting this message:
[alert] httpd: Could not determine the server's fully qualified domain name, using 127.0.0.1 for ServerName
httpd could not be started

do anyone know what could i have done what caused this situation or how to solve it?
 
Hi,

You need to set the 'ServerName' directive in your httpd.conf file. For example :

ServerName
If thats missing apache will endeavour to use the host name and domain name set on the system. For redhat that would be (for example) :

HOSTNAME=
in file /etc/sysconfig/network

Hope this helps
 
that's not working - i'm not receiving the not recognized domain name message, but apache is still not starting

btw: the ServeName directive wasn't set on the previous configuration and it worked fine
i just changed
hostname name.domain1.tld to newname.domain2.tld
and
domainname domain1.tld to domain2.tld

 
i forgot to mention the error_log mesage:

[alert] mod_unique_id: unable to gethostbyname("myhostname")
 
piti,
IF is right; you need that servername directive ; you also
need a dns entry for your machine if you are trying to resolve it globally(internet). IF was trying to get a local test set for you.

you might run the following series of commands:

httpd -t && if [ -z "$(pidof httpd)" ] ; then echo "httpd starting.." && httpd || echo "Fail $?, $_."

if you get errors in the first command the you have syntax errors, otheriwse httpd should start if your name resolution is set up correctly. Otherwise, if the gethostbyname() error
occurs use your ip address instead of a name and see if you can connect.

if you can connect by ip and not by name your name service is misconfigured or you are having some form of network
problem(firewall)that prevents you from resolving names.
 
thanx

apache started after setting the hostname to the machine ip

and that command wasn't somehow working or what, after running it i received a new prompt like "> "
but never mind, the server is on - i'll check the dns records and the other stuff

thanx again
 
Good; missing some punctuation somewhere on the command, not
that it matters.

Okay, good luck.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top