?
Solved

urgent : automatic start the apache web server

Posted on 2001-09-06
4
Medium Priority
?
269 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
4 Comments
 
LVL 1

Expert Comment

by:filiep
ID: 6459889
0
 
LVL 1

Accepted Solution

by:
msnr earned 1200 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 21

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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

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…
Java performance on Solaris - Managing CPUs There are various resource controls in operating system which directly/indirectly influence the performance of application. one of the most important resource controls is "CPU".   In a multithreaded…
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.:
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.
Suggested Courses

770 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