Monday, November 07, 2005

Installing Apache2 in FreeBSD

While installing apache2 I ran into some minor trouble.

$> cd /usr/ports/www/apache2
$> make -DWITH_EXPERIMENTAL_MODULES -DWITH_LDAP_MODULES -DWITH_MISC_MODULES -DWITH_PROXY_MODULES -DWITH_SSL_MODULES -DWITH_SUEXEC_MODULES -DWITH_THREADS_MODULES install clean


...
mod_mem_cache.c: In function `remove_entity':
mod_mem_cache.c:556: error: structure has no member named `lock'
mod_mem_cache.c:557: error: structure has no member named `lock'
mod_mem_cache.c:571: error: structure has no member named `lock'
mod_mem_cache.c:572: error: structure has no member named `lock'
mod_mem_cache.c: In function `remove_url':
mod_mem_cache.c:644: error: structure has no member named `lock'
mod_mem_cache.c:645: error: structure has no member named `lock'
mod_mem_cache.c:654: error: structure has no member named `lock'
mod_mem_cache.c:655: error: structure has no member named `lock'
mod_mem_cache.c: In function `store_body':
mod_mem_cache.c:928: error: structure has no member named `lock'
mod_mem_cache.c:929: error: structure has no member named `lock'
mod_mem_cache.c:964: error: structure has no member named `lock'
mod_mem_cache.c:965: error: structure has no member named `lock'
mod_mem_cache.c: In function `mem_cache_post_config':
mod_mem_cache.c:1034: error: structure has no member named `lock'
mod_mem_cache.c:1034: error: `APR_THREAD_MUTEX_DEFAULT' undeclared (first use in this function)
mod_mem_cache.c:1034: error: (Each undeclared identifier is reported only once
mod_mem_cache.c:1034: error: for each function it appears in.)
...
Stop in /usr/ports/www/apache2/work/httpd-2.0.55/modules/experimental.
*** Error code 1
...

From the error I could deduce that there were problems with the experimental modules. Since I did not need experimental I just removed it for the make options.


$> make -DWITH_LDAP_MODULES -DWITH_MISC_MODULES -DWITH_PROXY_MODULES -DWITH_SSL_MODULES -DWITH_SUEXEC_MODULES -DWITH_THREADS_MODULES install clean

After removing the flag "-DWITH_EXPERIMENTAL_MODULES", old object files needed to be removed as well before make could succeed.

$> make clean
===> Cleaning for libiconv-1.9.2_1
===> Cleaning for autoconf-2.59_2
===> Cleaning for gettext-0.14.5
===> Cleaning for gmake-3.80_2
===> Cleaning for libtool-1.5.20
...

$> make -DWITH_LDAP_MODULES -DWITH_MISC_MODULES -DWITH_PROXY_MODULES -DWITH_SSL_MODULES -DWITH_SUEXEC_MODULES -DWITH_THREADS_MODULES install clean
...
This port has installed the following startup scripts which may cause
these network services to be started at boot time.
/opt/etc/rc.d/apache2.sh
/opt/etc/rc.d/000.apache2libs.sh
...
===> Cleaning for autoconf-2.59_2
===> Cleaning for gettext-0.14.5
===> Cleaning for gmake-3.80_2
===> Cleaning for libtool-1.5.20
...

Well, that did the trick, so I can now work on configuring the config files.

Sunday, November 06, 2005

Upgrading to FreeBSD 6.0-Stable


I recently upgraded my FreeBSD server at home to 6.0-Stable after sticking it through with 5.3 for sometime now.

The upgrade was pretty simple.

Edit: /usr/sup/stable-supfile

Changed:
*default release=cvs tag=RELENG_5 to *default release=cvs tag=RELENG_6

$> cd /usr/src
$> make update
--------------------------------------------------------------
>>> Running /usr/local/bin/cvsup
--------------------------------------------------------------
Parsing supfile "/usr/sup/stable-supfile"
Connecting to cvsup11.FreeBSD.org
Connected to cvsup11.FreeBSD.org
Server software version: SNAP_16_1h
Negotiating file attribute support
Exchanging collection information
Establishing multiplexed-mode data connection
Running
...

I then read over /usr/src/UPDATING (... from 5.x-stable or higher to 6.x-stable.) to make sure there was nothing critical which had to be done before upgrading.


$> make buildworld
$> make kernel

Note that I did not specify KERNCONF. This is because I have this variable defined in make.conf along with others. It is highly recommended to reboot into single at this point, but I choose not to. After make kernel, I proceeded with:

$> mergemaster -p
$> make installworld
$> mergemaster -i

before rebooting the machine. After "make installworld" "mergemaster -i" it is essential that the machine is rebooted, otherwise the system will become unstable real quick. I was releived to see the following when the machine started:

Copyright (c) 1992-2005 The FreeBSD Project.
Copyright (c) 1979, 1980, 1983, 1986, 1988, 1989, 1991, 1992, 1993, 1994
The Regents of the University of California. All rights reserved.
FreeBSD 6.0-STABLE #0: Sat Nov 5 12:54:51 EST 2005