The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.
|
 |
|
Dev Shed Forums
> Operating Systems
> BSD Help
|
how do I get apache to start at boot up?
Discuss how do I get apache to start at boot up? in the BSD Help forum on Dev Shed. how do I get apache to start at boot up? BSD Help forum discussing all BSD based operating systems including FreeBSD, OpenBSD, NetBSD, and more. BSD refers to the distribution of UNIX originally developed by the University of California at Berkeley.
|
|
 |
|
|
|
|

Dev Shed Forums Sponsor:
|
|
|

December 11th, 2001, 11:44 PM
|
|
Junior Member
|
|
Join Date: Dec 2001
Location: Baltimore Md.
Posts: 8
Time spent in forums: < 1 sec
Reputation Power: 0
|
|
|
how do I get apache to start at boot up?
How do I get apache to start at bootup. All the documentation that I've read said to put a script in /usr/local/etc , but there is no usr/local/etc . Also, what is the script supposed to look like?
|

December 12th, 2001, 12:02 AM
|
|
Contributing User
|
|
Join Date: Jan 2001
Posts: 5
Time spent in forums: < 1 sec
Reputation Power: 0
|
|
|
/usr/local/etc/rc.d/apache.sh
/usr/local/etc/rc.d will be searched on startup by default. Check /etc/defaults/rc.conf, you should see local_startup="/usr/local/etc/rc.d /usr/X11R6/etc/rc.d".
|

December 12th, 2001, 12:31 AM
|
|
Junior Member
|
|
Join Date: Dec 2001
Location: Baltimore Md.
Posts: 8
Time spent in forums: < 1 sec
Reputation Power: 0
|
|
|
So I'm supposed to create the directory /usr/local/etc , then create a rc.d file with the text apache.sh ? Am I missing something here? I did this, rebooted, and apache didn't start, I had to manually start it. Sorry for seeming so thickheaded, but I'm new to freebsd and trying to get a server up and running.
|

December 12th, 2001, 02:11 AM
|
|
Contributing User
|
|
Join Date: Jan 2001
Posts: 5
Time spent in forums: < 1 sec
Reputation Power: 0
|
|
|
>> So I'm supposed to create the directory /usr/local/etc
No. If you installed Apache via packages (precompiled binary) or from the ports collection at /usr/ports/www/apache13, it will mkdir the /usr/local/etc and rc.d directories for you automatically. apache.sh will also be copied from /usr/ports/www/apache/files/apache.sh to /usr/local/etc/rc.d.
|

December 12th, 2001, 06:32 AM
|
|
Junior Member
|
|
Join Date: Dec 2001
Location: Baltimore Md.
Posts: 8
Time spent in forums: < 1 sec
Reputation Power: 0
|
|
|
There is no /usr/local/etc directory, it does not exist........once I create it and the and the rc.d document, what will be on the rc.d document? Thank you for your help and patience with this newbie.
|

December 12th, 2001, 09:49 AM
|
|
Contributing User
|
|
Join Date: Jan 2001
Posts: 5
Time spent in forums: < 1 sec
Reputation Power: 0
|
|
|
rc.d is a subdir under /usr/local/etc. If it doesn't already exists, mkdir it manually.
|

December 12th, 2001, 10:01 AM
|
|
Junior Member
|
|
Join Date: Dec 2001
Location: Baltimore Md.
Posts: 8
Time spent in forums: < 1 sec
Reputation Power: 0
|
|
|
Then what goes into this rc.d directory?
|

December 12th, 2001, 10:05 AM
|
|
Contributing User
|
|
Join Date: Jan 2001
Posts: 5
Time spent in forums: < 1 sec
Reputation Power: 0
|
|
|
Read this entire thread again. Whatever local scripts that need to startup automatically on boot.
|

December 12th, 2001, 10:23 AM
|
|
Junior Member
|
|
Join Date: Dec 2001
Location: Baltimore Md.
Posts: 8
Time spent in forums: < 1 sec
Reputation Power: 0
|
|
|
What do I put in the script that goes into /usr/local/etc/rc.d ?
If I just put "/usr/local/apache/bin/apachectl start" will that make it start at bootup, and what do I name the file?
|

December 12th, 2001, 01:48 PM
|
|
Junior Member
|
|
Join Date: Nov 2001
Location: Denmark, Europe
Posts: 15
Time spent in forums: < 1 sec
Reputation Power: 0
|
|
|
I start my Apache another way on boot up, but not as fancy as the rc.d way. in /etc/rc.local i have added /usr/local/apache/bin/apachectl start . it may not be the correct way but anyway it works.
|

December 12th, 2001, 08:17 PM
|
|
Contributing User
|
|
Join Date: Jan 2001
Posts: 5
Time spent in forums: < 1 sec
Reputation Power: 0
|
|
|
>> What do I put in the script that goes into /usr/local/etc/rc.d ?
The script apache.sh can be found from /usr/ports/www/apache13/files/, I already mentioned this previously. So you can copy it to /usr/local/etc/rc.d/ and alter it to your liking.
>> If I just put "/usr/local/apache/bin/apachectl start" will that make it start at bootup
Yes if the script is executable. However, a proper boot script expects more than just start option. At the minimum, you need start and stop. Unless you don't want Apache to shutdown gracefully.
Further, you are on FreeBSD, and apachectl should never be resided in a non-standard location, which violates FreeBSD directory layout [hier(7)]. Further, apachectl script should never go into bin directory, it should be sbin instead, for security reasons.
What you should do now is to remove your existing Apache and reinstall it from ports. Setting PREFIX of /usr/local/apache is extremely bad and non-standard. If you want to become a real FreeBSD user, follow the standard.
|

December 13th, 2001, 06:43 AM
|
|
Junior Member
|
|
Join Date: Dec 2001
Location: Baltimore Md.
Posts: 8
Time spent in forums: < 1 sec
Reputation Power: 0
|
|
|
Thanks for helping me out, I'll reinstall apache into the proper location.
Wilbo
|
Developer Shed Advertisers and Affiliates
| Thread Tools |
Search this Thread |
|
|
|
| Display Modes |
Rate This Thread |
Linear Mode
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
|