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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

RH8.0, Apache 2.0.43 - why wont it start?

Status
Not open for further replies.

rog2054

Technical User
Nov 2, 2002
6
0
0
GB
HI,

Fresh install of Redhat 8.0, without the bundled apache rpm.

Downloaded and compiled the apache 2.0.43 source, as per the instructions on the apache site - in the documentation section; ./configure, make, make install,...

when i run apachectl start i get a msg saying that it was unable to find a fqdn, and is using 127.0.0.1

As the machine is on a LAN, and does not have a domain pointing to it (at the moment), what should i set the fqdn to be? (and where do i set this?, i've looked in httpd.conf but couldnt find it)

I have added Listen 192.168.0.4:80 to the httpd.conf file, but i still get the same msg.

When i try to access the default website, either locally or over the LAN (same subnet) i get 'connection refused'.

This is not a firewall issue as i have tried it with the firewall set to 'allow all' on all interfaces in&out bound (obviously only a temporary setup until i get apache working!)

A list of running processes shows that httpd isnt running, which explains why i could not access the website...the question is why isnt it running? What do i need to change?
-i've only been using linux a few months so give a few details or links to more info as part of the answer please :)

Cheers
 
It might be looking for the ServerName in the httpd.conf file here:

#
# ServerName allows you to set a host name which is sent back to clients for
# your server if it's different than the one the program would get (i.e., use
# " instead of the host's real name).
#
# Note: You cannot just invent host names and hope they work. The name you
# define here must be a valid DNS name for your host. If you don't understand
# this, ask your network administrator.
# If your host doesn't have a registered DNS name, enter its IP address here.
# You will have to access it by its address (e.g., # anyway, and this will make redirections work in a sensible way.
#
# 127.0.0.1 is the TCP/IP local loop-back address, often named localhost. Your
# machine always knows itself by this address. If you use Apache strictly for
# local testing and development, you may use 127.0.0.1 as the server name.
#
ServerName localhost

You should be able to just set the Port to 80 without having to list the machine IP:

#
# Port: The port to which the standalone server listens. For
# ports < 1023, you will need httpd to be run as root initially.
#
Port 80


Can you post the global directives from your httpd.conf file?
 
Thanks for the reply.
I've since got the webserver running, it was the servername which needed setting.

One other question, how do i get it to start at bootup? At the moment i have to login and start it manually.

Cheers
 
From the menu click Server Settings then Services. You will see a window with a list of all the services you can start at boot time. Scroll down to httpd and put a check mark in the box then click on save. If apache is not running at the time, you can click on the Start or Restart buttons.
 
Sorry, which menu are you referring to?

I am running linux in text-only mode.
 
Sorry - There are two was to do it. The easy way is to type the &quot;setup' command. An ansi text menu should come up. Scroll down to System Services and you will see a list like the one I mentioned above. Scroll down to httpd and hit the space bar to put an &quot;*&quot; in the box. If you don't see httpd in the list then for some reason the shell script didn't get put in /etc/rc.d/init.d/. When you select one of these scripts, a symbolic link to it is created in /etc/rc.d/rc5.d or in your case /etc/rc.d/rc3.d depending on the run level you want it to start with. If you have to do this manually, use &quot;whereis httpd&quot; to find the script. The one in /usr/sbin/ is the executible not the script. It is what the shell script points to and the one you call when you start apache from the command line. Sounds kind of confusing but I wanted you to know how it works so you can figure it out. Good luck.
 
When you are compiling Apache from source, the rc.d script isn't installed. You have to create it yourself. This is the script that I use:
/etc/init.d/httpd
Code:
#!/bin/bash

RETVAL=0
PS=&quot;&quot;

# Setup variables
prog=&quot;/usr/local/apache/bin/httpd&quot;

# Source the init.d functions
. /etc/init.d/functions
# Source the network configuration
. /etc/sysconfig/network

# Check for network settings (Apache shouldn't start if it ain't up)
[ &quot;x${NETWORKING}&quot; = &quot;xno&quot; ] && exit 0

start(){
	echo -n $&quot;Starting httpd: &quot;
	$prog -k start
	PS=`ps -ef | grep $prog`
	if test -n &quot;$PS&quot;; then
		success $&quot;OK&quot;
	else
		failure $&quot;FAILED&quot;
	fi
	echo
	[ $RETVAL = 0 ] && touch /var/lock/subsys/httpd
	return $RETVAL
}
stop(){
	echo -n $&quot;Stopping httpd: &quot;
	if test -f /var/lock/subsys/httpd; then
		$prog -k stop
		PS=`ps -ef | grep $prog`
		sleep 3
		if test -n &quot;$PS&quot;; then
			failure $&quot;FAILED&quot;
		else
			rm -f /var/lock/subsys/httpd
			success $&quot;OK&quot;
		fi
	else
		failure $&quot;FAILED&quot;
	fi
	echo
}

case $1 in
	start)
		start
		;;
	stop)
		stop
		;;
	restart)
		stop
		start
		;;
	*)
		echo $&quot;Usage: $0 {start|stop|restart}&quot;
esac
Then you only have to create symlinks in /etc/rc.d/rc3.d and the other runlevels you want to start it in. //Daniel
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top