Search This Blog

Thursday, June 18, 2020

How to install apache webserver on MAC !!

Recently I needed to install apache webserver on the MAC. It is not straight as installing via dmg. Following steps can help : 

 1. Download distribution from apache, unzip in into one of directory: in my case i have downloaded following version: 
        
  httpd-2.4.43.gzip   unzip this and run following to install in  httpd-2.4.43
    
    .    ./configure --prefix=/apache

    if installed all good :) but if you get an error : 
    
    checking for APR... no
    configure: error: APR not found.  Please read the documentation.

Then go to next step: 


 2.  There are couple of dependencies as below to install and build apache : 
    First one is apr and apr-util. - Download this from http://apr.apache.org/ and copy into 
         
               httpd-2.4.43/srclib/apr 
               httpd-2.4.43/srclib/apr-util. 

            Make sure no version mentioned, remove from folder name: 
Now run again following :  

    ./configure --with-included-apr --prefix=/apache

   if installed all good :) but if you get an error : 

   checking for pcre-config... false
    configure: error: pcre-config for libpcre not found. PCRE is required and available from     http://pcre.org/

Then go to next Step 
   



3. Install pcre  : download from http://www.pcre.org/. unzip into pcer dir and run following : 
            
        ./configure --prefix=/usr/local/pcre

        make

        sudo make install

    Once pcer install then go to httpd-2.4.43 dir and run again 

 ./configure --with-included-apr --with-pcre=/usr/local/pcre/bin/pcre2-config --prefix=/apache

    if shows success all good :) but if you get an error then search google since i did not get error after that :).


4. Now run make 

 if shows success all good but if you get an error like 

& touch util_pcre.lo
util_pcre.c:58:10: fatal error: 'pcre.h' file not found
#include "pcre.h"
         ^~~~~~~~

then you have to link this file : 

sudo ln -s /usr/local/pcre/include/pcre.h /usr/local/include/pcre.h
    
run make and make install.

Hope all should be good then as I did not get any issue after that ;). 

Cheers !!


            
         

No comments:

Post a Comment

Thanks for your comment, will revert as soon as we read it.

Popular Posts