Solved

urgent : automatic start the apache web server

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

VMware Disaster Recovery and Data Protection

In this expert guide, you’ll learn about the components of a Modern Data Center. You will use cases for the value-added capabilities of Veeam®, including combining backup and replication for VMware disaster recovery and using replication for data center migration.

Question has a verified solution.

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

Suggested Solutions

Hello fellow BSD lovers, I've created a patch process for patching openjdk6 for BSD (FreeBSD specifically), although I tried to keep all BSD versions in mind when creating my patch. Welcome to OpenJDK6 on BSD First let me start with a little …
Every server (virtual or physical) needs a console: and the console can be provided through hardware directly connected, software for remote connections, local connections, through a KVM, etc. This document explains the different types of consol…
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.:
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…

810 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