Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Apache httpd.h file missing on MacOSX after Mavericks Upgrade (** Updated for Yosemite **)

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

like image 906
martincarlin87 Avatar asked Oct 23 '13 13:10

martincarlin87


People also ask

How do I run httpd without Sudo on Mac?

/usr/local/etc/httpd/extra/httpd-ssl.conf to 8443 so that httpd can run without sudo. And you are all set. Where is Apache httpd installed on my mac?

Why is httpd not working on my homebrew server?

The cause is homebrew installs apache2/httpd in user accessible folders and runs as a user (by running the command: brew services start httpd). Not running as a regular user means httpd can not listen on privileged ports (1024 and below).

Why is httpd not running as a regular user?

Not running as a regular user means httpd can not listen on privileged ports (1024 and below). So even if httpd.conf is configured to listen to 80 and 443, httpd can not receive requests through those ports. The peculiarity is when you start httpd by running the command: sudo apachectl start. This command starts httpd as root user.


2 Answers

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>

like image 165
Sean Avatar answered Oct 10 '22 04:10

Sean


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
like image 2
DGerman Avatar answered Oct 10 '22 02:10

DGerman