#1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2001
    Location
    Baltimore Md.
    Posts
    8
    Rep 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?
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jan 2001
    Posts
    4
    Rep 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".
  4. #3
  5. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2001
    Location
    Baltimore Md.
    Posts
    8
    Rep 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.
  6. #4
  7. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jan 2001
    Posts
    4
    Rep 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.
  8. #5
  9. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2001
    Location
    Baltimore Md.
    Posts
    8
    Rep 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.
  10. #6
  11. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jan 2001
    Posts
    4
    Rep Power
    0
    rc.d is a subdir under /usr/local/etc. If it doesn't already exists, mkdir it manually.
  12. #7
  13. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2001
    Location
    Baltimore Md.
    Posts
    8
    Rep Power
    0
    Then what goes into this rc.d directory?
  14. #8
  15. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jan 2001
    Posts
    4
    Rep Power
    0
    Read this entire thread again. Whatever local scripts that need to startup automatically on boot.
  16. #9
  17. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2001
    Location
    Baltimore Md.
    Posts
    8
    Rep 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?
  18. #10
  19. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2001
    Location
    Denmark, Europe
    Posts
    15
    Rep 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.
  20. #11
  21. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jan 2001
    Posts
    4
    Rep 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.
  22. #12
  23. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2001
    Location
    Baltimore Md.
    Posts
    8
    Rep Power
    0
    Thanks for helping me out, I'll reinstall apache into the proper location.

    Wilbo

IMN logo majestic logo threadwatch logo seochat tools logo