# Apache / APR upgrade note



## EasyTarget (May 19, 2010)

This is a FYI for anybody hitting the same snags:

The latest Apache upgrade which changes APR (apache portable runtime) from a config option to a permanent requirement caused me two problems.

1) I misinterpreted the /usr/ports/UPDATING instructions to mean that because I did not use APR previously, I just had to do an apache22 upgrade as normal.
- In fact, I needed to follow the full instructions, deinstalling apache22 and running the origin operation (portmaster/portupgrade with -o).
- Without it the apache22 upgrade appeared to try and use the old (apr) port and fell over badly (*).

2) The apr1 port seemed to not have the LDAP config item selected by default, this caused the second attempt at installing apache22 to fail (telling me I need to recompile apr with LDAP).
- Deinstalling apr1 via 'make deinstall', running 'make config' on it and selecting LDAP, and then reinstalling via 'make install' worked. Apache22 then compiled and installed cleanly.
- I was a bit surprised at this, I don't use LDAP anywhere for authentication in my apache install, but I guess it is a hard requirement.

EZ

(*) I managed to close my terminal before grabbing the specific errors I saw for inclusion here, apologies for that.


----------



## CrazyFingers (May 19, 2010)

Yes, the latest Apache update is seriously broken.  I'm getting STOP errors left and right.


----------



## Ruler2112 (May 19, 2010)

I think I'm glad a PC broke and I didn't have time to apply the latest update.  apache22 seems to be having an awful lot of changes made to it of late...


----------



## DutchDaemon (May 19, 2010)

Apache runs fine. Just follow the update instructions.


----------



## myso (May 20, 2010)

Hi DutchDaemon,

me again  This time I borwsed and followed the instructions on updating apache, but still getting a stop error on libtool: 


```
===>  Installing for apache-2.2.15_7
===>   apache-2.2.15_7 depends on file: /usr/local/bin/perl5.8.9 - found
===>   apache-2.2.15_7 depends on shared library: expat.6 - found
===>   apache-2.2.15_7 depends on shared library: apr-1 - found
===>   apache-2.2.15_7 depends on shared library: pcre.0 - found
===>   apache-2.2.15_7 depends on shared library: iconv.3 - found
===>   Generating temporary packing list
===>  Checking if www/apache22 already installed
===>  Warning: your umask is "0002".
      If this is not desired, set it to an appropriate value
      and install this port again by ``make reinstall''.
Making install in srclib
Making install in os
Making install in unix
Making install in server
Making install in mpm
Making install in prefork
/usr/local/build-1/libtool --silent --mode=compile cc -I/usr/local/include  -O2 -pipe -I/usr/include -fno-strict-aliasing      -I. -I/usr
/ports/www/apache22/work/httpd-2.2.15/os/unix -I/usr/ports/www/apache22/work/httpd-2.2.15/server/mpm/prefork -I/usr/ports/www/apache22
/work/httpd-2.2.15/modules/http -I/usr/ports/www/apache22/work/httpd-2.2.15/modules/filters -I/usr/ports/www/apache22/work/httpd-2.2.15
/modules/proxy -I/usr/ports/www/apache22/work/httpd-2.2.15/include -I/usr/ports/www/apache22/work/httpd-2.2.15/modules/generators -I/usr
/ports/www/apache22/work/httpd-2.2.15/modules/mappers -I/usr/ports/www/apache22/work/httpd-2.2.15/modules/database -I/usr/local/include
/apr-1 -I/usr/local/include -I/usr/ports/www/apache22/work/httpd-2.2.15/modules/proxy/../generators -I/usr/include -I/usr/ports/www/apache22
/work/httpd-2.2.15/modules/ssl -I/usr/ports/www/apache22/work/httpd-2.2.15/modules/dav/main -prefer-non-pic -static -c exports.c && touch 
exports.lo
/usr/local/build-1/libtool: not found
*** Error code 127

Stop in /usr/ports/www/apache22/work/httpd-2.2.15/server.
*** Error code 1

Stop in /usr/ports/www/apache22/work/httpd-2.2.15/server.
*** Error code 1

Stop in /usr/ports/www/apache22/work/httpd-2.2.15.
*** Error code 1

Stop in /usr/ports/www/apache22.
```
whereis libtool:

```
libtool: /usr/local/bin/libtool
```
What am I supposed to do? I'm just being careful, because I'm not an unix guru and don't wont to hurt my web services again  Thanks for your help!


----------



## crsd (May 20, 2010)

Looks like you didn't follow UPDATING after all, specifically following part:

```
If you use portmaster:

    portmaster -o devel/apr1 devel/apr

  If you use portupgrade:

    portupgrade -f -o devel/apr1 devel/apr
```


----------



## myso (May 20, 2010)

Well, I'm using portupgrade so I did the one with portupgrade. Today I ran the command again, and still getting the same STOP error.:\


----------



## skmpz (May 20, 2010)

yeah.. same problem here

```
===>  Installing for apr-ipv6-devrandom-gdbm-db42-1.4.2.1.3.9_1
===>   Generating temporary packing list
===>  Checking if devel/apr1 already installed
===>   apr-ipv6-devrandom-gdbm-db42-1.4.2.1.3.9_1 is already installed
      You may wish to ``make deinstall'' and install this port again
      by ``make reinstall'' to upgrade it properly.
      If you really wish to overwrite the old port of devel/apr1
      without deleting it first, set the variable "FORCE_PKG_REGISTER"
      in your environment or the "make install" command line.
*** Error code 1

Stop in /usr/ports/devel/apr1.
*** Error code 1

Stop in /usr/ports/devel/apr1.
*** Error code 1

Stop in /usr/ports/www/apache22.
*** Error code 1

Stop in /usr/ports/www/apache22.
** Command failed [exit code 1]: /usr/bin/script -qa /tmp/portinstall20100520-85798-sx8u7q-0 env make
** Fix the problem and try again.
** Listing the failed packages (-:ignored / *:skipped / !:failed)
	! www/apache22	(unknown build error)
```

:S
Now i'm trying to install it with FORCE_PACKAGE_REGISTER=YES

..Edit: It worked fine..


----------



## myso (May 20, 2010)

no other suggestions?


----------



## kdemidofff (May 20, 2010)

try using portmaster as real men do 



> Using portmaster to do a complete reinstallation of all your ports:
> 
> ```
> 1. portmaster --list-origins > ~/installed-port-list
> ...


----------



## johnedstone (May 23, 2010)

It wasn't clear to me, but, in the end I uninstalled apr1, and then let the 'apache install' reinstall it.  Here's the sequence that worked for me

```
pkgdb -F;portsclean -CDD;portsnap fetch update
cd /usr/ports/www/apache22
make deinstall clean
portupgrade -f -o devel/apr1 devel/apr
cd /usr/ports/devel/apr1
make deinstall clean
cd /usr/ports/www/apache22
make install clean
```


----------



## myso (May 23, 2010)

Great, this worked for me too, thanks!


----------



## Ruler2112 (May 24, 2010)

I can confirm that installing apr1 from ports does not satisfy apache22's requirement for it - it MUST be installed by the apache22 install process.  (Doing things manually with make, make deinstall, make reinstall from the port directory.)  Further, it must be done after a make clean in the apache22 port directory or else you get the aforementioned libtool error.  :q 

Also, a warning for everybody who does not currently have have python installed, apr1 requires it, even if you don't use it for anything and turn off the 'use python malloc' option in the config for apr1.  (Nice that they freakin tell ya this... my boss is now POed at me because our site & webmail has been down for a half hour while the server compiled python and I figured out the weirdness of the reinstallation of apache22. :OOO )

I'm getting seriously annoyed at the ports tree of late.  I try to keep things up-to-date in order to stay ahead of security problems, but it seems like it's been like more akin to windoze updates lately, breaking more than they fix.    (Somebody be sure to mention that I should buy another server to test out the updates on...)


----------



## cajunman4life (May 25, 2010)

Ruler2112 said:
			
		

> I can confirm that installing apr1 from ports does not satisfy apache22's requirement for it - it MUST be installed by the apache22 install process.



That problem must be specific to you. I followed the instructions in /usr/ports/UPDATING exactly and had no problems. Deinstalled apache22 using pkg_delete, ran `portmaster -o devel/apr1 devel/apr` then did `portmaster www/apache22`, and everything worked flawlessly. Downtime around 10 minutes for building of the code.


----------



## dongsky (May 25, 2010)

I have a problem when starting apache when i issue this command  `/usr/local/etc/rc.d/apache22 start`

i got an error: 
	
	



```
Performing sanity check on apache22 configuration:
httpd: Syntax error on line 93 of /usr/local/etc/apache22/httpd.conf: Cannot load /usr/local/libexec/apache22/mod_proxy.so into server: /usr/local/libexec/apache22/mod_proxy.so: Undefined symbol "apr_reslist_acquire"
Starting apache22.
httpd: Syntax error on line 93 of /usr/local/etc/apache22/httpd.conf: Cannot load /usr/local/libexec/apache22/mod_proxy.so into server: /usr/local/libexec/apache22/mod_proxy.so: Undefined symbol "apr_reslist_acquire"
/usr/local/etc/rc.d/apache22: WARNING: failed to start apache22
```


any idea of how to solve this problem


----------



## DutchDaemon (May 25, 2010)

As far as I'm concerned, the instructions in /usr/ports/UPDATING were spot-on. I upgraded seven Apache installations in half an hour, and they all worked.


----------



## Maxamoto (May 30, 2010)

cajunman4life said:
			
		

> That problem must be specific to you. I followed the instructions in /usr/ports/UPDATING exactly and had no problems. Deinstalled apache22 using pkg_delete, ran `portmaster -o devel/apr1 devel/apr` then did `portmaster www/apache22`, and everything worked flawlessly. Downtime around 10 minutes for building of the code.



It's not specific to just him. I had the exact same issue, but the steps above starting with pkgdb -F fixed my issue as well.


----------

