Solved

urgent : automatic start the apache web server

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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

When you do backups in the Solaris Operating System, the file system must be inactive. Otherwise, the output may be inconsistent. A file system is inactive when it's unmounted or it's write-locked by the operating system. Although the fssnap utility…
Using libpcap/Jpcap to capture and send packets on Solaris version (10/11) Library used: 1.      Libpcap (http://www.tcpdump.org) Version 1.2 2.      Jpcap(http://netresearch.ics.uci.edu/kfujii/Jpcap/doc/index.html) Version 0.6 Prerequisite: 1.      GCC …
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…
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.:

829 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