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
Actualy I had to install aprutils also... So try using:
sudo apt-get install libapr1-dev libaprutil1-dev
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!
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
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.
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
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=
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
sudo apt-get install libapr1-dev libaprutil1-dev use this command in linux
Related
I want to install janus-gateway on CentOS7.
I read the following document and tried installation.
https://github.com/meetecho/janus-gateway/blob/master/README.md
git clone https://github.com/meetecho/janus-gateway.git
cd janus-gateway
sh autogen.sh
./configure --prefix=/opt/janus
However, configuring janus-gateway will cause an error. The error is as follows.
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... no
checking for pkg-config... /bin/pkg-config
checking pkg-config is at least version 0.9.0... yes
checking for JANUS... no
configure: error: Package requirements (
glib-2.0 >= 2.34
libconfig
nice
jansson >= 2.5
libssl >= 1.0.1
libcrypto
) were not met:
No package 'nice' found
Consider adjusting the PKG_CONFIG_PATH environment variable if you
installed software in a non-standard prefix.
Alternatively, you may set the environment variables JANUS_CFLAGS
and JANUS_LIBS to avoid the need to call pkg-config.
See the pkg-config man page for more details.
I installed libnice(libnice-0.1.3-4.el7.x86_64) in the following way.
yum install libnice
How can I solve it?
Thank you.
try this and rebuild
echo "export PKG_CONFIG_PATH=/usr/lib/pkgconfig" >> ~/.bashrc
source ~/.bashrc
Disclaimer: I am using Ubuntu 18.04 when testing this.
If you are using Ubuntu system and trying to install Janus and running this code
./configure --prefix=/opt/janus
And then getting this error: No package 'nice' found
Make sure you have been installation of the nice from aptitude.
sudo install aptitude
aptitude install libmicrohttpd-dev libjansson-dev \
libssl-dev libsrtp-dev libsofia-sip-ua-dev libglib2.0-dev \
libopus-dev libogg-dev libcurl4-openssl-dev liblua5.3-dev \
libconfig-dev pkg-config gengetopt libtool automake
For some reason installation of nice using the answer from Frank, Ahmet or Zallfire doesn't work in Ubuntu. It has to be installed using aptitude.
You should download libnice source code to install.
https://gitlab.freedesktop.org/libnice/libnice
You need the development libnice.
yum install libnice-devel
httpd build on msys2 fails with the following error:
xml/apr_xml.c:35:19: fatal error: expat.h: No such file or directory
On real linux distros, installing the expat-devel package seems to solve the problem see here,
more precisely, expat-devel is an apr-util prerequisite
and at least its headers ar missing on msys2.
So how to build httpd with msys since no expat-devel package or headers is available ?
When configuring httpd --with-included-apr, where do apr-utils look for expat headers or how to configure that ?
more precisely the CHANGES-APR-UTIL-1.6 documentation says
Changes with APR-util 1.6.0
*) The expat dependency of apr-util is no longer built with
apr-util.
Install expat (including development headers and libraries) first
before building apr-util.
where should expat headers and libs be installed in httpds build directory tree ?
I finally had to build expat separately,
then other errors arised and found a solution thanks to
this link for missing libtool and to that link for the effective way to build expat without generating export redefinition.
let find the full build script here:
pacman -S make gcc libcrypt perl unzip libtool msys/libcrypt-devel
cd OpenSSL_1_1_1-stable
curl http://mirrors.standaloneinstaller.com/apache/httpd/httpd-2.4.38.tar.gz --output httpd-2.4.38.tar.gz
tar xvf httpd-2.4.38.tar.gz
cd $HOME
git clone --branch OpenSSL_1_1_1-stable https://github.com/openssl/openssl.git
mv openssl OpenSSL_1_1_1-stable
cd OpenSSL_1_1_1-stable
./configure gcc --prefix=$HOME/openssl
make
make install
cd $HOME
wget https://github.com/libexpat/libexpat/releases/download/R_2_2_6/expat-2.2.6.tar.bz2
tar xjvf expat-2.2.6.tar.bz2
cd $HOME/expat-2.2.6
./configure --prefix=$HOME/httpd --exec-prefix=$HOME/httpd
make
make install
cd $HOME
curl http://mirrors.standaloneinstaller.com/apache//apr/apr-1.6.5.tar.gz --output apr-1.6.5.tar.gz
tar xvf apr-1.6.5.tar.gz
curl http://mirrors.standaloneinstaller.com/apache//apr/apr-util-1.6.1.tar.gz --output apr-util-1.6.1.tar.gz
tar xvf apr-util-1.6.1.tar.gz
cd $HOME/apr-1.6.5
./configure --prefix=$HOME/httpd
make
make install
cd $HOME/apr-util-1.6.1
./configure --prefix=$HOME/httpd --with-apr=$HOME/httpd --with-expat=$HOME/httpd
make
make install
cd $HOME
wget https://ftp.pcre.org/pub/pcre/pcre-8.43.tar.gz
tar xvf pcre-8.43.tar.gz
cd pcre-8.43
./configure --prefix=$HOME/pcre
make
make install
cd $HOME
wget https://github.com/nghttp2/nghttp2/releases/download/v1.37.0/nghttp2-1.37.0.tar.gz
tar xvf nghttp2-1.37.0.tar.gz
cd $HOME/nghttp2-1.37.0
./configure --exec-prefix=$HOME/httpd --prefix=$HOME/httpd
make
make install
cd $HOME/httpd-2.4.38
./configure --prefix=$HOME/httpd --with-expat==$HOME/httpd --with-apr-util=$HOME/httpd --with-apr=$HOME/httpd --with-pcre=$HOME/pcre --enable-ssl --enable-ssl-staticlib-deps --with-ssl=$HOME/openssl --enable-proxy --enable-proxy-connect --enable-proxy-http --enable-proxy-balancer --enable-http2 --enable-nghttp2-staticlib-deps --with-nghttp2=$HOME/nghttp2
make
make install
The build process completed successfully,
but usefull to say that the runtime can't be used since httpd is not able to load its dynamic modules as described here
I am trying to build Apache Server v 2.4.38 on RHEL 7.3 and I am using apr 1.6.5, apr-util 1.6.1, and pcre 8.42.
I am running following commands
./configure --with-included-apr --with-pcre=/data/abc/installed/pcre_installed --prefix=/data/abc/installed/httpd_installed
make
While running 'make' I am receiving error
/bin/sh /data/abc/installed/httpd-2.4.38/srclib/apr/libtool --silent --mode=compile gcc -g -O2 -pthread -DHAVE_CONFIG_H -DLINUX -D_REENTRANT -D_GNU_SOURCE -I/data/abc/installed/httpd-2.4.38/srclib/apr-util/include -I/data/abc/installed/httpd-2.4.38/srclib/apr-util/include/private -I/data/abc/installed/httpd-2.4.38/srclib/apr/include -o xml/apr_xml.lo -c xml/apr_xml.c && touch xml/apr_xml.lo
xml/apr_xml.c:35:19: fatal error: expat.h: No such file or directory
#include <expat.h>
Download expat-2.2.6.tar.bz2 from https://libexpat.github.io/.
Extract expat using following command
tar xvjf expat-2.2.6.tar.bz2 -C /path-to-dir
Change to the extracted expat directory.
Build expat using following commands
./configure --prefix=/path-to-expat-installation-dir
make
make install
While building Apache Httpd from source specify --with-expat
./configure --with-included-apr --prefix=/path-to-apache-installation --with-expat=/path-to-expat-installation-dir
For anyone else coming across this:
OP had to do this because they didn't have sudo access. If you do, usually you don't need to download the source of expat manually; installing via package manager is way easier. Unless the software you are compiling requires a newer version of expat than your RPM repos provide.
So for the RHEL family of OSes you can just do sudo <dnf|yum> install expat expat-devel, then proceed with what you were compiling.
Do you have the expat library installed? (Because that's where the expat.h comes from.)
https://libexpat.github.io/
If you cannot install it globally to the system, I'm sure Apache's ./configure script must have an option to support a custom location for the library as well.
Tried In Ubuntu
apt install libexpat1-dev
For RHEL, I would suggest #cyqsimon's answer
I tried to install Apache 2.4.12 from the installation page on the Apache website but to no avail. It said that I needed to install APR, APR-Util and Perl-Compatible Regular Expressions Library (PCRE). So I downloaded them and installed them, so I thought it still gave me an error I think that I am compiling something wrong so if someone could lead me in the right direction that would be great.
Thanks.
why don't you just use:
sudo apt-get install apache2
Cheers,
Nioidai
Please note that you should always install the latest version of a software for more security. I suggest you to install Apache from Ubuntu's apt package manager 'if you are on a production server'. Installing it from source on a local environment doesn't matter.
I've also been trying to do this lately.
Please follow this for the instructions of installing it, by me, with a bit more explanation.
Hope it helps.
To be clean, follow the same steps:
1) Go to http://httpd.apache.org/download.cgi
2) Right click and copy the link of the link like 'Source: httpd-2.4.41.tar.gz'
3) Go to the terminal, and enter the following commands one by one and hit enter for no confusion:
a.
cd /usr/local/src
b.
sudo wget -O- <download-link> | tar -zxf -
c.
sudo apt install libnghttp2 libpcre3 libssl build-essential -y
d. Go to http://apr.apache.org/download.cgi and copy the link like 'Unix Source: apr-1.7.0.tar.gz'
sudo wget -O- <apr-download-link> | tar -zxf -
e. Go to http://apr.apache.org/download.cgi and copy the link like 'Unix Source: apr-util-1.6.1.tar.gz'
sudo wget -O- <apr-util-download-link> | tar -zxf -
f.
sudo mv apr-<apr-version> httpd-<apache-version>/srclib/apr
g.
sudo mv apr-util-<apr-util-version> httpd-<apache-version>/srclib/apr-util
h.
cd httpd-<apache-version>
i. According to me, this configuration is better than any other. The --prefix is where apache is installed.
sudo ./configure --prefix=/usr/local/apache2 --enable-mods-shared="reallyall" --enable-mpms-shared="all"
j.
sudo make
k.
sudo make install
These directories could be altered using the Step 'i'
The apache directory is /usr/local/apache2.
The apache conf directory is /usr/local/apache2/conf.
The apache main conf file is /usr/local/apache2/conf/httpd.conf.
For more info go to http://httpd.apache.org/docs/current/install.html.
Thanks
When installing Apache on Ubuntu 11.10, I get the following error:
configure: error: APR not found. Please read the documentation.
I followed the instructions here, then, I get the error below:
configure: error: pcre-config for libpcre not found. PCRE is required and available from http://pcre.org/
What am I doing wrong and how can I resolve it?
1. Download PCRE from PCRE.org
2. Compile it with a prefix and install it:
./configure --prefix=/usr/local/pcre
make
make install
3. Go back to where your Apache installation is and compile Apache with PCRE:
--with-pcre=/usr/local/pcre
For me (Fedora Linux), it was enough to just install the pcre-devel: yum install -y pcre-devel. Didn't even have to use --with-pcre afterwards.
Debian
In a clean installation of Debian 9.5, during the installation of Apache it is necessary to have some packages and libraries to avoid errors. Next I show the type of error and its respective solution
Configuration
configure: error: no acceptable C compiler found in $PATH
$ sudo apt-get install build-essential
configure: error: pcre-config for libpcre not found. PCRE is required and available from http://pcre.org/
$ sudo apt-get install libpcre3-dev
Then I make the configuration indicating that it is installed in the path /usr/local and not in /usr/local/apache2, otherwise I will have library errors. The idea is that the libraries created for httpd end in /usr/local/lib so that the dynamic linker knows them.
$ configure --prefix /usr/local
Compilation
And for the compilation the following the installation of some packages also would avoid us errors in a clean installation of Debian.
xml/apr_xml.c:35:19: fatal error: expat.h: No such file or directory.
$ sudo apt-get install libexpat1-dev.
It is recommended to use the -j3 parameter to make the compilation faster. Although it could also be ignored.
$ make -j3
I was other problem compiling apache2 in CentOS with pcre. I installed pcre in other location "/custom/location/pcre" and configure command throw the following error
configure: error: Did not find pcre-config script at "/custom/location/pcre"
to solve it changing the flag --with-pcre=/custom/location/pcre to --with-pcre=/custom/location/pcre/bin/pcre2-config
BTW, on CentOS 7.6 before building httpd, please install pcre-devel
`$ sudo yum install pcre-devel`
In RHEL 3 is not necessary setting parameter --with-pcre pointing to pcre-config. Only need pcre path
My configure command:
./configure --prefix=/usr/local/apache2 --with-pcre=/usr/local/pcre
This worked for me:
sudo apt-get install libpcre3-dev
In ubuntu
This worked for me
./configure --prefix /u01/apache --with-included-apr --with-pcre=/usr/local/pcre/bin/pcre2-config