Skip to main content

How to Setup Apache 2.2 on FreeBSD 7.1-REL

Your rating: None Average: 3 (3 votes)

Prerequisites:   Get FreeBSD   FreeBSD 7.1-REL

Post By: Ren Blevins

Apache is used everywhere. For more information visit https://www.apache.org/.

This tutorial installs version Apache Server 2.2.9_5 Read through the whole thing first then go back and run the install..

 

Install Apache via ports:

Buy and Sell Cisco Network Gear.

prompt# cd /usr/ports/www/apache22
prompt# make install && make clean

 

In many cases leaving the defaults is fine. However in our particular case we have KDE 3.5 installed and got the following error.
===> Installing for apache-2.2.11_3
===> apache-2.2.11_3 conflicts with installed package(s):
apr-db42-1.3.3.1.3.4
They install files into the same place.
Please remove them first with pkg_delete(1).
*** Error code 1

Here's the fix for that.

prompt# cd /var/db/ports

prompt# rm -r apache22/

prompt# cd /usr/ports/www/apache22
prompt# make install && make clean

 

Select the APR, Threads, MySQL from the menu.

[X] APR_FROM_PORTS Use devel/apr as APR (beware!)

[X] THREADS

[X] MYSQL

 

Good to go..

 

Edit /usr/local/etc/apache22/httpd.conf


Find and edit the RED TEXT.

...

ServerAdmin webmaster@example.com

...

ServerName www.example.com:80

	...
# Uncomment these settings

# Various default settings

Include etc/apache22/extra/httpd-default.conf

...

 

Edit /usr/local/etc/apache22/extra/httpd-default.conf 

Find and edit the RED TEXT.

	...
ServerTokens Prod 
... 
ServerSignature Off 
... 
HostnameLookups Off 
...

 

To run apache www server from startup, add apache22_enable="YES"
in your /etc/rc.conf. Extra options can be found in startup script.

Install Apache startup script and start it:

prompt# /usr/local/etc/rc.d/apache22 start

If you get absolutely no warnings or errors then load it at start.

prompt# echo 'apache22_enable="YES"' >> /etc/rc.conf

 

Test the Server:

Visiting either “http://domain.tld/” or “http://YOUR_IP/” should now bring up your machine’s default Apache web page (Something along the lines of “It Works!“.

 

All done. Good Luck.

 

If you want to set up some virtual hosts..  go back to the httpd.conf and Uncomment:

# Virtual hosts
Include etc/apache22/extra/httpd-vhosts.conf

And in the extra folder.

Edit /usr/local/etc/apache22/extra/httpd-vhosts.conf

 

 

Post By: Ren Blevins

Originally all How to, config, setups, and supporting documentation was researched and compiled so we could find working solutions for our particular environment. We primarily run and develop FreeBSD 7.1, 7.2 and Mac OS X 10.6 Clients and servers.

Thank You for visiting we hope you find this site useful in your network projects.

Post new comment

The content of this field is kept private and will not be shown publicly.
CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.
Image CAPTCHA
Enter the characters shown in the image.