How to run HTTPD on boot ?

How to run HTTPD on boot ?

Post by Craig Dewi » Mon, 20 Nov 1995 04:00:00




>We have a SPARC 5 running Solaris 2.4 / SunOS 5.4.
>I wish to have httpd started each time the system is booted. I have root privs. Where should I be looking ?
>I have tried various methods (inetd etc) but am now lost for alternatives.
>any help appreciated.

Ok, I run a small network of Sun-3 machines on my local network, and I
start httpd at boot time from /etc/rc.local. Here are the lines I've
added:

#
# start the NCSA HHTP server
#
if [ -f /usr/local/etc/httpd/httpd ]; then
        /usr/local/etc/httpd/httpd; echo 'Starting HTTPd.'
fi

I've added these lines before the invocation of ldconfig right near the
end of the file.

Regards,

Craig.
--

             The Core Matrix Foundation - Fighting for Net.Freedom
 "It is without question that planning should be for the long term. Not for the
     next day, but for the next millenium. Otherwise we shall not survive."

 
 
 

How to run HTTPD on boot ?

Post by Damon Gre » Tue, 21 Nov 1995 04:00:00



>Ok, I run a small network of Sun-3 machines on my local network, and I
>start httpd at boot time from /etc/rc.local. Here are the lines I've
>added:
>#
># start the NCSA HHTP server
>#
>if [ -f /usr/local/etc/httpd/httpd ]; then
>    /usr/local/etc/httpd/httpd; echo 'Starting HTTPd.'
>fi
>I've added these lines before the invocation of ldconfig right near the
>end of the file.
>Regards,
>Craig.

Thanks Craig, If only it was that simple, Solaris Doesn't have
rc.local. Sun have managed to over complicate that. It now seems to
consist of about ten files and I can't figure out in which file to
start the server.

Nice Try :-)

R&R
damon.

 
 
 

How to run HTTPD on boot ?

Post by Michael Bradfo » Wed, 22 Nov 1995 04:00:00



>If only it was that simple, Solaris Doesn't have
>rc.local. Sun have managed to over complicate that. It now seems to
>consist of about ten files and I can't figure out in which file to
>start the server.

As I remember, Solaris has a directory /etc/rc3.d in which you can
place site specifici bits used at start-up. An alternative is to place
the file in /etc/rc2.d so that it is executed last. This is done by
giving it a name like S99HTTPD. The "S" must be uppercase and the rest
doesn't matter. The init program processes the files in this directory
in alphanumeric sequence.

Also it must be remembered that when the system is rebuilt, you will
lose this file and have to recreate it.

Hope this helps

Michael Bradford
Diatel A/S

 
 
 

How to run HTTPD on boot ?

Post by Damon Gre » Thu, 23 Nov 1995 04:00:00


Many thanks to Ken and Michael.
HTTPD now runs on re-boot.
cheers !

R&R
damon.

 
 
 

How to run HTTPD on boot ?

Post by Joyce P. Won » Thu, 23 Nov 1995 04:00:00


Quote:>Thanks Craig, If only it was that simple, Solaris Doesn't have
>rc.local. Sun have managed to over complicate that. It now seems to
>consist of about ten files and I can't figure out in which file to
>start the server.

>Nice Try :-)

>R&R
>damon.

Do you have a file in your rc.d directory called "rc.inet2"?
if so, add these lines to the file:

# # Start the HTTPD server.
# # modify if necessary for your particular configuration.
if [ -f ${HTTPD} ]; then
   echo -n " httpd"
   ${HTTPD} -d /usr/local/httpd
fi

rc.inet2 is just a list of daemons and stuff you want to start
up at boot time.

hope this helps.  good luck!

-joyce

 
 
 

How to run HTTPD on boot ?

Post by Paul G. Lerou » Sun, 26 Nov 1995 04:00:00




>>We have a SPARC 5 running Solaris 2.4 / SunOS 5.4.
>>I wish to have httpd started each time the system is booted. I have root privs. Where should I be looking ?
>>I have tried various methods (inetd etc) but am now lost for alternatives.
>>any help appreciated.

>Ok, I run a small network of Sun-3 machines on my local network, and I
>start httpd at boot time from /etc/rc.local. Here are the lines I've
>added:

>#
># start the NCSA HHTP server
>#
>if [ -f /usr/local/etc/httpd/httpd ]; then
>    /usr/local/etc/httpd/httpd; echo 'Starting HTTPd.'
>fi

>I've added these lines before the invocation of ldconfig right near the
>end of the file.

>Regards,

>Craig.
>--

>             The Core Matrix Foundation - Fighting for Net.Freedom
> "It is without question that planning should be for the long term. Not for the
>     next day, but for the next millenium. Otherwise we shall not survive."

 
 
 

How to run HTTPD on boot ?

Post by R » Sun, 03 Dec 1995 04:00:00


Quote:>>>We have a SPARC 5 running Solaris 2.4 / SunOS 5.4.
>>>I wish to have httpd started each time the system is booted. I have root

privs. Where should I be looking ?

Quote:>>>I have tried various methods (inetd etc) but am now lost for alternatives.
>>>any help appreciated.

On Solaris 2.4 try adding a file to the /etc/rc2.d directory and call it
something like "S98httpd" . The uppercase "S" is important since it's these
scripts that run at boot. The following script is what I use to start my
server automatically at boot.

#!/sbin/sh
#
#
# Return pid of named process in variable "pid"
#
#pidproc() {
#       pid=`/usr/bin/ps -e |
#               /usr/bin/grep  |
#               /usr/bin/sed -e 's/^  *//' -e 's/ .*//'`
#}

#
# Kill named process(es)
#
killproc() {
        pidproc $1
        [ "$pid" != "" ] && kill $pid

Quote:}

case "$1" in

'start')
        if [ -f /usr/local/etc/httpd/httpd ]; then
                echo "Starting Biology HTTPD  ...\n"
                /usr/local/etc/httpd/httpd -f
/usr/local/etc/httpd/conf/httpd.conf
        fi

        ;;
'stop')

        killproc httpd
        ;;

*)
        echo "Usage: /etc/rc2.d/S98httpd { start | stop }"
        ;;
esac
exit 0