31

I am trying to install apache in my linux machine. But when I tried ./configure --prefix = /usr/local/apache it shows an error configure: error: APR not found. Please read the documentation. I tried to install apr with yum install apr apr-deve and it says

Package apr-1.4.6-1.fc15.x86_64 already installed and latest version No package apr-deve available.

Nothing to do What should I do now? Please excuse I am a newbie to LINUX

AssamGuy
  • 1,571
  • 10
  • 30
  • 43

9 Answers9

44

Actualy I had to install aprutils also... So try using:

sudo apt-get install libapr1-dev libaprutil1-dev
lrepolho
  • 951
  • 1
  • 12
  • 23
  • 1
    I am having the same problem, but using centos 6.4. I tried sudo yum install libapr1-dev, and likewise with libaprutil1-dev, both times yum said I already had it installed, but my problem is not fixed. – msknapp May 17 '14 at 18:37
  • Hi, LeandroCR, Is there any way to install for Mac OS. I tried with brew install apr, but it is showing: Warning: apr-1.5.2_3 already installed, it's just not linked. But i am not able to find the apr folder location – Abijith Mg Oct 09 '17 at 07:15
  • Hi @AbijithMg have, have you tried to run a `brew doctor` or `brew link apr`? – lrepolho Oct 11 '17 at 11:54
  • Yeah, I tried brew link. Later it worked. Anyways thanks for the reply.! – Abijith Mg Oct 11 '17 at 11:58
35

In the directory where you have installed the apache httpd distribution there is a directory that is called /srclib

You cd into that directory cd /srclib. Make sure you are in that folder. Now open your browser and go to http://apr.apache.org/download.cgi and download the apr-*.tar.gz files into this directory.

wget <link>

Unzip and extract them into srclib directory after extracting make sure you rename the apr-* directories to just "apr" and "apr-util", respectively. For example:

mv apr-1.6.5 apr
mv apr-util-1.6.1 apr-util

Now, it should read the .apr files from that folder. After that it will ask for apr-util too, make sure you follow the same procedure.

Hope this helps!

Jaap
  • 641
  • 12
  • 19
9

If your install on apache 2.2 or less than add flag --with-included-apr

If you are using 2.4 than you can go to https://apr.apache.org/download.cgi and download the latest apr and apr-util. Unpack them and move them into the apache source file into /srclib. Make sure they are named apr and apr-util not apr.x.x.x. Then you can use the --with-included-apr flag

morsik
  • 1,250
  • 14
  • 17
3

For my linux rig, I got past this by downloading the apr-dev package using the local package manager:

opkg install libapr-1-dev

That was on Angstrom linux, so your command version will likely be different, replacing opkg with apt-get or whatever your distro's package manager is.

baudot
  • 1,618
  • 20
  • 33
3

There are several ways of doing this download latest apr and apr-utils from https://apr.apache.org/

tar xzvf apr.XXX.tar.gz
tar xzvf apr-util,XXX.tar.gz

Solution 1 mv apr.XXX httpd.XYZ/srclib/apr mv apr-util.XXX httpd.XYZ/srclib/apr-util

you should be able to see

ls httpd.XYZ/srclib/apr-util
apr apr-util

now cofigure apache via

./configure --with-included-apr --other-options-that-you-want

Solution 2

mv apr && ./configure && make && make install
mv apr-util && ./configure && make && make install
mv httpd.XYZ/
./configure --with-apr=/usr/local/apr -other-options-that-you-want

NOTE : /usr/local/apr (CENTOS),your Distro might use different one

2

For RHEL Linux, install the following packags:

yum install apr-devel apr-util-devel pcre-devel
qjian
  • 21
  • 2
1

You have to download APR and APR-UTIL packages. install the above downloaded packages from source using below commands ./configure -prefix= make make install

Then run your above mentioned command as below ./configure -prefix= -with-apr= -with-apr-util=

Haneef Mohammed
  • 1,094
  • 11
  • 11
0

sudo apt-get install libapr1-dev libaprutil1-dev use this command in linux

0

The following command works on my mac.

Prerequisites:

brew install apr
brew install pcre

In fact, the link is missing, so http can't be found

brew link apr
brew link pcre

Copy the prompt you see

vim ~/.bash_profile
export PATH="/usr/local/opt/apr/bin:$PATH"
export LDFLAGS="-L/usr/local/opt/apr/lib"
export CPPFLAGS="-I/usr/local/opt/apr/include"
export PATH="/usr/local/opt/apr-util/bin:$PATH"

then, try again

source ~/.bash_profile
./configure
Jayce
  • 1