LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian
User Name
Password
Debian This forum is for the discussion of Debian Linux.

Notices


Reply
  Search this Thread
Old 07-16-2003, 09:17 AM   #1
softgun
Member
 
Registered: Jun 2003
Posts: 119

Rep: Reputation: 15
starting apache at bootup


Hi,
Sorry if this is repetitive. But I have tried things and it does not work for me. I have to manually start up whenever I re boot.

I made a file called S61apache.sh in the /etc/rcS.d

and put in
ln -s ../init.d/apache /etc/rcS.d/S61apache.sh

But Apache does not start at bootup

Anything wrong in what I have done?
 
Old 07-16-2003, 09:46 AM   #2
pep0
LQ Newbie
 
Registered: Jul 2003
Location: UK
Distribution: Debian 3.0 woody
Posts: 1

Rep: Reputation: 0
Hi!!

There's no need to create an startup script for apache. apachectl can take the startup parameters (start, stop...), so you just need to copy this script to your init folder and the create a symbolic link to this file...
Follow you'll find how to do it...

[root@MARS bin]# cp /usr/local/apache/bin/apachectl /etc/init.d/apache
[root@MARS bin]# ln -s /etc/init.d/apache /etc/rc2.d/S99apache

note that if you want apache to start in another level different than 2, you'll have to create the symbolic link there as well...

Hope this helps...

pep0.
 
Old 07-19-2003, 03:00 PM   #3
naflan
Member
 
Registered: May 2003
Location: NC, USA
Distribution: Slackware 14.0
Posts: 94

Rep: Reputation: 15
Make sure that ../init.d/apache /etc/rcS.d/S61apache.sh is executable. chmod 755 S61apache.sh
 
Old 07-23-2003, 01:09 PM   #4
softgun
Member
 
Registered: Jun 2003
Posts: 119

Original Poster
Rep: Reputation: 15
Sorry for the delay! Thanks all. I got Apache to start at boot by
doing (as root)
ln -s /etc/init.d/apache /etc/rcS.d/S77apache
 
Old 07-24-2003, 03:07 AM   #5
Strike
Member
 
Registered: Jun 2001
Location: Houston, TX, USA
Distribution: Debian
Posts: 569

Rep: Reputation: 31
For starters, the apache package installs its own startup script AND sets itself up to start on boot by default. If you don't want it to start on boot, then there's rarely any point in having it installed, so either remove it or follow my note below to figure out how to disable a startup script without effing with much.

Just a note for everyone. SysV init sucks to configure by hand. Really it does. Don't get me wrong, I love SysV init for its power, but it flat out sucks in a lot of ways. Luckily, Debian developers hated it too and made it so that you pretty much never have to deal with symlinks when updating runlevels.

Here's a quick tutorial.

What you can and should mess with: /etc/init.d (creating your own scripts that go in there and potentially moving existing ones), update-rc.d, and .. that's it

What you absolutely shouldn't mess with: /etc/rc*, symlinks, editing anything in /etc/init.d

The bottom line is, learn update-rc.d, it's dead simple. The short version of the update-rc.d man page (without all the syntax details, just the synopsis of what it is) is: sets up start/kill symlinks at whatever number/level (Default: 20) you want for any script that's in /etc/init.d

So, if you want to stop a startup script from running, and you don't want to eff with everything (and you don't want to remove the package, and there's no debconf question "do you want to run foo on boot?"), then here's what you do (we'll pretend the script is /etc/init.d/foo:
1. mv /etc/init.d/foo /etc/init.d/foo-disabled
2. update-rc.d -n foo remove > /etc/init.d/foo-oldrunlevels
3. update-rc.d foo remove

The first one just moves the old script out of the way so you can put it back in case you want to remove the package. The second one stores what runlevels it used to be installed in in a file. The third one actually removes all the symlinks in the runlevels.
 
Old 07-24-2003, 08:53 AM   #6
softgun
Member
 
Registered: Jun 2003
Posts: 119

Original Poster
Rep: Reputation: 15
>For starters, the apache package installs its own startup script AND sets itself up to start on boot by default.

Well it didn't in my Knoppix install of Debian
Now it does after the link
 
Old 07-24-2003, 12:26 PM   #7
Strike
Member
 
Registered: Jun 2001
Location: Houston, TX, USA
Distribution: Debian
Posts: 569

Rep: Reputation: 31
Quote:
Originally posted by softgun
>For starters, the apache package installs its own startup script AND sets itself up to start on boot by default.

Well it didn't in my Knoppix install of Debian
Now it does after the link
Is the apache package off of the Knoppix CD itself? If not, where did you get it? (or did you install it some other way?)
 
Old 07-25-2003, 09:00 AM   #8
softgun
Member
 
Registered: Jun 2003
Posts: 119

Original Poster
Rep: Reputation: 15
Yes it is off the Knopix CD. I am now going over to Mepis starting next week. HopefullyApache wiill start at boot in that.
 
Old 07-25-2003, 01:03 PM   #9
Strike
Member
 
Registered: Jun 2001
Location: Houston, TX, USA
Distribution: Debian
Posts: 569

Rep: Reputation: 31
If their apache package doesn't install its own startup script and set itself to boot on start by default, I would consider it a bug and report it to the knoppix maintainer. Perhaps they have good reasons for this, perhaps not.

Also, if this is a knoppix CD to hard drive install, stop right now and install from the official Debian CDs. The knoppic hard drive install, while convenient and functional for a static system, has a sucky upgrade path. Incredibly annoying to deal with. Just use vanilla Debian CDs if this is the case.
 
Old 08-01-2003, 01:44 PM   #10
softgun
Member
 
Registered: Jun 2003
Posts: 119

Original Poster
Rep: Reputation: 15
Official Debian CDs

The trouble is Official Debain CDs like Woody are OLD! Is the First ISO of the Official or Unofficial Sarge distribution useable?
I will certainly go for it if someone says that it installs without driving me up a tree
On the other hand can I download a upgrade CD from Woody to Sarge on the first ISO? Does it upgrade the kernal?
 
Old 08-05-2003, 02:14 AM   #11
reidsb
LQ Newbie
 
Registered: Aug 2003
Posts: 5

Rep: Reputation: 0
I just grabbed the newest stable version of Apache2 and it has the exact same problem, for some reason. There is some kind of bug then.
 
Old 08-05-2003, 08:17 AM   #12
softgun
Member
 
Registered: Jun 2003
Posts: 119

Original Poster
Rep: Reputation: 15
On the other hand, after a basic Debian Woody install and apt-get install apache from the CDROM - Apache works nicely and boots at startup. Indeed Zope too and postgresql all work nicely at startup.
Only problem is X -does not work
 
  


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
starting programs on bootup mantonr Linux - Newbie 2 05-30-2005 10:07 AM
daemons starting on bootup papajohns AIX 4 08-04-2004 02:27 PM
Starting services at bootup Lucasite Linux - Newbie 5 04-17-2004 03:08 PM
starting programs at bootup tcm_va Linux - Newbie 5 02-08-2003 09:30 PM
help starting xscreensaver at bootup rose_bud4201 Linux - Software 2 01-10-2003 07:25 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian

All times are GMT -5. The time now is 06:00 AM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration