Ubuntu: error while building apache



Question:

I am using following code to build apache.

apt-get install -y git \  openssl \  subversion \  autoconf \  libtool-bin \  libapr \  libapr-util \  make \  libpcre3-dev \  libpcre++-dev \  libxml2-dev \  libnghttp2-dev\  libexpat1-dev \  libxml2-dev \  python-pip \  python-virtualenv \  python      git clone https://github.com/apache/httpd.git    cd httpd    svn co http://svn.apache.org/repos/asf/apr/apr/trunk srclib/apr && cd srclib/apr && ./buildconf && ./configure && make && make install  

Got the following error

checking Expat 1.0/1.1... no<br/>    setting LDFLAGS to "-L/usr/local/lib"<br/>    setting INCLUDES to "-I/usr/local/include"<br/>  checking Expat 1.95.x in /usr/local... no<br/>    nulling LDFLAGS<br/>    nulling INCLUDES<br/>    setting APRUTIL_EXPORT_LIBS to ""<br/>  ^[[91mconfigure: error: No XML parser found!  Please specify --with-expat or --with-libxml2<br/>  

Can any help me in resolving the issue


Solution:1

You may download this library package:

apt-get download libexpat1-dev

Then unpack it:

ar x libexpat1-dev_version_.deb  tar xf data.tar.gz  

Then find expat.h header files and copy them into /usr/include:

find . -name expat*.h -exec cp {} /usr/include/ \;

Then find libexpat.so and copy it into /usr/lib:

find . -name libexpat.so -exec cp {} /usr/lib/ \;

Then configure Apache

./configure


Solution:2

Make sure you have installed libxml2 installed else install it with

sudo apt-get install libxml2 libxml2-dev

And then before executing configure from source do as ./configure --with-libxml2=/usr/lib

Then execute this command

svn co http://svn.apache.org/repos/asf/apr/apr/trunk srclib/apr && cd srclib/apr && ./buildconf && ./configure && make && make install

Hope it helps.


Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com
Previous
Next Post »