LinuxQuestions.org
Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
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, 01: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, 04: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, 04: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-16-2002, 12:07 AM   #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 10:52 AM.
 
Old 06-16-2002, 07: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, 07:25 AM   #6
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976
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


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

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

All times are GMT -5. The time now is 09:13 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration