Issues installing mod_wsgi - cannot find Makefile.in - mod-wsgi

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

Related

How to install mod_wsgi for apache2.4 with python 3.6 in centos?

I am a new to web development.I have created Django(-v 2.2) web application and I want to deploy it on my linux server(OS Centos).After installation apache2, when I was going to install libapache2-mod-wsgi-py3, it says that no package available. Is there different name for libapache2-mod-wsgi-py3 for OS Centos?
It is always recommended to install mod_wsgi directly into the python3 package using pip3.
pip3 install mod_wsgi
If you install mod_wsgi into the OS, it could cause conflict and unexpected behavior.
Do you have apache2-dev installed?
Also, for mod_wsgi it is better to go the CMMI path (configure-make-make install) in order to compile it with the correct version and load it in Apache as a module. This worked for me on Debian VPS:
To do so,
wget https://github.com/GrahamDumpleton/mod_wsgi/archive/4.6.5.tar.gz
tar xvfz 4.6.5.tar.gz
cd mod_wsgi-4.6.5
whereis apxs
whereis python3
./configure --with-apxs=/usr/bin/apxs --with-python=/usr/bin/python3.5
make
sudo make install
Double check the path for apxs and python, and run make install as sudo.
When it’s all ready, check the last line of prompt results, as there will be a path to a file: /usr/lib/apache2/modules/mod_wsgi.so
To cleanup after installation, run:
make clean
If you need to build the module for a different version of Apache, you should run:
make distclean
If you have a httpd.conf file, you should edit and add this line:
LoadModule wsgi_module /usr/lib/apache2/modules/mod_wsgi.so
If not, create it and paste that line, and edit /etc/apache2/apache2.conf. file, by adding this line:
Include /etc/apache2/httpd.conf
You don't need that file to configure apache, but you can create it if other software relies on it being there.
You should restart Apache and check the log
sudo tail /var/log/apache2/error.log
as there should be a line that says:
Apache/2.4.25 (Debian) mod_wsgi/4.6.5 Python/3.5 configured -- resuming normal operations

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.

cannot install libapache2-mod-fcgid apache mod

hello i trying to install libapache2-mod-fcgid mod but have always get error.
root#mail:~# sudo apt-get install libapache2-mod-fcgid
Reading package lists... Done
Building dependency tree
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:
The following packages have unmet dependencies:
libapache2-mod-fcgid : Depends: apache2.2-common but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
and without fcgid mod i cannot launch apache server
root#mail:~# service apache2 restart
* Restarting web server apache2 [fail]
* The apache2 configtest failed.
Output of config test was:
apache2: Syntax error on line 140 of /etc/apache2/apache2.conf: Syntax error on line 1 of /etc/apache2/mods-enabled/fcgid.load: Cannot load /usr/lib/apache2/modules/mod_fcgid.so into server: /usr/lib/apache2/modules/mod_fcgid.so: cannot open shared object file: No such file or directory
Action 'configtest' failed.
The Apache error log may have more information.
apache version 2.4
This worked for me: Ubuntu 21.10 in year 2022:
sudo apt-get install -y libapache2-mod-fcgid
I know it is a bit late for a response but, since there is no answer yet, I'll put one.
In this situation, the dependencies from libapache2-mod-fcgid are not met. In this case, you could download and install apache2.2-common prior the installation of libapache2-mod-fcgid like this:
sudo apt-get install apache2.2-common
and then try your install command afterward.

Apache installation; libpcre error

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

Having trouble installing mod_WSGI - can't find input file

I'm trying to set up mod_wsgi for use with Django. I have apache2, apache2-dev, python2.6, python2.6-dev all installed, but I'm getting this error when running configure:
checking for apxs2... /usr/bin/apxs2
checking Apache version... 2.2.14
checking for python... /usr/bin/python
configure: creating ./config.status
config.status: error: cannot find input file: Makefile.in
Thanks for the help!
I had the exact same problem. Installing the apache2-dev package solved it.
sudo apt-get install apache2-dev
I don't think the asker needs this answer anymore, so I answered for future readers with similar problems
Install apache2-threaded-dev:
$ sudo apt-get install apache2-threaded-dev
I started writing that you may need to ensure that you have axps installed (you can do this by installing the apache2-dev package). but I notice that configure already found axps. I had a similar problem but configure was bailing on not finding this dependency. Maybe some similar dependency or write permissions.
You are running the mod_WSGI 'configure' script in the mod_WSGI source code directory aren't you? Ie., in the same directory as the Makefile.in file that comes with the source tar ball.
mod_wsgi's configure script uses apxs to find the path to httpd:
apxs -q SBINDIR
apxs -q TARGET
Combine those with a "/" and add "-v", e.g.,
/blah/bin/httpd -v
That should run without an error. If it does not then mod_wsgi's configure script can't figure out the httpd version and you will get a broken symbolic link for Makefile.in.
For me, libpcre.so.0 wasn't in the LD_LIBRARY_PATH. Doing this:
export LD_LIBRARY_PATH=/usr/local/lib
then reconfiguring mod_wsgi and building fixed the problem.