Solved

urgent : automatic start the apache web server

Posted on 2001-09-06
4
261 Views
Last Modified: 2013-12-27
hi

i'm using apache as a web server in solaris. every time i reboot the server, i have to start the apache web server manually via a executable file which is located at /opt/apache/bin/httpd.

so, what command should i add to the profile file so when i reboot the server, the apache web server will start automatically.

thanks n best regards
brandon
0
Comment
Question by:brandonngst
4 Comments
 
LVL 1

Expert Comment

by:filiep
ID: 6459889
0
 
LVL 1

Accepted Solution

by:
msnr earned 300 total points
ID: 6460191
Save the following script as any file starting with S.
for ex  S89httpd.
and reboot ur machine.

Give the exact location of ur apache where it is installed
to HTTPDHOME.  if it is not /usr/local/apache.





#!/bin/sh

#  httpd_init -- rc2.d file to start the httpd
#
# Copyright (C) 1996, by SunService, Sun Microsystems Inc.
#
# THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF SUN MICROSYSTEMS.
# The copyright notice above does not evidence any actual or
# intended publication of such source code.
#
# "@(#)httpd_init       4.2  05/06/97 SunService"

HTTPDHOME=/usr/local/apache

case $1 in
'start')
        if [ -f $HTTPDHOME/httpd ]; then
                echo "starting httpd..."
                $HTTPDHOME/httpd -d $HTTPDHOME
        fi

        ;;
'stop')
        if [ -f $HTTPDHOME/logs/httpd.pid ]; then
                echo "stopping httpd..."
                kill -TERM `cat $HTTPDHOME/logs/httpd.pid`
        fi
        ;;
'hup')
        if [ -f $HTTPDHOME/logs/httpd.pid ]; then
                echo "hup'ing httpd..."
                kill -HUP `cat $HTTPDHOME/logs/httpd.pid`
        fi
        ;;
*)
        echo "usage: /etc/init.d/httpd_init {start|stop}"
        ;;
esac
0
 
LVL 20

Expert Comment

by:tfewster
ID: 8003193
No comment has been added lately, so it's time to clean up this Topic Area.
I will leave a recommendation for this question in the Cleanup topic area as follows:

- Answered by msnr

Please leave any comments here within the next 7 days

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER !

tfewster
Cleanup Volunteer
0
 

Expert Comment

by:SpideyMod
ID: 8065739
per recommendation

SpideyMod
Community Support Moderator @Experts Exchange
0

Featured Post

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

My previous tech tip, Installing the Solaris OS From the Flash Archive On a Tape (http://www.experts-exchange.com/articles/OS/Unix/Solaris/Installing-the-Solaris-OS-From-the-Flash-Archive-on-a-Tape.html), discussed installing the Solaris Operating S…
Installing FreeBSD… FreeBSD is a darling of an operating system. The stability and usability make it a clear choice for servers and desktops (for the cunning). Savvy?  The Ports collection makes available every popular FOSS application and packag…
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
In a previous video, we went over how to export a DynamoDB table into Amazon S3.  In this video, we show how to load the export from S3 into a DynamoDB table.

747 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now