11

I wanted to install apache 2.4 on my OS X Mavericks and having problem with ./configure and make.

Mr. Crowley
  • 3,225
  • 4
  • 25
  • 28

3 Answers3

15
  1. First thing you need homebrew on your mac. You can get with:

    ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)"
    

    command from official homebrew website.

  2. Then you need to install pcre and libtool via:

    brew install pcre
    brew install libtool
    
  3. After that, download latest stable apache 2.4 from Apache

  4. After extraction go inside directory and run the following:

    ./configure --prefix=/usr/local/apache-<VERSION> LTFLAGS=--tag=CC
    

    ex:

    ./configure --prefix=/usr/local/apache-2.4.7 LTFLAGS=--tag=CC
    

    which I found here.

  5. After these steps, you just need to run

    make
    make install
    

    and the httpd configs and bash alters from here. Except make sure to use substitute in the correct paths.

  6. In the end run

    httpd -k start working
    httpd -v
    

    you will get (except with your version number):

    Server version: Apache/2.4.7 (Unix)

    Server built: Feb 8 2014 14:34:44

Hope this saves your time.

Nunser
  • 4,512
  • 8
  • 25
  • 37
Mr. Crowley
  • 3,225
  • 4
  • 25
  • 28
  • 1
    I'm able to successfully compile and install Apache HTTPD Server v2.4.9 without updating/adding GNU Libtool. Also, I question the "need" for homebrew, here ("want", maybe). Installing PCRE is even easier than installing Apache. Download the [PCRE source code](http://www.pcre.org), configure, then make and install: `./configure --prefix=/usr/local && make && sudo make install` – Antonio Malcolm May 06 '14 at 19:33
  • 1
    I had to run `./configure --prefix=/usr/local/apache-2.4.9 LTFLAGS=--tag=clang CPP=/usr/bin/cpp` for Apache 2.4.9 on OSX Mavericks (10.3.9) or it would throw some errors and not configure. Then I had to make a symbolic link because the `make` was looking for a path that didnt exist: `sudo ln -s /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain /Applications/Xcode.app/Contents/Developer/Toolchains/OSX10.9.xctoolchain` – james2doyle Jun 27 '14 at 18:46
  • I got an error on the `./configure ...` piece (step 4). This fixed it: http://mac-dev-env.patrickbougie.com/apache/ – Purplejacket Jul 07 '14 at 20:55
  • 2
    Why not just `brew install httpd24`? Seems needless to only partially use brew... – Jon L. Nov 18 '14 at 02:29
13

Just a note that Apache httpd is by default installed on Mac OS X 10.9.x Mavericks. It can be started by the following command:

sudo apachectl start

The config file can be found at this path:

/private/etc/apache2/httpd.conf
Saeed
  • 319
  • 5
  • 21
1

I had to download apr and apr-util in srclib; unpack both and remove the versions at the end of the directory names. Then run:

./configure --with-included-apr
Alan Cabrera
  • 694
  • 1
  • 8
  • 16