LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
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-12-2004, 01:00 PM   #1
tumana
Member
 
Registered: Mar 2004
Posts: 102

Rep: Reputation: 15
Getting Apache to run on bootup


Hi,

I am re-building my web server from scratch. Originally, I installed Mandrake 10.0, Apache, PHP, ... using the installation GUI. If the lights went out because of a storm or something , once the lights came back on all I had to do was push the power button and I would have a fully funcional web server again.

Well, the version of Apache and PHP that came on the Mandrake CDs is now old and I am re-building my server. I installed Mandrake from the CDs, but I left Apache and PHP to install later via downloaded source code.

After installed, they work great. Just like I expected. But if I power down/power up my server, Apache doesn't start automatically. I have to type something of the sort:
Code:
/usr/local/apache2/bin/apachectl start
I understand what that command line does, but why isn't httpd a service that automatically starts when all other things are initiated at bootup?

I also understand you can create a cron job that runs certain command lines at start up. Can someone give me some pointers on that?

Thanks,
ian
 
Old 10-12-2004, 01:09 PM   #2
shaynesweeney
LQ Newbie
 
Registered: Oct 2004
Posts: 3

Rep: Reputation: 0
Every (well, most) distros have different ways of doing this. If you are looking for a command line option .... you need to add this to the correct RC directory. Check the /etc/init.d/ folder for any apache program, this is your startup script ... if you do find one in there, you should be able to go to your /etc/rc.d/ (like) folder and create a symbolic link to the script.

EG: ln -s /etc/init.d/apachectrl /etc/rc.d/S99apache

This will/should start apache for you on boot...if there wasn't a startup script in there, you can check if you have an rc.local on your machine....I am pretty sure that is in /etc. Inside of this file, add the command, 'apachectl start' your system will run the command on boot.

If this doesn't help ... google this: "Mandrake XX rc scripts" XX being your version of mandrake you are running.

Hope this was a little insight.

** not httpd is also the service name for apache **
 
Old 10-12-2004, 01:09 PM   #3
guitarman85281
Member
 
Registered: Aug 2004
Location: Tempe, Arizona
Distribution: RedHat 9, SuSE 9.1, Fedora Core 4, Gentoo
Posts: 52

Rep: Reputation: 15
Greetings
the 'chkconfig' command is used to start programs at startup. THe command you would want would be 'chkconfig --level 345 httpd on'
Keep in mind that '--level' and it's subsequent 345 are telling the service to start on runlevels 3, 4 and 5. You may need to change this for your use.
 
Old 10-12-2004, 03:03 PM   #4
tumana
Member
 
Registered: Mar 2004
Posts: 102

Original Poster
Rep: Reputation: 15
I tried the chkconfig command-line tool because its man page says it is a "comman-line tool for maintaining the /etc/rc[0-6].d directory hierarchy". That's what I need!

I typed in what guitarman suggested and it gave me the following error:
Code:
error reading information on service httpd: No such file or directory
As guitarman suggested, I might have to change the options for my use. I tried substituting httpd for apachectl but nothing. I know apachectl is in my PATH because I've tested it before.

I'm going to try shaynesweeney's suggestion, but does anybody have suggestions on how to use the chkconfig command?

Thanks,
ian
 
  


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
linux 102. run cmd @ bootup bonito SUSE / openSUSE 7 03-30-2005 09:43 AM
re-run DHCP after bootup? azwr Linux - Wireless Networking 3 06-19-2004 11:13 AM
Auto run at bootup irfan44 Linux - Software 6 05-21-2004 08:44 AM
How do i make scripts run at bootup and shutdown? BajaNick Linux - General 2 08-11-2003 08:37 PM
starting apache at bootup softgun Debian 11 08-05-2003 07:17 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 11:33 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