apache & services

Longman, Bill yellowdog-newbie@lists.terrasoftsolutions.com
Mon, 15 Sep 2003 10:16:28 -0700


> Subject: apache & services
> 
> 
> i have a question...
> 
> i want apache to run as a service at start up.  most of my 
> services i set up 
> in kde through system settings - server settings - services.  
> but, the httpd 
> service listed in there is the one that came with ydl 3.  i 
> compiled my own 
> version of apache in /www.  how do i get the nice gui service 
> management  
> program to use my other version of apache?

OK, I'll try this one.

All you really need to do is copy one file and edit it.

Your land of make-believe is /etc/rc.d/init.d.

Head there and pick one of the smallest files and copy it to something
snappy like, oh, say, apache, maybe.

Now just take the existing guts out of the script and put the correct info
in it. The basic structure is:


case $1 in
	start)

		#This is how you start your apache server, probably:
		/usr/local/bin/apachectl start

	;;
	stop)

		#This is how you stop your apache server, probably:
		/usr/local/bin/apachectl stop
	;;
	*)
		#This is where you yell at people for not calling the script
correctly
		echo You are a buffoon. Please use $0 [start|stop|restart]
	;;

esac

Once the script is in /etc/rc.d/init.d, you should then be able to
administer it.