9

I am trying to run the passenger-install-apache2-module command and I keep getting this error:

ext/apache2/mod_passenger.c:25:10: fatal error: 'httpd.h' file not found

Not sure what happened to it, my local dev environment was fine until I upgraded to Mavericks - I had to update XCode and uninstall/reinstall the passenger gem.

I tried creating httpd.h in the /etc/apache2 directory and pasting this in but that didn't work.

I've no idea how to replace this file

martincarlin87
  • 10,848
  • 24
  • 98
  • 145
  • httpd.h is supposed to be in /usr/include/apache2. I'm not yet sure what's going on, maybe Apple's update process broke something. More investigation is required. Maybe you can contact Apple? – Hongli Oct 23 '13 at 13:46
  • exactly the same situation, exactly the same problem. – dangerousdave Oct 23 '13 at 13:46
  • And you can't just copy-paste a random httpd.h. The contents have to exactly match the Apache version that you're actually running. – Hongli Oct 23 '13 at 13:50
  • Thanks @Hongli, was going to try placing the file there just to see if it worked but `/usr/include` doesn't even seem to exist on my machine nevermind `/usr/include/apache2` – martincarlin87 Oct 23 '13 at 13:59

3 Answers3

26

I was having the same error. You need to:

  1. Update/install xcode.
  2. run xcode-select --install from the command line to reinstall the command line tools.

It worked for me, hopefully for you too!

The update also commented out the line:

Include /private/etc/apache2/extra/httpd-vhosts.conf

So once I uncommented that it all loaded as normal.

** UPDATE FOR YOSEMITE **

In your /etc/apache2/httpd.conf file you'll need to change:

<Directory /> AllowOverride none Require all denied </Directory>

To:

<Directory /> AllowOverride none Require all granted </Directory>

Sean
  • 2,891
  • 3
  • 29
  • 39
  • thanks @Sean, downloading Command Line Tools now but that was the first thing I checked in XCode after downloading the update after Mavericks was installed, will report back with results. – martincarlin87 Oct 23 '13 at 14:28
  • the Phusion Passenger installation worked, just added the lines to my Apache config but my localhost is still just saying `It works!` so just need to fix that. Thanks for your help. – martincarlin87 Oct 23 '13 at 14:40
  • I had that issue to it was because I was using a vhosts file that my httpd.conf commented out. I just needed to uncomment that. – Sean Oct 23 '13 at 14:48
  • thanks, I'm not using anything any vhosts, the rails app is just in a directory on my Desktop which I access via `localhost` and updates the live site via svn, can't remember what I did for this stage the first time I installed Rails – martincarlin87 Oct 23 '13 at 14:56
  • __update:__ it's fine if I go to `localhost:3000` but before it ran fine on `localhost`, apache is listening on port 80 (checked httpd.conf) so not sure what's happening.... Just stopped apache and it made no difference, something weird is happening! – martincarlin87 Oct 23 '13 at 15:11
  • Anyone getting "can't install the software because it is not currently available from the software update server" - I have been getting this for the last couple of hours. – pingu Oct 23 '13 at 17:19
  • Which software? When you gem install passenger? – Sean Oct 23 '13 at 17:21
  • When running "xcode-select --install" and then following instructions. – pingu Oct 23 '13 at 17:25
  • Thanks @Sean, just noticed your Yosemite update and updated the title accordingly. My dev environment was not too bad to fix after this upgrade but for some reason I need to start passenger manually everytime I startup by running `sudo passenger start -p 80 --user=martin` in my app directory, I tried the above to fix it but nothing's changed - any ideas? – martincarlin87 Nov 05 '14 at 13:15
  • @martincarlin87 Did you reinstall the developer tools (xcode) when you updated to yosemite? It seems strange that you need to use sudo which makes me wonder if it is a permissions issue. – Sean Nov 05 '14 at 23:02
  • @Sean I reinstalled the apache module and noticed I hadn't so I have them installed now. I managed to fix it yesterday (I wasn't using any `VirtualHost` configs before, just a `DocumentRoot` but I have it now, then had a problem with the `.htaccess` file, finally fixed that and Passenger was starting with apache when it was restarted but after starting up today I'm getting an error when running `apachectl configtest` and `apachectl -t -D DUMP_MODULES|grep -i passenger` when there were none yesterday after I got it working.... – martincarlin87 Nov 06 '14 at 09:23
2

During the mavericks upgrade several configuration files were saved as previous and replaced by the install including:

/etc/apache2/httpd.conf~previous
/etc/group~previous
/etc/php.ini.default-5.2-previous
/etc/sshd_config~previous
/etc/syslog.conf~previous
DGerman
  • 21
  • 1
0

Another, related issue, is to do with /usr/share/httpd/build/config_vars.mk you can see that cc is set incorrectly, and CC should read CC = /usr/bin/cc, likewise CPP should read CC = /usr/bin/cc -E

konchog
  • 47
  • 1