LinuxQuestions.org
View the Most Wanted LQ Wiki articles.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices

Reply
 
Search this Thread
Old 10-28-2003, 07:08 AM   #1
eye
Member
 
Registered: May 2003
Distribution: fedora 1
Posts: 137

Rep: Reputation: 15
how to start automatically apache server when boot-up?


redhat 9.0 used, apache.1.3.28 installed.
without type "apachectl start", manullay... how to it automatically??

Last edited by eye; 10-28-2003 at 09:18 AM.
 
Old 10-28-2003, 07:19 AM   #2
hw-tph
Senior Member
 
Registered: Sep 2003
Location: Sweden
Distribution: Debian
Posts: 3,032

Rep: Reputation: 57
Use the RedHat service config program. It used to be accessible by typing setup at a shell prompt (as root, of course). I haven't used RedHat in a while but that worked fine with 6.x and 7.x - you'll get a little curses-based program where you can check the services you want to be enabled on boot.

Or use chkconfig httpd on .

Håkan

Last edited by hw-tph; 10-28-2003 at 07:20 AM.
 
Old 10-28-2003, 08:27 AM   #3
dkloes
Member
 
Registered: Oct 2003
Posts: 66

Rep: Reputation: 15
The ntsysv command can be used to identify services that you want to start automatically. Select httpd.
 
Old 10-28-2003, 09:15 AM   #4
Skyline
Senior Member
 
Registered: Jun 2003
Distribution: Debian/other
Posts: 2,104

Rep: Reputation: 45
........ and if you only want it to start at a particular run level then use this "syntax"

chkconfig --level 3 httpd on

etc
 
Old 10-28-2003, 09:32 AM   #5
eye
Member
 
Registered: May 2003
Distribution: fedora 1
Posts: 137

Original Poster
Rep: Reputation: 15
what's wrong?

[root@localhost sbin]# chkconfig --list
kudzu 0:OFF 1:OFF 2:OFF 3:ON 4:ON 5:ON 6:OFF
syslog 0:OFF 1:OFF 2:ON 3:ON 4:ON 5:OFF 6:OFF
netfs 0:OFF 1:OFF 2:OFF 3:ON 4:ON 5:ON 6:OFF
network 0:OFF 1:OFF 2:ON 3:ON 4:ON 5:ON 6:OFF
random 0:OFF 1:OFF 2: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F
firstboot 0:OFF 1:OFF 2:OFF 3:OFF 4:OFF 5:OFF 6:OFF
lisa 0:OFF 1:OFF 2:OFF 3:OFF 4:OFF 5:OFF 6:OFF
lircd 0:OFF 1:OFF 2:OFF 3:OFF 4:OFF 5:OFF 6:OFF
xinetd based services:
chargen-udp: OFF
rsync: OFF
chargen: OFF
daytime-udp: OFF
daytime: OFF
echo-udp: OFF
echo: OFF
services: OFF
servers: OFF
time-udp: OFF
time: OFF
cups-lpd: OFF
sgi_fam: OFF
ktalk: OFF

[root@localhost sbin]# chkconfig httpd on
error reading information on service httpd: No such file or directory

ran ntsysv at shell prompt . httpd service not exsit at ntsysv screen

Last edited by eye; 10-28-2003 at 09:43 AM.
 
Old 10-28-2003, 09:44 AM   #6
dkloes
Member
 
Registered: Oct 2003
Posts: 66

Rep: Reputation: 15
If you install normal http from the installation CDs, in RH9 the name has changed to httpd - it used to be apache. Was the apache RPM installed from CD or downloaded? If downloaded, it may be called something else. Is there a httpd file in /etc/rc.d/init.d?
 
Old 10-28-2003, 10:23 AM   #7
eye
Member
 
Registered: May 2003
Distribution: fedora 1
Posts: 137

Original Poster
Rep: Reputation: 15
apache.1.3.28.tar.gz file downloaded... when install apache1.3.28, installed to DSO way.
when install php, dso module way installed
not exist httpd file in /etc/rc.d/init.d.......

Last edited by eye; 10-28-2003 at 10:25 AM.
 
Old 10-28-2003, 01:22 PM   #8
dkloes
Member
 
Registered: Oct 2003
Posts: 66

Rep: Reputation: 15
Looks like you need to put a script in /etc/rc.d/init.d
Even though you are using 1.3.28, the following info applies http://httpd.apache.org/docs-2.0/invoking.html#boot
Here is the normal script. Just make sure the paths are correct or you can write your own script.

#!/bin/bash
#
# Startup script for the Apache Web Server
#
# chkconfig: - 85 15
# description: Apache is a World Wide Web server. It is used to serve \
# HTML files and CGI.
# processname: httpd
# pidfile: /var/run/httpd.pid
# config: /etc/httpd/conf/httpd.conf

# Source function library.
. /etc/rc.d/init.d/functions

if [ -f /etc/sysconfig/httpd ]; then
. /etc/sysconfig/httpd
fi

# This will prevent initlog from swallowing up a pass-phrase prompt if
# mod_ssl needs a pass-phrase from the user.
INITLOG_ARGS=""

# Set HTTPD=/usr/sbin/httpd.worker in /etc/sysconfig/httpd to use a server
# with the thread-based "worker" MPM; BE WARNED that some modules may not
# work correctly with a thread-based MPM; notably PHP will refuse to start.

# Path to the apachectl script, server binary, and short-form for messages.
apachectl=/usr/sbin/apachectl
httpd=${HTTPD-/usr/sbin/httpd}
prog=httpd
RETVAL=0

# check for 1.3 configuration
check13 () {
CONFFILE=/etc/httpd/conf/httpd.conf
GONE="(ServerType|BindAddress|Port|AddModule|ClearModuleList|"
GONE="${GONE}AgentLog|RefererLog|RefererIgnore|FancyIndexing|"
GONE="${GONE}AccessConfig|ResourceConfig)"
if grep -Eiq "^[[:space:]]*($GONE)" $CONFFILE; then
echo
echo 1>&2 " Apache 1.3 configuration directives found"
echo 1>&2 " please read /usr/share/doc/httpd-2.0.40/migration.html"
failure "Apache 1.3 config directives test"
echo
exit 1
fi
}

# The semantics of these two functions differ from the way apachectl does
# things -- attempting to start while running is a failure, and shutdown
# when not running is also a failure. So we just do it the way init scripts
# are expected to behave here.
start() {
echo -n $"Starting $prog: "
check13 || exit 1
daemon $httpd $OPTIONS
RETVAL=$?
echo
[ $RETVAL = 0 ] && touch /var/lock/subsys/httpd
return $RETVAL
}
stop() {
echo -n $"Stopping $prog: "
killproc $httpd
RETVAL=$?
echo
[ $RETVAL = 0 ] && rm -f /var/lock/subsys/httpd /var/run/httpd.pid
}
reload() {
echo -n $"Reloading $prog: "
check13 || exit 1
killproc $httpd -HUP
RETVAL=$?
echo
}

# See how we were called.
case "$1" in
start)
start
;;
stop)
stop
;;
status)
status $httpd
RETVAL=$?
;;
restart)
stop
start
;;
condrestart)
if [ -f /var/run/httpd.pid ] ; then
stop
start
fi
;;
reload)
reload
;;
graceful|help|configtest|fullstatus)
$apachectl $@
RETVAL=$?
;;
*)
echo $"Usage: $prog {start|stop|restart|condrestart|reload|status|fullstatus|graceful|help|configtest}"
exit 1
esac

exit $RETVAL
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Start a server automatically? timmyk0 Linux - General 8 06-24-2006 02:58 AM
How do I start dhclient automatically at boot-up? moonmoth Linux - Networking 4 07-17-2005 04:15 AM
dhcp won't start automatically on boot blk96gt Slackware 5 01-24-2005 01:42 PM
How do I start a program automatically when I boot up? bad_andy Mandriva 2 11-27-2004 08:15 PM
How do I start programs automatically with boot up? Kasperisa Linux - Newbie 6 07-15-2004 03:29 PM


All times are GMT -5. The time now is 12:05 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration