While apachectl start getting open shared object file - apache

I try to install apache webserver using tar file. So, I have download httpd-2.4.tar file and extract.
then, I try to install
1. ./configure --prefix=/usr/local/apache
but, throw, this error
configure: error: APR not found. Please read the documentation.
configure: error: pcre-config for libpcre not found. PCRE is required and available from http://pcre.org/
so, follow this link and fix this issue1 and issue2
Then, run following command:
1. $./configure \
--with-included-apr \
--with-pcre=/usr/local/pcre/bin/pcre-config \
--prefix=/usr/local/apache
2. $ make
3. $ make install
After that / I go to /usr/local/apache/
Start the Service:
$ bin/apachectl -k start
Throw below error:
httpd: Syntax error on line 66 of /usr/local/apache/conf/httpd.conf: Cannot load modules/mod_authn_file.so into server: /usr/local/apache/modules/mod_authn_file.so: cannot open shared object file: No such file or directory
go to apache/modules/
*.so files not there, only *.a and *.la file are there,
Reference:
I follw this link to Search *.so files , is not there. So, I resinstalled but same issue only create *.la and *.a files instead of *.so files,
Then, I try to change /apache/conf/httpd.conf
LoadModule authn_core_module modules/mod_authn_core.so to LoadModule authn_core_module modules/mod_authn_core.la
after Change,
httpd: Syntax error on line 66 of /usr/local/apache/conf/httpd.conf: Cannot load modules/mod_authn_file.la into server: /usr/local/apache/modules/mod_authn_file.la: invalid ELF header
Suggest me, How can i fix this issue and why, create *.a, *.la file instead of *.so.
*.so files updated to *.la files?, if latest means why cannot support?

Where did you untar the source for httpd? Also that name "httpd-2.4.tar" certainly does not sound as an official download.
In any case, .la and .a files come with the source, they are not modules, you can view them with vim to see what they are (at least the .la files)
Follow these steps:
* Download from the original source: http://httpd.apache.org/download.cgi
* Untar onto ~/source-httpd/
* cd ~/source-httpd/
* rm -Rf /usr/local/apache (or whatever you had there)
* ./configure --prefix=/usr/local/apache --enable-mpms-shared=all --with-mpm=event --enable-mods-shared=all (.... and any other options)
* Review the ouput for missing libs and functionality you may need, install necessary lips and run "configure" again with the same parameters or adjusted to your needs
* make && make install
* ls -l /usr/local/apache/modules to check the .so files are really there.
* Configure and run httpd accordingly

Related

Torque installation error: #sbindir#/trqauthd: No such file or Directory

I gave the following commands to install (in root login) the Torque:
./configure
make
make install
After that, I tried to run Torque daemon using:
cp contrib/init.d/trqauthd.in /etc/init.d/trqauthd
chkconfig --add trqauthd
echo /usr/local/lib > /etc/ld.so.conf.d/torque.conf
ldconfig
service trqauthd start
And I am getting the following error:
Starting TORQUE Authorization Daemon: /bin/bash: #sbindir#/trqauthd: No such file or directory
Can you please help?
Wrong file. You want the "trqauthd" file. trqauthd.in is the unprocessed pre-make file.

automake-1.13: command not found

I was try to install Apache 2.4.
This requires apr, apr-util and pcre.
I was trying to configure pcre. I use the below command inside pcre directory :
$ ./configure --prefix=/usr/httpd*/srclib/pcre/
after this,
$ make
Output is like this :
cd . && /bin/sh /usr/httpd-2.4.9/srclib/pcre-8.33/missing automake-1.13 --gnu Makefile
/usr/httpd-2.4.9/srclib/pcre-8.33/missing: line 81: automake-1.13: command not found
WARNING: 'automake-1.13' is missing on your system.
You should only need it if you modified 'Makefile.am' or
'configure.ac' or m4 files included by 'configure.ac'.
The 'automake' program is part of the GNU Automake package:
http://www.gnu.org/software/automake
make: * [Makefile.in] Error 127
I tried configuring automake 1.13, but it didn't worked for me and I do not have permission to do something in root directory.
Please help !
Thank you in advance.
I found a workaround here: https://github.com/hyperrealm/libconfig/issues/22
Run these so to keep the executables that are being issues from running:
make AUTOCONF=: AUTOHEADER=: AUTOMAKE=: ACLOCAL=:
make install AUTOCONF=: AUTOHEADER=: AUTOMAKE=: ACLOCAL=:
I'm still having issues with the pcre-config but I'm pretty sure that's network time issue for me.

rpmbuild: Installed (but unpackaged) file(s) found - Multiple options tried

This is getting rather maddening - I'm trying to build an RPM out of some BASH scripts which work as Nagios plugins. I keep getting:
error: Installed (but unpackaged) file(s) found:
/usr/lib64/nagios/plugins/netappassigncheck
/usr/lib64/nagios/plugins/netappassignprep
In the %files directive of my spec file I have tried most of the combos that have been suggested here and on various other internet forums:
/usr/lib/nagios/plugins/*
/usr/lib/nagios/plugins/netappassigncheck
/usr/lib/nagios/plugins/netappassignprep
%dir /usr/lib/nagios/plugins/
And currently I am on
%dir %{_libdir}/nagios/plugins/
This is why my most recent error output is lib64, previous errors when quoting the full path were /usr/lib/...
These are the only 2 files that should make up the package as well.
Here is my .spec file
Name: netappautoassign
Summary: A set of Nagios Plugins for automatically assigning disks to a Netapp
Version: 1.0
Release: 1
License: %{license}
Group: Applications/System
Source: %{source}
URL: Reserved
Vendor: %{vendor}
Packager: %{packager}
BuildArch: noarch
Requires: bash, grep, util-linux, coreutils, expect, openssh-clients, bc, sed
Provides: netappassignprep, netappassigncheck
%description
Since Netapp's autoassign function may lead to disks being assigned to the
wrong head these NAGIOS plugins will ensure disks are added to the correct
head when replaced.
%prep
%setup -q
%build
%install
rm -rf %{buildroot}
install -d %{buildroot}%{_libdir}/nagios/plugins
cp netappassigncheck %{buildroot}%{_libdir}/nagios/plugins/
cp netappassignprep %{buildroot}%{_libdir}/nagios/plugins/
%files
%defattr(755,root,root,755)
%dir %{_libdir}/nagios/plugins/
%clean
rm -rf %{buildroot}
%post
And here's my ~/.rpmmacros
%_topdir %(echo $HOME)/rpmbuild
%_tmppath %{_topdir}/tmp
%buildroot %{_tmppath}/%{name}-%{version}
%license RESERVED
%source %{name}-%{version}.tar.gz
%vendor REDACTED
%packager REDACTED
EDIT - SOLVED
I'm not sure if this is a bug or desired behaviour, but it would appear that during the build setion the %{buildroot} variable was not being read in from .rpmmacros Having moved this variable into the main spec file the RPM is now built.
I'm not sure if this is a bug or desired behaviour, but it would appear that during the file verification section, it was reading in all the current active plugins under the root file system and not the %{buildroot}.
I suspected that the %{buildroot} variable was not being read in from .rpmmacros at this stage, although it was for all other stages.
I moved the declaration of %{buildroot} into my main .spec file and the build is now working!

installing mod_headers on Linux, apache 2.2.21

Trying to install the mod_headers to be able to append a HTTP header with the Header directive. But the installation process doesn't show the header module as being installed.
Did the following steps. Switched over to the httpd installation and under the modules/metadata directory did:
apxs -c mod_headers.c
the so file is created under the metadata/.libs directory (not sure why). Added the module with:
apxs -i -a -n mod_headers ./metadata/.libs/mod_headers.so
Restarted apache and tried a dump of the modules but getting:
httpd: Syntax error on line 54 of /www/fkwiki/apache/conf/httpd.conf: Can't locate API module structure `mod_headers' in file /www/fkwiki/apache/modules/mod_headers.so: /www/fkwiki/apache/modules/mod_headers.so: undefined symbol: mod_headers
Got a warning in the installation of the module (i.e. apxs -i ....):
Warning! dlname not found in /www/fkwiki/apache/modules/mod_headers.so
Anybody else have the same problem?

Autoconf macros for Apache and conf.d install process?

I have a package that is using the autotools to build and install.
Part of the package is a website that can be run on the local machine.
So in the package there is a .conf file that is meant to be either
copied or linked to the /etc/apache2/conf.d directory. What's the
standard way that packages would do this? If possible, I'd like for
the user not to have an extra step to make the website work. I'd like
to have them install the package and then be able to browse to
http://localhost/newpackage to get up and running.
Also, is there a way that autoconf knows about the apache install or a
standard way through then environment some how? If someone could
point me in the right direction that would be great.
Steve
The first thing you should do is to locate the apache extension tool apxs or apxs2 (depends on apache version and/or platform you are building for). After you know where your tool is located you can run queries to get certain apache config params. For example to get system config dir you can run:
apxs2 -q SYSCONFDIR
Here is a snippet of how you can locate apache extension tool: (be careful it may contain syntax errors)
dnl Note: AC_DEFUN goes here plus other stuff
AC_MSG_CHECKING(for apache APXS)
AC_ARG_WITH(apxs,
[AS_HELP_STRING([[--with-apxs[=FILE]]],
[path to the apxs, defaults to "apxs".])],
[
if test "$withval" = "yes"; then
APXS=apxs
else
APXS="$withval"
fi
])
if test -z "$APXS"; then
for i in /usr/sbin /usr/local/apache/bin /usr/bin ; do
if test -f "$i/apxs2"; then
APXS="$i/apxs2"
break
fi
if test -f "$i/apxs"; then
APXS="$i/apxs"
break
fi
done
fi
AC_SUBST(APXS)
The way to use APXS in your automake Makefile.am would look something like this:
## Find apache sys config dir
APACHE2_SYSCONFDIR = `#APXS# -q SYSCONFDIR`
## Misc automake stuff goes here
install: install-am
cp my.conf $(DESTDIR)${APACHE2_SYSCONFDIR}/conf.d/my.conf
I assume you are familiar with automake and autoconf tools.