Linux - Server This forum is for the discussion of Linux Software used in a server related context.
Notices
Welcome to
LinuxQuestions.org , a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free.
Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please
contact us . If you need to reset your password,
click here .
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a
virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month.
Click here for more info.
02-21-2012, 03:53 PM
#1
LQ Newbie
Registered: Jun 2008
Posts: 28
Rep:
Compiling HTTPD 2.2.22 RPM - error
Hi,
I'm using CentOS 6.2 x86_64 for my production environment. Not going into the finer details, we're using Apache, and I'd like to remain on the latest stable release. That means I have to compile my own since the CentOS out-of-box is 2.2.15
I've been attempting to compile the RPM for the latest version (2.2.22), and I'm running into an error, which I haven't been able to resolve, hence the post.
Here is what I see when compiling:
Code:
/usr/lib64/apr/build-1/libtool --silent --mode=link gcc -pthread -O2 -g -pie -L/usr/lib6464 -o htpasswd htpasswd.lo -lm -lpcre -lselinux /usr/lib64/libaprutil-1.la /usr/lib64/libapr-1.la -lcrypt
/usr/lib64/apr/build-1/libtool --silent --mode=link gcc -pthread -O2 -g -pie -L/usr/lib6464 -o htdigest htdigest.lo -lm -lpcre -lselinux /usr/lib64/libaprutil-1.la /usr/lib64/libapr-1.la
/usr/bin/ld: cannot find -luuid
collect2: ld returned 1 exit status
/usr/bin/ld: cannot find -luuid
collect2: ld returned 1 exit status
make[2]: *** [htdigest] Error 1
make[2]: *** Waiting for unfinished jobs....
make[2]: *** [htpasswd] Error 1
make[2]: Leaving directory `/home/wills/rpmbuild/BUILD/httpd-2.2.22/prefork/support'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/wills/rpmbuild/BUILD/httpd-2.2.22/prefork/support'
make: *** [all-recursive] Error 1
error: Bad exit status from /var/tmp/rpm-tmp.Ap5Hmy (%build)
I'm attaching the httpd.spec, which I acquired from a third-party (CentOSALT) source RPM:
Code:
%define contentdir /var/www
%define suexec_caller apache
%define mmn 20051115
%define vstring CentOS
%define mpms worker event itk
%define _default_patch_fuzz 2
Summary: Apache HTTP Server
Name: httpd
Version: 2.2.22
Release: 1%{?dist}
URL: http://httpd.apache.org/
Source0: http://www.apache.org/dist/httpd/httpd-%{version}.tar.bz2
Source1: index.html
Source3: httpd.logrotate
Source4: httpd.init
Source5: httpd.sysconf
Source10: httpd.conf
Source11: ssl.conf
Source12: welcome.conf
Source13: manual.conf
Source14: proxy_ajp.conf
# Documentation
Source33: README.confd
# build/scripts patches
Patch1: httpd-2.1.10-apctl.patch
Patch2: httpd-2.1.10-apxs.patch
Patch3: httpd-2.2.9-deplibs.patch
Patch4: httpd-2.1.10-disablemods.patch
Patch5: httpd-2.1.10-layout.patch
# Features/functional changes
Patch20: httpd-2.0.48-release.patch
Patch21: httpd-2.0.40-xfsz.patch
Patch22: httpd-2.1.10-pod.patch
Patch23: httpd-2.0.45-export.patch
Patch24: httpd-2.0.48-corelimit.patch
Patch25: httpd-2.0.54-selinux.patch
Patch26: httpd-2.2.9-suenable.patch
# Bug fixes
Patch54: httpd-2.2.0-authnoprov.patch
# ITK patch http://mpm-itk.sesse.net
Patch101: 01-copy-prefork.patch
Patch102: 02-rename-prefork-to-itk.patch
Patch103: 03-add-mpm-to-build-system.patch
Patch104: 04-correct-output-makefile-location.patch
Patch105: 05-add-copyright.patch
Patch106: 06-hook-just-after-merging-perdir-config.patch
Patch107: 07-base-functionality.patch
Patch108: 08-max-clients-per-vhost.patch
Patch109: 09-capabilities.patch
Patch110: 10-nice.patch
Patch111: 11-fix-htaccess-reads-for-persistent-connections.patch
License: ASL 2.0
Group: System Environment/Daemons
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
BuildRequires: autoconf, perl, pkgconfig, findutils, ed
BuildRequires: db4-devel, expat-devel, zlib-devel, libselinux-devel
BuildRequires: apr-devel >= 1.2.0, apr-util-devel >= 1.2.0, pcre-devel >= 5.0
Requires: initscripts >= 8.36, /etc/mime.types, system-logos >= 7.92.1-1
Obsoletes: httpd-suexec
Requires(pre): /usr/sbin/useradd
Requires(post): chkconfig
Provides: webserver
Provides: mod_dav = %{version}-%{release}, httpd-suexec = %{version}-%{release}
Provides: httpd-mmn = %{mmn}
Obsoletes: apache, secureweb, mod_dav, mod_gzip, stronghold-apache
Obsoletes: stronghold-htdocs, mod_put, mod_roaming
Conflicts: pcre < 4.0
Requires: httpd-tools = %{version}-%{release}, apr-util-ldap
%description
The Apache HTTP Server is a powerful, efficient, and extensible
web server.
%package devel
Group: Development/Libraries
Summary: Development interfaces for the Apache HTTP server
Obsoletes: secureweb-devel, apache-devel, stronghold-apache-devel
Requires: apr-devel, apr-util-devel, pkgconfig
Requires: httpd = %{version}-%{release}
%description devel
The httpd-devel package contains the APXS binary and other files
that you need to build Dynamic Shared Objects (DSOs) for the
Apache HTTP Server.
If you are installing the Apache HTTP server and you want to be
able to compile or develop additional modules for Apache, you need
to install this package.
%package manual
Group: Documentation
Summary: Documentation for the Apache HTTP server
Requires: httpd = %{version}-%{release}
Obsoletes: secureweb-manual, apache-manual
%description manual
The httpd-manual package contains the complete manual and
reference guide for the Apache HTTP server. The information can
also be found at http://httpd.apache.org/docs/2.2/.
%package tools
Group: System Environment/Daemons
Summary: Tools for use with the Apache HTTP Server
%description tools
The httpd-tools package contains tools which can be used with
the Apache HTTP Server.
%package -n mod_ssl
Group: System Environment/Daemons
Summary: SSL/TLS module for the Apache HTTP Server
Epoch: 1
BuildRequires: openssl-devel
Requires(post): openssl >= 0.9.7f-4, /bin/cat
Requires: httpd = 0:%{version}-%{release}, httpd-mmn = %{mmn}
Obsoletes: stronghold-mod_ssl
%description -n mod_ssl
The mod_ssl module provides strong cryptography for the Apache Web
server via the Secure Sockets Layer (SSL) and Transport Layer
Security (TLS) protocols.
%prep
%setup -q
%patch1 -p1 -b .apctl
%patch2 -p1 -b .apxs
%patch3 -p1 -b .deplibs
%patch4 -p1 -b .disablemods
%patch5 -p1 -b .layout
%patch21 -p0 -b .xfsz
%patch22 -p1 -b .pod
%patch23 -p1 -b .export
%patch24 -p1 -b .corelimit
%patch25 -p1 -b .selinux
%patch26 -p1 -b .suenable
%patch54 -p1 -b .authnoprov
%patch101 -p1 -b .01-copy-prefork
%patch102 -p1 -b .02-rename-prefork-to-itk
%patch103 -p1 -b .03-add-mpm-to-build-system
%patch104 -p1 -b .04-correct-output-makefile-location
%patch105 -p1 -b .05-add-copyright
%patch106 -p1 -b .06-hook-just-after-merging-perdir-config
%patch107 -p1 -b .07-base-functionality
%patch108 -p1 -b .08-max-clients-per-vhost
%patch109 -p1 -b .09-capabilities
%patch110 -p1 -b .10-nice
%patch111 -p1 -b .11-fix-htaccess-reads-for-persistent-connections
# Patch in vendor/release string
sed "s/@RELEASE@/%{vstring}/" < %{PATCH20} | patch -p1
# Safety check: prevent build if defined MMN does not equal upstream MMN.
vmmn=`echo MODULE_MAGIC_NUMBER_MAJOR | cpp -include include/ap_mmn.h | sed -n '/^2/p'`
if test "x${vmmn}" != "x%{mmn}"; then
: Error: Upstream MMN is now ${vmmn}, packaged MMN is %{mmn}.
: Update the mmn macro and rebuild.
exit 1
fi
: Building with MMN %{mmn} and vendor string '%{vstring}'
%build
# forcibly prevent use of bundled apr, apr-util, pcre
rm -rf srclib/{apr,apr-util,pcre}
# regenerate configure scripts
autoheader && autoconf || exit 1
# Before configure; fix location of build dir in generated apxs
%{__perl} -pi -e "s:\@exp_installbuilddir\@:%{_libdir}/httpd/build:g" \
support/apxs.in
CFLAGS=$RPM_OPT_FLAGS
SH_LDFLAGS="-Wl,-z,relro"
export CFLAGS SH_LDFLAGS
# Hard-code path to links to avoid unnecessary builddep
export LYNX_PATH=/usr/bin/links
function mpmbuild()
{
mpm=$1; shift
mkdir $mpm; pushd $mpm
../configure \
--prefix=%{_sysconfdir}/httpd \
--exec-prefix=%{_prefix} \
--bindir=%{_bindir} \
--sbindir=%{_sbindir} \
--mandir=%{_mandir} \
--libdir=%{_libdir} \
--sysconfdir=%{_sysconfdir}/httpd/conf \
--includedir=%{_includedir}/httpd \
--libexecdir=%{_libdir}/httpd/modules \
--datadir=%{contentdir} \
--with-installbuilddir=%{_libdir}/httpd/build \
--with-mpm=$mpm \
--with-apr=%{_prefix} --with-apr-util=%{_prefix} \
--enable-suexec --with-suexec \
--with-suexec-caller=%{suexec_caller} \
--with-suexec-docroot=%{contentdir} \
--with-suexec-logfile=%{_localstatedir}/log/httpd/suexec.log \
--with-suexec-bin=%{_sbindir}/suexec \
--with-suexec-uidmin=500 --with-suexec-gidmin=100 \
--enable-pie \
--with-pcre \
$*
make %{?_smp_mflags}
popd
}
# Build everything and the kitchen sink with the prefork build
mpmbuild prefork \
--enable-mods-shared=all \
--enable-ssl --with-ssl \
--enable-proxy \
--enable-cache --enable-mem-cache \
--enable-file-cache --enable-disk-cache \
--enable-ldap --enable-authnz-ldap \
--enable-cgid \
--enable-authn-anon --enable-authn-alias \
--disable-imagemap
# For the other MPMs, just build httpd and no optional modules
for f in %{mpms}; do
mpmbuild $f --enable-modules=none
done
%install
rm -rf $RPM_BUILD_ROOT
pushd prefork
make DESTDIR=$RPM_BUILD_ROOT install
popd
# install alternative MPMs
for f in %{mpms}; do
install -m 755 ${f}/httpd $RPM_BUILD_ROOT%{_sbindir}/httpd.${f}
done
# install conf file/directory
mkdir $RPM_BUILD_ROOT%{_sysconfdir}/httpd/conf.d
install -m 644 $RPM_SOURCE_DIR/README.confd \
$RPM_BUILD_ROOT%{_sysconfdir}/httpd/conf.d/README
for f in ssl.conf welcome.conf manual.conf proxy_ajp.conf; do
install -m 644 -p $RPM_SOURCE_DIR/$f \
$RPM_BUILD_ROOT%{_sysconfdir}/httpd/conf.d/$f
done
rm $RPM_BUILD_ROOT%{_sysconfdir}/httpd/conf/*.conf
install -m 644 -p $RPM_SOURCE_DIR/httpd.conf \
$RPM_BUILD_ROOT%{_sysconfdir}/httpd/conf/httpd.conf
mkdir $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig
install -m 644 -p $RPM_SOURCE_DIR/httpd.sysconf \
$RPM_BUILD_ROOT%{_sysconfdir}/sysconfig/httpd
# for holding mod_dav lock database
mkdir -p $RPM_BUILD_ROOT%{_localstatedir}/lib/dav
# create a prototype session cache
mkdir -p $RPM_BUILD_ROOT%{_localstatedir}/cache/mod_ssl
touch $RPM_BUILD_ROOT%{_localstatedir}/cache/mod_ssl/scache.{dir,pag,sem}
# create cache root
mkdir $RPM_BUILD_ROOT%{_localstatedir}/cache/mod_proxy
# move utilities to /usr/bin
mv $RPM_BUILD_ROOT%{_sbindir}/{ab,htdbm,logresolve,htpasswd,htdigest} \
$RPM_BUILD_ROOT%{_bindir}
# Make the MMN accessible to module packages
echo %{mmn} > $RPM_BUILD_ROOT%{_includedir}/httpd/.mmn
# docroot
mkdir $RPM_BUILD_ROOT%{contentdir}/html
install -m 644 -p $RPM_SOURCE_DIR/index.html \
$RPM_BUILD_ROOT%{contentdir}/error/noindex.html
# remove manual sources
find $RPM_BUILD_ROOT%{contentdir}/manual \( \
-name \*.xml -o -name \*.xml.* -o -name \*.ent -o -name \*.xsl -o -name \*.dtd \
\) -print0 | xargs -0 rm -f
# Strip the manual down just to English and replace the typemaps with flat files:
set +x
for f in `find $RPM_BUILD_ROOT%{contentdir}/manual -name \*.html -type f`; do
if test -f ${f}.en; then
cp ${f}.en ${f}
rm ${f}.*
fi
done
set -x
# Symlink for the powered-by-$DISTRO image:
ln -s ../../..%{_datadir}/pixmaps/poweredby.png \
$RPM_BUILD_ROOT%{contentdir}/icons/poweredby.png
# logs
rmdir $RPM_BUILD_ROOT%{_sysconfdir}/httpd/logs
mkdir -p $RPM_BUILD_ROOT%{_localstatedir}/log/httpd
# symlinks for /etc/httpd
ln -s ../..%{_localstatedir}/log/httpd $RPM_BUILD_ROOT/etc/httpd/logs
ln -s ../..%{_localstatedir}/run $RPM_BUILD_ROOT/etc/httpd/run
ln -s ../..%{_libdir}/httpd/modules $RPM_BUILD_ROOT/etc/httpd/modules
# install SYSV init stuff
mkdir -p $RPM_BUILD_ROOT/etc/rc.d/init.d
install -m755 $RPM_SOURCE_DIR/httpd.init \
$RPM_BUILD_ROOT/etc/rc.d/init.d/httpd
# install log rotation stuff
mkdir -p $RPM_BUILD_ROOT/etc/logrotate.d
install -m 644 -p $RPM_SOURCE_DIR/httpd.logrotate \
$RPM_BUILD_ROOT/etc/logrotate.d/httpd
# fix man page paths
sed -e "s|/usr/local/apache2/conf/httpd.conf|/etc/httpd/conf/httpd.conf|" \
-e "s|/usr/local/apache2/conf/mime.types|/etc/mime.types|" \
-e "s|/usr/local/apache2/conf/magic|/etc/httpd/conf/magic|" \
-e "s|/usr/local/apache2/logs/error_log|/var/log/httpd/error_log|" \
-e "s|/usr/local/apache2/logs/access_log|/var/log/httpd/access_log|" \
-e "s|/usr/local/apache2/logs/httpd.pid|/var/run/httpd.pid|" \
-e "s|/usr/local/apache2|/etc/httpd|" < docs/man/httpd.8 \
> $RPM_BUILD_ROOT%{_mandir}/man8/httpd.8
# Make ap_config_layout.h libdir-agnostic
sed -i '/.*DEFAULT_..._LIBEXECDIR/d;/DEFAULT_..._INSTALLBUILDDIR/d' \
$RPM_BUILD_ROOT%{_includedir}/httpd/ap_config_layout.h
# Fix path to instdso in special.mk
sed -i '/instdso/s,top_srcdir,top_builddir,' \
$RPM_BUILD_ROOT%{_libdir}/httpd/build/special.mk
# Remove unpackaged files
rm -f $RPM_BUILD_ROOT%{_libdir}/*.exp \
$RPM_BUILD_ROOT/etc/httpd/conf/mime.types \
$RPM_BUILD_ROOT%{_libdir}/httpd/modules/*.exp \
$RPM_BUILD_ROOT%{_libdir}/httpd/build/config.nice \
$RPM_BUILD_ROOT%{_bindir}/ap?-config \
$RPM_BUILD_ROOT%{_sbindir}/{checkgid,dbmmanage,envvars*} \
$RPM_BUILD_ROOT%{contentdir}/htdocs/* \
$RPM_BUILD_ROOT%{_mandir}/man1/dbmmanage.* \
$RPM_BUILD_ROOT%{contentdir}/cgi-bin/*
rm -rf $RPM_BUILD_ROOT/etc/httpd/conf/{original,extra}
# Make suexec a+rw so it can be stripped. %%files lists real permissions
chmod 755 $RPM_BUILD_ROOT%{_sbindir}/suexec
%pre
# Add the "apache" user
/usr/sbin/useradd -c "Apache" -u 48 \
-s /sbin/nologin -r -d %{contentdir} apache 2> /dev/null || :
%post
# Register the httpd service
/sbin/chkconfig --add httpd
%preun
if [ $1 = 0 ]; then
/sbin/service httpd stop > /dev/null 2>&1
/sbin/chkconfig --del httpd
fi
%define sslcert %{_sysconfdir}/pki/tls/certs/localhost.crt
%define sslkey %{_sysconfdir}/pki/tls/private/localhost.key
%post -n mod_ssl
umask 077
if [ ! -f %{sslkey} ] ; then
%{_bindir}/openssl genrsa -rand /proc/apm:/proc/cpuinfo:/proc/dma:/proc/filesystems:/proc/interrupts:/proc/ioports:/proc/pci:/proc/rtc:/proc/uptime 1024 > %{sslkey} 2> /dev/null
fi
FQDN=`hostname`
if [ "x${FQDN}" = "x" ]; then
FQDN=localhost.localdomain
fi
if [ ! -f %{sslcert} ] ; then
cat << EOF | %{_bindir}/openssl req -new -key %{sslkey} \
-x509 -days 365 -set_serial $RANDOM \
-out %{sslcert} 2>/dev/null
--
SomeState
SomeCity
SomeOrganization
SomeOrganizationalUnit
${FQDN}
root@${FQDN}
EOF
fi
%check
# Check the built modules are all PIC
if readelf -d $RPM_BUILD_ROOT%{_libdir}/httpd/modules/*.so | grep TEXTREL; then
: modules contain non-relocatable code
exit 1
fi
# Verify that the same modules were built into the httpd binaries
./prefork/httpd -l | grep -v prefork > prefork.mods
for mpm in %{mpms}; do
./${mpm}/httpd -l | grep -v ${mpm} > ${mpm}.mods
if ! diff -u prefork.mods ${mpm}.mods; then
: Different modules built into httpd binaries, will not proceed
exit 1
fi
done
%clean
rm -rf $RPM_BUILD_ROOT
%files
%defattr(-,root,root)
%doc ABOUT_APACHE README CHANGES LICENSE VERSIONING NOTICE
%dir %{_sysconfdir}/httpd
%{_sysconfdir}/httpd/modules
%{_sysconfdir}/httpd/logs
%{_sysconfdir}/httpd/run
%dir %{_sysconfdir}/httpd/conf
%config(noreplace) %{_sysconfdir}/httpd/conf/httpd.conf
%config(noreplace) %{_sysconfdir}/httpd/conf.d/welcome.conf
%config(noreplace) %{_sysconfdir}/httpd/conf.d/proxy_ajp.conf
%config(noreplace) %{_sysconfdir}/httpd/conf/magic
%config(noreplace) %{_sysconfdir}/logrotate.d/httpd
%{_sysconfdir}/rc.d/init.d/httpd
%dir %{_sysconfdir}/httpd/conf.d
%{_sysconfdir}/httpd/conf.d/README
%config(noreplace) %{_sysconfdir}/sysconfig/httpd
%{_sbindir}/ht*
%{_sbindir}/apachectl
%{_sbindir}/rotatelogs
%attr(4510,root,%{suexec_caller}) %{_sbindir}/suexec
%dir %{_libdir}/httpd
%dir %{_libdir}/httpd/modules
%{_libdir}/httpd/modules/mod*.so
%exclude %{_libdir}/httpd/modules/mod_ssl.so
%dir %{contentdir}
%dir %{contentdir}/cgi-bin
%dir %{contentdir}/html
%dir %{contentdir}/icons
%dir %{contentdir}/error
%dir %{contentdir}/error/include
%{contentdir}/icons/*
%{contentdir}/error/README
%{contentdir}/error/noindex.html
%config %{contentdir}/error/*.var
%config %{contentdir}/error/include/*.html
%attr(0700,root,root) %dir %{_localstatedir}/log/httpd
%attr(0700,apache,apache) %dir %{_localstatedir}/lib/dav
%attr(0700,apache,apache) %dir %{_localstatedir}/cache/mod_proxy
%{_mandir}/man8/*
%files tools
%defattr(-,root,root)
%{_bindir}/*
%{_mandir}/man1/*
%doc LICENSE
%files manual
%defattr(-,root,root)
%{contentdir}/manual
%config %{_sysconfdir}/httpd/conf.d/manual.conf
%files -n mod_ssl
%defattr(-,root,root)
%{_libdir}/httpd/modules/mod_ssl.so
%config(noreplace) %{_sysconfdir}/httpd/conf.d/ssl.conf
%attr(0700,apache,root) %dir %{_localstatedir}/cache/mod_ssl
%attr(0600,apache,root) %ghost %{_localstatedir}/cache/mod_ssl/scache.dir
%attr(0600,apache,root) %ghost %{_localstatedir}/cache/mod_ssl/scache.pag
%attr(0600,apache,root) %ghost %{_localstatedir}/cache/mod_ssl/scache.sem
%files devel
%defattr(-,root,root)
%{_includedir}/httpd
%{_sbindir}/apxs
%dir %{_libdir}/httpd/build
%{_libdir}/httpd/build/*.mk
%{_libdir}/httpd/build/*.sh
%changelog
* Thu Jan 31 2012 Denis Frolov <d.frolov81@mail.ru> 2.2.22-1
- Update to 2.2.22-1
Needless to say, I have the correct devel packages installed. At least, I think I do: pcre, apr, apr-util, httpd-devel, httpd-tools, etc.
Any suggestions?
02-21-2012, 04:36 PM
#2
LQ Newbie
Registered: Jun 2008
Posts: 28
Original Poster
Rep:
For those interested:
yum install libuuid-devel.x86_64
Problem solved.
02-21-2012, 04:39 PM
#3
LQ 5k Club
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,511
Quote:
/usr/bin/ld: cannot find -luuid
Means libuuid.so ( Or sometimes libuuid.a ).
Finding the package name : # yum provides */libuuid.so
# yum install libuuid-devel
EDIT : Please mark the thread [SOLVED].
.
Last edited by knudfl; 02-21-2012 at 04:41 PM .
All times are GMT -5. The time now is 05:33 PM .
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know .
Latest Threads
LQ News