LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 06-14-2002, 12:50 PM   #1
boyinfrance
Member
 
Registered: May 2002
Location: France
Distribution: Mdk 9.0
Posts: 35

Rep: Reputation: 15
Question Script for Apache on Boot


I know this is a stupid question but I am a and don't know how.

Ok.

How would I create a script to start apache on boot?
I installed it from source to

/usr/local/apache2

Help!
 
Old 06-14-2002, 03:03 PM   #2
sewer_monkey
Member
 
Registered: May 2002
Location: Toronto, ON, Canada
Distribution: Ubuntu, Debian, RedHat/CentOS
Posts: 624

Rep: Reputation: 31
Why from source? If you installed from RPM (you're using Mandrake, right?), you wouldn't have to write a script... To find RPMs, go here.

In your current situation, you can try (as root) the command "apachectl start". If you want this to happen at boottime, add the command to /etc/rc.local, somewhere at the bottom of that file.
 
Old 06-15-2002, 03:40 AM   #3
pk21
Member
 
Registered: Jun 2002
Location: Netherlands - Amsterdam
Distribution: RedHat 9
Posts: 549

Rep: Reputation: 30
Lightbulb

Or you can always modify the crontab file.
 
Old 06-15-2002, 11:07 PM   #4
neo77777
LQ Addict
 
Registered: Dec 2001
Location: Brooklyn, NY
Distribution: *NIX
Posts: 3,704

Rep: Reputation: 56
you need a symlink in /etc/rc?.d
? - is for runlevel you are booting into
the symlink is
ln -s /usr/local/apache2/bin/apachectl /etc/rc?.d/S15httpd
and another similar link in /etc/rc6.d to shutdown apache properly on system reboot
ln -s /usr/local/apache2/bin/apachectl /etc/rc6.d/K15httpd
here 15 is a sequence number, see in /etc/rc?.d/ directory if it is not taken by anything else if it is taken pick the one which is not yet taken. The same in rcd.0 on system shutdown

Last edited by neo77777; 08-02-2002 at 09:52 AM.
 
Old 06-16-2002, 06:19 AM   #5
boyinfrance
Member
 
Registered: May 2002
Location: France
Distribution: Mdk 9.0
Posts: 35

Original Poster
Rep: Reputation: 15
All I want is a one liner to start apache. The problem is I want to go into su and start apache with just one line and I can't figure out how.
Help!?!
 
Old 06-16-2002, 06:25 AM   #6
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
neo7777 has the CORRECT way to do it, but if you really want to do it your way, i.e. the WRONG way, you'd just put a line in /etc/rc.local, which is run with root permissions on boot.
 
  


Reply



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
Apache executing Java Script linux_pioneer Solaris / OpenSolaris 2 08-26-2004 12:31 PM
Script is not executing in Apache!!! linux_child001 Linux - Newbie 1 06-22-2004 05:10 AM
Stop boot script at boot time!! kmiles2 Linux - Newbie 1 02-23-2004 10:04 PM
Apache cgi-script problem palanisaravanan Linux - General 6 02-07-2004 09:41 AM
apache problems with a Php script kudos Linux - Software 2 09-23-2003 04:54 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 11:57 PM.

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