Apache2 version 2.2.14 - How to Download and Install on Mac OS X
Friday the 20th of November, 2009

    apache2  most recent diff


    version 2.2.14

      View the most recent changes for the apache2 port at: apache2.darwinports.com/diff
      Scroll down toward the bottom of the page to get installation instructions for apache2.
      The raw portfile for apache2 2.2.14 is located here:
      http://apache2.darwinports.com/dports/www/apache2/Portfile
      Find related portfiles with the unique DarwinPorts.com search feature.
      Check for any related Fink projects here: pdb.finkproject.org/pdb/package.php/apache2


      # -*- coding: utf-8; mode: tcl; tab-width: 4; truncate-lines: t; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:et:sw=4:ts=4:sts=4
      The apache2 Portfile 59494 2009-10-15 20:02:32Z snc macports.org $

      PortSystem 1.0

      Name: apache2
      Version: 2.2.14
      Category: www
      Maintainers: imajes
      Description: The extremely popular second version of the Apache http server
      Long Description: Apache is an HTTP server designed as a plug-in replacement for the NCSA server version 1.3 (or 1.4). It fixes numerous bugs in the NCSA server and includes many frequently requested new features, and has an API which allows it to be extended to meet users' needs more easily.
      Homepage: http://httpd.apache.org/
      Platform: darwin freebsd openbsd

      Master Sites: apache:httpd
      distname httpd-${version}
      use_bzip2 yes
      use_parallel_build yes

      Checksums: md5 a5226203aaf97e5b941c41a71c112704 sha1 eacd04c87b489231ae708c84a77dc8e9ee176fd2 rmd160 ff5077e444ba995475202bb3b9be733384c809d1

      depends_lib port:apr port:apr-util port:expat port:openssl port:pcre

      # Both apache and apache2 want to install dbmmanage.1 and other manpages.
      conflicts apache

      post-patch {
      reinplace -E "s/(User|Group) daemon/\\1 www/" ${worksrcpath}/docs/conf/httpd.conf.in
      }

      platform darwin {
      post-patch {
      # Customize userdir naming to match darwin
      reinplace "s|/home/|/Users/|g" ${worksrcpath}/docs/conf/extra/httpd-userdir.conf.in
      reinplace "s|public_html|Sites|g" ${worksrcpath}/docs/conf/extra/httpd-userdir.conf.in
      }

      # HFS can be case insensitive, so protect for this as in
      # http://docs.info.apple.com/article.html?artnum=300422
      patchfiles-append patch-httpd.conf.in-sensitive-files.diff
      }

      platform darwin 7 {
      pre-configure {
      system "cd ${worksrcpath} && glibtoolize --force"
      }
      }

      platform darwin 9 {
      post-extract {
      reinplace "s|-export-symbols-regex ssl_module||g" ${worksrcpath}/configure
      }
      }

      configure.pre_args --prefix=${prefix}/${name}
      configure.args --with-apr=${prefix}/bin/apr-1-config --with-apr-util=${prefix}/bin/apu-1-config --libdir=${prefix}/lib --with-expat=${prefix} --with-pcre=${prefix} --mandir=${prefix}/share/man --enable-mods-shared=all --enable-ssl --with-ssl=${prefix} --enable-cache --enable-disk_cache --enable-file_cache --enable-mem_cache --enable-deflate --enable-proxy --enable-proxy-connect --enable-proxy-http --enable-proxy-ftp

      post-configure {
      # Setting DYLD_FALLBACK_LIBRARY_PATH instead of DYLD_LIBRARY_PATH
      # avoids issues with library collisions (bug #3013)
      reinplace "s|DYLD_LIBRARY_PATH|DYLD_FALLBACK_LIBRARY_PATH|g" ${worksrcpath}/support/envvars-std
      }

      destroot.violate_mtree yes

      post-destroot {
      set confDir ${destroot}${prefix}/apache2/conf
      eval delete ${confDir}/httpd.conf [glob -directory ${confDir}/extra *.conf]

      destroot.keepdirs ${destroot}${prefix}/apache2/logs ${confDir}/extra

      # fix libtool path
      reinplace "s|/apache2/build/libtool|/share/apr-1/build/libtool|g" ${destroot}${prefix}/apache2/build/config_vars.mk

      set docdir ${prefix}/share/doc/apache-${version}
      xinstall -d ${destroot}${docdir}
      xinstall -m 0644 -W ${worksrcpath} ABOUT_APACHE CHANGES LICENSE NOTICE README README.platforms ROADMAP VERSIONING ${destroot}${docdir}
      }

      post-activate {
      set confDir ${prefix}/apache2/conf
      # Make sure initial conf files are present and set up correctly
      if {![file exists ${confDir}/httpd.conf]} {
      file copy ${confDir}/original/httpd.conf ${confDir}/httpd.conf
      }
      foreach f [glob -tails -directory ${confDir}/original/extra *.conf] {
      if {![file exists ${confDir}/extra/${f}]} {
      file copy ${confDir}/original/extra/${f} ${confDir}/extra/${f}
      }
      }
      }

      platform openbsd {
      build.env-append "LD_LIBRARY_PATH=${prefix}/lib"
      }

      Variant: openldap description {Enable LDAP support through OpenLDAP} {
      configure.args-append --enable-ldap --enable-authnz-ldap
      depends_lib-append port:openldap
      }

      Variant: preforkmpm conflicts workermpm eventmpm description {Use prefork MPM} {
      configure.args-append --with-mpm=prefork
      }

      Variant: workermpm conflicts preforkmpm eventmpm description {Use worker MPM} {
      configure.args-append --with-mpm=worker
      }

      Variant: eventmpm conflicts preforkmpm workermpm description {Use event MPM (experimental)} {
      configure.args-append --with-mpm=event
      }

      if {![variant_isset workermpm] && ![variant_isset eventmpm]} {
      default_variants +preforkmpm
      }

      Variant: no_startupitem description {Do not create a startup item} {
      startupitem.create no
      }

      startupitem.create yes
      startupitem.start "\[ -x ${prefix}/apache2/bin/apachectl \] && ${prefix}/apache2/bin/apachectl start > /dev/null"
      startupitem.stop "\[ -r ${prefix}/apache2/logs/httpd.pid \] && ${prefix}/apache2/bin/apachectl stop > /dev/null"
      startupitem.restart "${prefix}/apache2/bin/apachectl restart > /dev/null"

      livecheck.type regex
      livecheck.url ${homepage}
      livecheck.regex {Apache (\d+(?:\.\d+)*) Released}


    If you haven't already installed Darwin Ports, you can find easy instructions for doing so at the main Darwin Ports page.

    Once Darwin Ports has been installed, in a terminal window and while online, type the following and hit return:


      %  cd /opt/local/bin/portslocation/dports/apache2
      % sudo port install apache2
      Password:
    You will then be prompted for your root password, which you should enter. You may have to wait for a few minutes while the software is retrieved from the network and installed for you. Y ou should see something that looks similar to:

      ---> Fetching apache2
      ---> Verifying checksum for apache2
      ---> Extracting apache2
      ---> Configuring apache2
      ---> Building apache2 with target all
      ---> Staging apache2 into destroot
      ---> Installing apache2
    - Make sure that you do not close the terminal window while Darwin Ports is working. Once the software has been installed, you can find further information about using apache2 with these commands:
      %  man apache2
      % apropos apache2
      % which apache2
      % locate apache2

     Where to find more information:

    Darwin Ports



    Lightbox this page.