Solved

urgent : automatic start the apache web server

Posted on 2001-09-06
4
262 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Attention: This article will no longer be maintained. If you have any questions, please feel free to mail me. jgh@FreeBSD.org Please see http://www.freebsd.org/doc/en_US.ISO8859-1/articles/freebsd-update-server/ for the updated article. It is avail…
Introduction Regular patching is part of a system administrator's tasks. However, many patches require that the system be in single-user mode before they can be installed. A cluster patch in particular can take quite a while to apply if the machine…
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
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.

861 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

22 Experts available now in Live!

Get 1:1 Help Now