Discussion Locked

Starting Apache ??

0 helpful
7 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

Hi.
I have loaded apache, and verified it is loaded.
When I run the command /etc/rc.d/init.d/httpd start
I get this message. (cannot determine local host name. Use ServerName directives to set it manually)
I went to the Xinet and started it. That did'nt help.
So what do I have to do, and where do I look???
Thanks for your help, Pat

7 replies

by cpfeiffe

It seems like you wouldn't want to just start /etc/rc.d/init.d/httpd. This is a daemon. Sometimes this is OK and for apache it may be, but first consider that there may be a script that is designed to set environment variables and get data such asthe local hostname and then start the daemon. Usually there is a start script like http for the daemon httpd. http will set the variables then run httpd start.

Another thing to look at is too make sure your system can properly determine its hostname. Use these commands
hostname
uname -s
nodename
Not sure if nodename works on your OS version, but if it runs it and the other commands should all give back the same host name. This hostname should also appear in your /etc/hosts file with the IP address of your machine.

by jose

Not sure what flavor of Linux you are running
But you can check/change and verify local hostname using the easy "netconf" utility in RedHat 6-7.....
or you can do all the configurations manually
using a combo of the following commands
hostnamednshostname
domainname
nisdomainname

by wiznogood

Hi,
'ServerName' is a directive in '/etc/httpd/httpd.conf' file. You could use it to set the server name if apache is confused finding it.
Find it and set to something like this:
ServerName whateveryourmachinenameis

Anyway you should resolve hostname problem, especialy if your machine is connected to the Net.

by theword

HI. Well I found the problem, before you wrote back, but still you were very close to the problem.
The problem was I needed to uncomment the line (servername) in the httpd.conf file. The book I am studying did'nt say anything about that. It works fine now.

This discussion is closed to new replies.