Forum Moderators: bakedjake

Message Too Old, No Replies

FreeBSD and Apache on startup

         

shell

11:20 pm on Jul 30, 2003 (gmt 0)

10+ Year Member



New to FreeBSD so please excuse my lack of knowledge yet ;)

Got Apache installed..
I can start it with /usr/local/apache/bin/apachectl start..
But how on earth do I get this (Apache to start) to happen at startup? Been looking at this rc stuff and still don't have Apache start automatically on boot :(

Thank you

bakedjake

11:33 pm on Jul 30, 2003 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



Did you install from packages, ports, or source tarball?

shell

11:50 pm on Jul 30, 2003 (gmt 0)

10+ Year Member



tarball I think.. what ever the "main" download is on httpd.apache.org (wasn't freebsd specific.. just system type specific.tar.gz)

bcc1234

11:51 pm on Jul 30, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Place a startup script into /usr/local/etc/rc.d

The file name has to end with .sh and the executable bit must be set.

If I were you, I would remove it and reinstall from ports. That way all that stuff will be created for you.

bakedjake

11:57 pm on Jul 30, 2003 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



Quick, simple, stupid, wrong (but works) answer:

Insert the line


/usr/local/apache/bin/apachectl start

into /etc/rc.local.

Correct answer:

Delete that apache you just installed, and install from ports. If you're not familiar with the FreeBSD ports system, look up the FreeBSD handbook in Google. The ports package will automagically install the startup script for you, and gives you the added advantage of following standard. Plus, you'll be happier if you ever want to upgrade.

One of the three coolest things about the FreeBSD system is the ports collection, IMHO. It is your best friend. Learn it!

shell

12:00 am on Jul 31, 2003 (gmt 0)

10+ Year Member



OKay.. will go the ports way :)
What's the best way of getting rid of the current 'wrong' apache?

bakedjake

12:01 am on Jul 31, 2003 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



# rm -Rf /usr/local/apache

shell

12:20 am on Jul 31, 2003 (gmt 0)

10+ Year Member



A mostly windows user here ;)

shell

1:01 am on Jul 31, 2003 (gmt 0)

10+ Year Member



I've installed the port.. a few questions:

- What's the best/recommended way of upgrading?
- Where does Apache httpd.conf etc get put by default when installing off a port? (Can I find it? lol)

bcc1234

1:17 am on Jul 31, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



- The best way to upgrate is to reinstall. No matter what people say. Just make sure you save your old config files and libs that you are using.
- Apache configuration should be in /usr/local/etc/apache