# apache 2.2 upgrade

## Miker

Hi all,

Just a word of warning: I couldn't get my apache server back up after the upgrade, a frustrating hour or 2 later I downgraded to 2.0.x

My problem was the mod_proxy which wasn't getting loaded (yes I added it to APACHE2_OPTS), which resulted in an error about not knowing my 'ProxyRequests' directive.

This topic can be used to report similar problems/solutions with the apache 2.2 upgrade.

TIP: re-emerge mod_proxy_html and subversion if you use those in combination with apache2

regards,

Mike

----------

## DancesWithWords

 *Miker wrote:*   

> Hi all,
> 
> Just a word of warning: I couldn't get my apache server back up after the upgrade, a frustrating hour or 2 later I downgraded to 2.0.x
> 
> My problem was the mod_proxy which wasn't getting loaded (yes I added it to APACHE2_OPTS), which resulted in an error about not knowing my 'ProxyRequests' directive.
> ...

 

Well I stupidly upgraded myself. The whole config system has changed and I've dont' know how to use the freaking things.  I'm quite pissed to say the least.

I've never used vhosting I've know idea what it is and I can't even find the place to put my ServerName.  Crap this is really not funny.

--

DancesWithWords.

----------

## hanj

This totally sucks. I can't believe the deal with apache the last few days.. major pain. I think I might wait a bit before rolling this out on production.

hanji

----------

## Aad-Jan

Thx for the heads-up. I saw the upgrade and decided to visit the forum first.

A simple

# echo ">www-servers/apache-2.0.59-r5">> /etc/portage/package.mask

did the trick.

----------

## snIP3r

hi all!

i recently upgraded to 2.2.4 a few days ago. the only problem i had was with ssl (see here https://forums.gentoo.org/viewtopic.php?p=4222171. but after getting help here everything runs fine. it also ran perfect after the update without ssl  :Wink:  no pain with config...

HTH

snIP3r

----------

## thoughtform

..is broken:

neo apache2 # /etc/init.d/apache2 restart

 * Apache2 has detected a syntax error in your configuration files:

apache2: Syntax error on line 170 of /etc/apache2/httpd.conf: Syntax error on line 3 of /etc/apache2/modules.d/11_mod_bw.conf: Cannot load /usr/lib/apache2/modules/mod_bw.so into server: /usr/lib/apache2/modules/mod_bw.so: undefined symbol: apr_atomic_add

----------

## tld

Most of the problems people are reporting about this upgrade are from two things:

a) fairly significant changes to the config files in /etc including a number of directives being moved from /etc/apache2/httpd.conf to /etc/apache2/vhosts.d/default_vhost.include and default virtual host directives being moved from the files in /etc/apache2/modules.d to files in /etc/apache2/vhosts.d.

b) the need to recompile all modules, including php.

How difficult this is depends on how customized your configs are, but the config file changes are a must.

Both of these are discussed in the post install elogs:

```
>>> Messages generated by process 23960 on 2007-09-06 16:31:46 for package www-servers/apache-2.2.4-r12:

LOG: setup

Selected default MPM: prefork

You can manipulate several configure options of suexec

through the following environment variables:

 SUEXEC_SAFEPATH: Default PATH for suexec (default: /usr/local/bin:/usr/bin:/bin)

  SUEXEC_LOGFILE: Path to the suexec logfile (default: /var/log/apache2/suexec_log)

   SUEXEC_CALLER: Name of the user Apache is running as (default: apache)

  SUEXEC_DOCROOT: Directory in which suexec will run scripts (default: /var/www)

   SUEXEC_MINUID: Minimum UID, which is allowed to run scripts via suexec (default: 1000)

   SUEXEC_MINGID: Minimum GID, which is allowed to run scripts via suexec (default: 100)

  SUEXEC_USERDIR: User subdirectories (like /home/user/html) (default: public_html)

    SUEXEC_UMASK: Umask for the suexec process (default: 077)

LOG: postinst

The default webroot has not been installed into

//var/www/localhost because the directory already exists

and we do not want to overwrite any files you have put there.

If you would like to install the latest webroot, please run

emerge --config =apache-2.2.4-r12

Listen directives have been moved into the default virtual host

configuation. At least DEFAULT_VHOST has been enabled for you

(depending on your USE-flags.

If you disable DEFAULT_VHOST or SSL_DEFAULT_VHOST, there would

be no listening sockets available.

Please make sure that you update your /etc directory.

Between the versions, we had to changes some config files

and move some stuff out of the main httpd.conf file to a seperate

modules.d entry.

Thus please update your /etc directory either via etc-update,

dispatch-conf or conf-update !

When upgrading from versions below 2.2.0 to this version, you

need to rebuild all your modules. Please do so for your modules

to continue working correctly.

Also note that some configuration directives have been

split into their own files under //etc/apache2/modules.d/

and that some modules, foremost the authentication related ones,

have been renamed.

Some examples: 

  - USERDIR is now configureable in /etc/apache2/modules.d/00_mod_userdir.conf.

For more information on what you may need to change, please

see the overview of changes at:

http://httpd.apache.org/docs/2.2/new_features_2_2.html

and the upgrading guide at:

http://httpd.apache.org/docs/2.2/upgrading.html

```

I was lucky that most of my machines didn't have heavily customized configs, so it wasn't too tough.  I addresses the configs (mostly with etc-update), recompiled php5, and everything worked first time upon restarting apache.

Tom

----------

## MerlinYoda

I have a new issue to add to the list concerning the "AddDirectroyIndex" directive.

```

# /etc/init.d/apache2 configtest

 * Checking Apache Configuration ...

 * Apache2 has detected a syntax error in your configuration files:

[Thu Sep 06 18:18:32 2007] [warn] Useless use of AllowOverride in line 81.

Syntax error on line 85 of /etc/apache2/modules.d/75_mod_perl.conf:

AddDirectoryIndex not allowed here

```

So what's wrong here? Did the "AddDirectroyIndex" directive get removed? If it can't go in the module config files, then do I have to add it to the vhost files instead? If so, that seems a half-brain-dead approach to it considering it breaks the whole concept of keeping the module configs ... well... modularized . For example, if one should decide to remove mod_perl from their system and forget do remove the apache option "-D PERL" from /etc/conf.d/apache and all related entries from even one vhost file, they're probably gonna get some undesired behavior ... especially when Joe WebDeveloper goes to edit the homepage but can't get it to display because index.pl overrides index.html.

----------

## wereveal

 *Miker wrote:*   

> Hi all,
> 
> Just a word of warning: I couldn't get my apache server back up after the upgrade, a frustrating hour or 2 later I downgraded to 2.0.x
> 
> My problem was the mod_proxy which wasn't getting loaded (yes I added it to APACHE2_OPTS), which resulted in an error about not knowing my 'ProxyRequests' directive.
> ...

 

Personally, I felt that this is more of a 2.5 like upgrade, as it significantly changes a lot in the Apache server, many modules are new/changed/deleted - for example no more mod_auth_mysql and no easy upgrade path, at least not with Gentoo.  I have been successfully running Apache 2.2 unmasked now for many moons on a test server to learn about the significant differences of the database modules and configuration. It is a good upgrade but you certainly need to do it first on a test server to see what might break on your production servers! If you use mod_auth_mysql, you are going to have to learn a lot of new stuff!!!  I switched to sqlite and ldap.

I must admit I have been surprised at how many people are upgrading without having read all about apache 2.2 at apache.org first.  It has been available for some time now (it seems like it has been masked in Gentoo forever), and many of the problems with upgrading have been discussed there.  They have a good overview of upgrading from 2.0 to 2.2, linked to from their main Apache 2.2 documentation page.

----------

## Suicidal

Personally on a significant upgrade like 2.0 to 2.2 I would reemerge everything that depends on that package like so:

```
for i in $(qdepends -CNQ www-servers/apache); do emerge $i; done
```

----------

## zeek

 *wereveal wrote:*   

> Personally, I felt that this is more of a 2.5 like upgrade, as it significantly changes a lot in the Apache server, many modules are new/changed/deleted ...

 

I personally felt it was more like an Apache 3.0 upgrade.  Minor version upgrades usually don't make incompatible changes.  In any case I'm pleased that I upgraded a test server and not the production server because it took some time for me to figure out.

----------

## snIP3r

 *wereveal wrote:*   

> 
> 
> I must admit I have been surprised at how many people are upgrading without having read all about apache 2.2 at apache.org first.  It has been available for some time now (it seems like it has been masked in Gentoo forever), and many of the problems with upgrading have been discussed there.  They have a good overview of upgrading from 2.0 to 2.2, linked to from their main Apache 2.2 documentation page.

 

hi!

i also damit that i upgraded without reading the docu  :Wink:  but it seems i had luck with this because my config changes do not vary much from original config. thx for the tip with the apache docu-site - now i will read the upgrade guide to understand what i have done - ok, wrong order, but i will try it anyway...

greets

snIP3r

----------

## leonglass

Thanks for the post my apache stopped working and I felt a modocom of panic until I read this post. A simple remerge of php did the trick.

----------

## hanj

 *Scorpaen wrote:*   

> ..is broken:
> 
> neo apache2 # /etc/init.d/apache2 restart
> 
>  * Apache2 has detected a syntax error in your configuration files:
> ...

 

I ran across the same problem. Found this link:

http://wiki.tomedia.de/display/L/mod_bw

Looks like mod_bw-0.8 works fine.

hanji

----------

## Mysticode

The problem I am having is I can't even determine whether my config files will work as it doesn't appear to try to start apache:

```
diablerie vhosts.d # /etc/init.d/apache2 start

diablerie vhosts.d # 
```

----------

## hanj

 *Mysticode wrote:*   

> The problem I am having is I can't even determine whether my config files will work as it doesn't appear to try to start apache:
> 
> ```
> diablerie vhosts.d # /etc/init.d/apache2 start
> 
> ...

 

That certainly is odd. Did you update /etc/init.d/apache2? Also, what's the output of your /var/log/apache2/error_log?

Thanks!

hanji

----------

## snIP3r

 *Mysticode wrote:*   

> The problem I am having is I can't even determine whether my config files will work as it doesn't appear to try to start apache:
> 
> ```
> diablerie vhosts.d # /etc/init.d/apache2 start
> 
> ...

 

is there no output like this???

```

area52 ~ # /etc/init.d/apache2 start

 * Starting apache2 ...                                                                                                                             [ ok ]

area52 ~ #

```

this is curious... did you check /var/log/apache2/error_log as hanj suggested? please post this output.

greets

snIP3r

----------

## Mysticode

 *hanj wrote:*   

> That certainly is odd. Did you update /etc/init.d/apache2? Also, what's the output of your /var/log/apache2/error_log?
> 
> Thanks!
> 
> hanji

 

 *snIP3r wrote:*   

> is there no output like this???
> 
> ```
> 
> area52 ~ # /etc/init.d/apache2 start
> ...

 

That's the really weird part - there is no output about it trying to start apache and nothing in the error log (in fact, since I deleted the error log when I first started having this problem so I could see whether it was touching the log files at all, there isn't even an error log).  I did replace the init script, I have even deleted the init script and re-emerged it (I have also deleted the conf.d script and the config scripts and then re-emeged apache - next I may have to try deleting the whole /etc/apache2 directory and re-emerging it.

Thanks,

Mysticode

----------

## bobber205

I'm in charge of the library's webserver at school (by the way of no one else is familar enough with linux) and I almost had us down for hours.

I did a /etc/init.d/apach2 RESTART, not stop and start like I usually do.

When restart is done it doesn't stop your server unless everything is fine and it can start. Whew. it was so close. 

Just my story. Boo apache. Why did you do this? lol

----------

## Mysticode

 *Mysticode wrote:*   

> That's the really weird part - there is no output about it trying to start apache and nothing in the error log (in fact, since I deleted the error log when I first started having this problem so I could see whether it was touching the log files at all, there isn't even an error log).  I did replace the init script, I have even deleted the init script and re-emerged it (I have also deleted the conf.d script and the config scripts and then re-emeged apache - next I may have to try deleting the whole /etc/apache2 directory and re-emerging it.

 

I tried downgrading and it still wouldn't work.  I finally got so fed up I tried restarting the machine and now it is working.  No idea why though.

----------

## upengan78

 :Mad:   I had the same PAIN as you guys when I upgraded the world and it did upgrade apache2. On top of that I upgraded my kernel from 2.6-20 to 2.6.22 and that again stopped my working apache2. stop and restart work fine , and nmap localhost shows port 80 listening but browser could never open the localhost ...I have already posted a topic for that

 *Quote:*   

> https://forums.gentoo.org/viewtopic-t-589745.html

 

----------

## frameRATE

Is it me, or did they completely remove httpd.conf, after they JUST merged gentoo to that "standard" like a year ago?

Looks to me like they moved everything to the modules.d/00_* format... but I still have old httpd.conf's from previous upgrades, so I'm not sure.

----------

## Izydorr

I have exactly the same situation Mysticode has. Apache doesn't start and I havo completely no outpu, no logs anywhere - nothing! Any ideas?

----------

## upengan78

why dont use guys mv config directory to else

and do emerge -C apache and apache-apps

and emerge -v "=apache-2.0.61"

This should get you going atleast.  :Smile: 

----------

## Izydorr

I removed totally apache and all it'f files and then re-emerged it and it didn't help. Maybe the problem isn't in apache? For example when I try to start samba I get the "starting samba..." message but then it freezes and nothing happens and again no output or logs.

----------

## mocsokmike

Did you update the initscripts in /etc/init.d?

----------

## upengan78

I think I did ,

but I don't know if I am losing the advantage of latest config files, so I do etc-update with extra config parameters. but it's messing up the things

----------

## Izydorr

I removed all apache related files (those in /etc/init.d/ too) before reinstalling apache.

----------

## odessit

any update on this thread? I have exact same problem as Izydorr

```
etc # /etc/init.d/apache2 start

ids etc #

```

----------

## mocsokmike

I can run the new apache, but have strange problems.

First, if I write

```
/etc/init.d/apache stop
```

It returns after a few seconds this:

```
 * Stopping apache2 ...                                             [ !! ]
```

I need to manually kill one remaining apache process using kill -KILL and then I can stop it. A simple kill is not enough.

I am using SSL with apache, but I have recompiled the whole after the update, and did revdep-rebuild as well.

Second, I cannot run cgi and perl scripts unless they are in a directory marked as 'ScriptAlias'. But this way apache won't serve images or other, non-script files from this directory (or its subdirectories). And I would need that for dbmailadministrator.

Any ideas?

### EDIT: 17/10/2007, 22:01 ###

I managed to solve problem number two by adding as many scriptalias lines as cgi or pl files I have in that directory. Maybe I am a noob in this field, but no howto I ever read mentioned that I should not use the whole directory as a scriptaliased directory.

The first problem is caused by some broken openssl libraries, I am on my way to remove them but first I need to re-merge the depending packages.

So in my case almost all the troubles were caused by my lack of knowledge and the drastic changes in the apache config files.

If anyone here have similar problems, I can post my configs.

----------

## wetter

hi everyone, 

i'm very happy to have found this thread _before_ doing anything to our production server. i will definitely practice on a test server first now...

just thought that: this thread could very well be made sticky by somebody, couldn't it?

----------

## Izydorr

The bug is not so obvious. On another machine my apache 2.2 works fine.

----------

## odessit

I have a feeling that this is a problem with conf.d or init.d because I was able to start it manually from the CLI

Anyway, I installed the -r2 and now it is all fine

```
ACCEPT_KEYWORDS='~x86' emerge -p =www-servers/apache-2.2.6-r2
```

Since it is for internal page, I don't care much about the untested nature of this release.

Good luck.

----------

