LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Other *NIX Forums > *BSD
User Name
Password
*BSD This forum is for the discussion of all BSD variants.
FreeBSD, OpenBSD, NetBSD, etc.

Notices


Reply
  Search this Thread
Old 02-08-2005, 08:58 AM   #1
BizHat.com
Member
 
Registered: Jul 2004
Location: India
Distribution: RH, RHEL, CentOS
Posts: 46

Rep: Reputation: 15
Apache Service


Hi,

I have downloaded Apache source

httpd-2.0.52.tar.gz

and installed on my FreeBSD test server.

Installation went well just like on Linux.

Now i can start and stop Apache with

/usr/local/apache2/bin/apachectl

But can't use like

service httpd start|stop|status

Is that only available in Linux ?

How do i supposed to start and stop apache in FreeBSD ?

Also how to make Apache suto start ?

Regards,

Yujin
 
Old 02-08-2005, 09:05 AM   #2
drobert_bfm
LQ Newbie
 
Registered: Jan 2005
Posts: 7

Rep: Reputation: 0
"service" is really a RedHat command...

It really amounts to no more than a script for the init scripts. You can usually find the "service" script in /sbin; it should be pretty easy to replicate in FreeBSD (with which I have very little experience).
 
Old 02-08-2005, 09:50 AM   #3
BizHat.com
Member
 
Registered: Jul 2004
Location: India
Distribution: RH, RHEL, CentOS
Posts: 46

Original Poster
Rep: Reputation: 15
Thanks for the info. I am new to FreeBSD. Thinking of switching to FreeBSD as RH is now Paid and don't want to depend on Fedora or CentOS.

So in FreeBSD, i need to use

/usr/local/apache2/bin/apachectl stop|start

for stoping and starting apache ? Any other short cuts ?

Can u tell me how to make Apache auto start ? Now i have to login and start Apache manually.

Regards,

Yujin
 
Old 02-08-2005, 11:14 AM   #4
sigsegv
Senior Member
 
Registered: Nov 2004
Location: Third rock from the Sun
Distribution: NetBSD-2, FreeBSD-5.4, OpenBSD-3.[67], RHEL[34], OSX 10.4.1
Posts: 1,197

Rep: Reputation: 47
Without rewriting the handbook -- Here's the short answer. Most ports that have daemons place a startup script into /usr/local/etc/rc.d/<something>.sh

When the system is coming up, rc executes all the scripts in /usr/local/etc/rc.d/ that end in .sh. Fairly recently, a mechanism wa added so that you have to enable the daemons in /etc/rc.conf. You can find out what variables need to be set by running the script with the argument rcvar. So, for Apache, do this: /usr/local/etc/rc.d/apache2.sh rcvar. You should get something like this:
Code:
# apache2
$apache2_enable=YES
You need to place that in your rc.conf. Then your apache will start at boot time.

As for starting/stopping manually, you can either use apachectl or /usr/local/etc/rc.d/apache2.sh. The rc script is really just a wrapper around apachectl, so either one will work fine.
 
Old 02-08-2005, 12:24 PM   #5
BizHat.com
Member
 
Registered: Jul 2004
Location: India
Distribution: RH, RHEL, CentOS
Posts: 46

Original Poster
Rep: Reputation: 15
Thanks sigsegv for the help. Now got some idea. I have installed by compiling apache source from apache.org

I am supposed to install Apache with Ports ? If yes, how i do ? Will i able to configure ? Like

./configure --prefix=/usr/local/apache2 --enable-rewrite
 
Old 02-08-2005, 01:21 PM   #6
sigsegv
Senior Member
 
Registered: Nov 2004
Location: Third rock from the Sun
Distribution: NetBSD-2, FreeBSD-5.4, OpenBSD-3.[67], RHEL[34], OSX 10.4.1
Posts: 1,197

Rep: Reputation: 47
Read this and this.
 
Old 02-09-2005, 10:08 AM   #7
BizHat.com
Member
 
Registered: Jul 2004
Location: India
Distribution: RH, RHEL, CentOS
Posts: 46

Original Poster
Rep: Reputation: 15
Thanks for the links. I read both. But still can't get Apache installed in FreeBSD way.

First i removed the existing Apache

rm -rf /usr/local/apache2

that i installed from source.

My FreeBSD version is 5.2. Now i tryed sysinstall, but can't find apache on the CD, also tryed FTP site, but says release v5.2 not found on FTP server.

I go to

http://www.freebsd.org/ports/index.html

and searched apache-2

And downloaded

http://cvsweb.freebsd.org/ports/www/...r.gz?tarball=1

But this is a small file, 30 KB in size.

Can't find out how to install it.

Regards,

Yujin
 
Old 02-09-2005, 11:36 AM   #8
sigsegv
Senior Member
 
Registered: Nov 2004
Location: Third rock from the Sun
Distribution: NetBSD-2, FreeBSD-5.4, OpenBSD-3.[67], RHEL[34], OSX 10.4.1
Posts: 1,197

Rep: Reputation: 47
The FreeBSD team doesn't appear to be housing packages for 5.2R anymore, so you'll either have to upgrade to 5.3 (which I would personally recommend over 5.2) or install the ports system detailed here and at the previous URLs I posted.

What you downloaded is the port metafiles that control the build. They consist of a makefile and some other stuff that tells the system how to fetch and build Apache (and required supporting programs if any)
 
  


Reply



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 service wont start tenmiles Linux - General 3 11-26-2004 12:45 AM
Starting and Restarting the Apache service. johann519 Fedora 6 02-05-2004 11:00 PM
Apache httpd service not recognized gfx Linux - Software 3 06-17-2003 01:24 PM
apache service precioso77 Linux - Software 6 04-21-2003 05:40 PM
Apache with Streamming video service lintadsl Linux - Software 0 10-21-2002 04:35 PM

LinuxQuestions.org > Forums > Other *NIX Forums > *BSD

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