Apache installation; libpcre error - apache

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

Related

Installing janus-gateway error on CentOS7

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

Cmake can't find CMAKE_ROOT

Cmake throws an error
CMake Error: Could not find CMAKE_ROOT !!!
CMake has most likely not been installed correctly.
Modules directory not found in
CMake Error: Error executing cmake::LoadCache(). Aborting.`
Tried everything I could find out there to fix (Creating environment variable to path of installation, reinstalling, installing from source code) but none of these worked, I also tried running it on bash (I usually use zsh) but still no results
I had to re-install my cmake to correct this same error.
sudo apt-get remove cmake cmake-data
sudo -E add-apt-repository -y ppa:george-edison55/cmake-3.x
sudo -E apt-get update
sudo apt-get install cmake
Try the following command:
hash -r
It is ok under Ubuntu.

Not able to install mod_perl module on the server

In my site I am getting an error : an error occurred while processing this directive
It was working fine before moving to the new server. So when I checked I found that mod_perl module is missing. So I tried to install it by downloading the module to the server and then tried to run using Perl Makefile.pl but it was asking for apache src and I was not able to find it. I can see /usr/bin/apache/ folder but no source file inside the folder.
So I tried to install the module from Cpanel but I got the following error:
The C compiler is not functional and auto repair failed. Perl module installs require a working C compiler. Please repair the C compiler and try again.
Please let me know how to install it as I have tried most of the cases searching the net.
Thanks in advance
It's probably best to use your distro's packaging system to install mod_perl, especially, if apache is installed from a package too.
Yum based systems:
yum install mod_perl
Deb based systems
apt-get install mod_perl
you may need to enable the module using a2enmod
Mostly gcc is either corrupted or not present on your system. Please try to re/install gcc on your system
sudo apt-get update
sudo apt-get install build-essential
On Redhat:
yum update
yum install devtoolset-2-toolchain
It seems like a problem with your installation of gcc. You're using CloudLinux, so you should use yum to reinstall gcc.
$ sudo -i yum install gcc
But you don't need gcc if you install the pre-build packages.
$ sudo -i yum install mod_perl
Either way, you're going to need to get to grips with package installation for your system - and for that you're going to need root access.

Troubles installing Apache2 from source Redhat 6

I am trying to install the most current Apache version. I ran configure:
./configure --prefix=/usr/local/apache --enable-so --with-pcre=../pcre2-10.00/pcre2-config
But I then got this error message:
util_pcre.c:49:18: error: pcre.h: No such file or directory
util_pcre.c: In Function 'ap_regfree':
util_pcre.c:104: error: 'pcre_free' undeclared (first use in this function)
util_pcre.c:104: error: (Each undeclared identifier is reported only once
util_pcre.c:104: error: for each function it appears in.)....
I read that I would need to have gcc installed. And I have verified that gcc is installed. Do I need to declare it somewhere in the ./configure command? Thanks in advance!
Try to install pcre devel
yum install pcre-devel
and then run your previous code without pcre part
./configure --prefix=/usr/local/apache --enable-so
Hope this can help you.
As at version 2.4.25 of Apache it doesn't appear that you can compile with pcre2. You can either do what Milos Miskone Sretin suggests and use yum to install the pcre development headers or if you want to potentially have multiple versions of pcre then you have to compile and install pcre 8.40 and link against it instead.
Assuming you have installed pcre 8.40 into /usr/local/apps/pcre/8.40 then
./configure --prefix=/usr/local/apache --enable-so --with-pcre=/usr/local/apps/pcre/8.40
seems you are using pcre2 instead of pcre. Download and re-compile with PCRE.
because PCRE2 is the name used for a revised API for the PCRE library.

Issues installing mod_wsgi - cannot find Makefile.in

I'm trying to rebuild mod_wsgi and am running into this issue? Does anyone know what's going on here?
/tmp/mod_wsgi-3.4# ls
config.log LICENCE posix-ap2X.mk.in win32-ap22py31.mk
config.status Makefile.in README
configure mod_wsgi.c win32-ap22py26.mk
configure.ac posix-ap1X.mk.in win32-ap22py27.mk
root#vps-547073:/tmp/mod_wsgi-3.4# ./configure
checking for apxs2... no
checking for apxs... no
checking Apache version... ./configure: line 1704: apxs: command not found
./configure: line 1704: apxs: command not found
./configure: line 1705: apxs: command not found
./configure: line 1708: /: Is a directory
checking for python... /usr/bin/python
./configure: line 1877: apxs: command not found
configure: creating ./config.status
config.status: error: cannot find input file: Makefile.in
See the mod_wsgi instructions:
http://code.google.com/p/modwsgi/wiki/QuickInstallationGuide#Apache_Requirements
It says:
On Linux systems, if Apache has been installed from a package
repository, you must have installed the corresponding Apache "dev"
package as well.
For most Linux distributions, the "dev" package for Apache 2.X is
"apache2-dev" where the corresponding Apache package was "apache2".
Some systems however distinguish the "dev" package based on which MPM
is used by Apache. As such, it may also be called "apache2-worker-dev"
or "apache2-prefork-dev". If using Apache 2.X, do not mix things up
and install "apache-dev" by mistake, which is the "dev" package for
Apache 1.3 called just "apache".
You are missing that dev package for Apache. This is why 'apxs' cannot be found and subsequent issues occur.
Try to install apache-dev. Use below command in terminal to install.
sudo yum install httpd-devel
OR
Ubuntu/Debian: sudo apt-get install apache2-dev