Having trouble installing mod_WSGI - can't find input file - mod-wsgi

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.

Related

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.

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

Configuration for Java binding for ZeroMQ (0MQ) with no root privileges on Linux

I am a novice with zeroMQ and I am stuck at binding ØMQ with java on a server running CentOS release 5.9.
Unfortunately, I do not have super user/root privileges on the server and am trying to install ØMQ as a normal user with restricted privileges. I have installed ØMQ by following instructions on http://www.zeromq.org/area:download
Make sure that libtool, autoconf, automake are installed.
Check whether uuid-dev package, uuid/e2fsprogs RPM or equivalent on your system is installed.
Unpack the .tar.gz source archive.
Run ./configure, followed by make.
Could not run the following obviously
To install ØMQ system-wide run sudo make install.
On Linux, run sudo ldconfig after installing ØMQ.
Then I attempted to install jzmq.
Cloned [git clone https://github.com/zeromq/jzmq.git]
Ran autogen.sh
Ran configure
At this point I get the following error
checking for ZeroMQ... no
checking zmq.h usability... no
checking zmq.h presence... no
checking for zmq.h... no
configure: error: cannot find zmq.h
As a result of the above error I am not able to run java tests and get error "no jzmq in java.library.path".
Can anybody help/direct me to how to get java binding for zeromq work when you dont have root privileges to install it? Its difficult to get IT department to install a new software on servers.
Appreciate your help.
Note: I do not have write permissions to /usr directory
Thanks
GBP
This can be overcome by adding --with-zeromq=/home/user/zeromq (installation directory of zeromq)
./configure --with-zeromq=/home/user/zeromq
Other steps include
export LD_LIBRARY_PATH=/home/user/zeromq/lib
You can also use JeroMQ (https://github.com/zeromq/jeromq) which is a pure Java implementation of ZeroMQ
I got this working by running autogen.sh on OEL 6 then running configure / compiling / installing on CentOS 5.9. I briefly looked into why autogen.sh was failing and the problem was the tool chain was too old. Since I had a more up-to-date system with a modern tool chain available running autogen.sh on something other than CentOS 5 was the easiest path for me. I'm sure it works fine with other modern Linux variants, I had OEL 6 at my finger tips.
I also did not have access to a standard directory for installation. To get that working I added zmq.jar to my class path, and the run-time linker needed to be able to find the zeromq and jzmq run-time libraries.
I faced the same issue on CentOS 6.5 and found that you need to install "gcc-c++" for this to work.
I used the following to install dependencies:
yum -y install jdk zeromq-devel unzip libtool gcc autoconf automake gcc-c++ python
Note that "jdk" comes from our private repository and it's same what can be downloaded from java.com
The following public repositories are installed on server:
atomic
Actually, I ended up having this same issue, and the following script worked for me, where I installed zeromq into ~ (so that I have ~/lib contains libzmq.a libzmq.la libzmq.so libzmq.so.3 libzmq.so.3.1.0 pkgconfig)
./autogen.sh ./configure --prefix=$HOME \ #because you don't have root privileges
--with-zeromq=$HOME --includedir=$HOME/include/ --libdir=$HOME/lib/
./make
./make -n install
#to check to see if it installs it to the right location
make install

Passenger/Apache missing gcc/zlib-devel on AWS/CENTOS

I am trying to install Passenger for Apache on an AWS instance running CENTOS. When I try to install it, it tells me:
GNU C++ compiler... not found
Zlib development headers... not found
These have both been installed (yum install gcc zlib-devel) and are at the latest version. gcc -v says that it's at 4.6.2.
I have seen similar questions where the accepted answer was to run
mount -o remount,rw,exec,nosuid /tmp
This returns the following:
mount: can't find /tmp in /etc/fstab or /etc/mtab
I have tried changing the permissions on the /tmp directory (it does exist, just doesn't appear to be mounted) with chmod 777 /tmp, but this did not allow the Passenger install to see the two packages.
Could someone please help me with this? I'm not sure what else to do at this point.
I couldn't solve the issue above, but I managed to install anyway by adding EPEL, then installing mod_passenger through yum:
rpm -Uvh http://ftp.linux.ncsu.edu/pub/epel/6/i386/epel-release-6-8.noarch.rpm
yum install mod_passenger

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