Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rApache on Centos 6.6 with apache 2.4 #36

Closed
mbacou opened this issue Aug 1, 2015 · 22 comments
Closed

rApache on Centos 6.6 with apache 2.4 #36

mbacou opened this issue Aug 1, 2015 · 22 comments

Comments

@mbacou
Copy link

mbacou commented Aug 1, 2015

Jeff,
Do you have any tip on how to build rApache to work with apache 2.4? I just upgraded to 2.4 to have support for webSockets, but when I try to start httpd24 I get the following.

$ sudo service httpd24-httpd restart

Stopping httpd:                                            [FAILED]
Starting httpd: httpd: Syntax error on line 57 of /opt/rh/httpd24/root/etc/httpd/conf/httpd.conf: Syntax error on line 2 of /opt/rh/httpd24/root/etc/httpd/conf.modules.d/99-rapache.conf: Cannot load /etc/httpd/modules/mod_R.so into server: /etc/httpd/modules/mod_R.so: undefined symbol: ap_log_rerror
                                                           [FAILED]

The server starts all right if I remove 99-rapache.conf and 00-rapache.conf.
Thanks a lot! --Mel.

@jeffreyhorner
Copy link
Owner

That's really strange. What exact version of apache 2.4 are you using? Did you compile it yourself or is it from a binary distribution?

@mbacou
Copy link
Author

mbacou commented Aug 4, 2015

Hi,
I re-compiled it from source after installing apache 2.4 using the steps at https://github.com/jeroenooms/opencpu-server/blob/master/rpm/buildscript.sh

Here is the version:

$ /opt/rh/httpd24/root/usr/sbin/httpd -version
Server version: Apache/2.4.6 (Red Hat)
Server built:   Sep 25 2013 05:25:46

@mbacou
Copy link
Author

mbacou commented Aug 4, 2015

Maybe I'm not installing right, not sure I understand why it shows package not installed here:

$ rpm -U rapache-*.rpm
        package rapache-debuginfo-1.2.7-rpm0.x86_64 is already installed
        package rapache-1.2.7-rpm0.x86_64 is already installed
$ rpm -e rapache-*.rpm
error: package rapache-1.2.7-rpm0.x86_64.rpm is not installed
error: package rapache-debuginfo-1.2.7-rpm0.x86_64.rpm is not installed

@jeroen
Copy link
Collaborator

jeroen commented Aug 4, 2015

I think that there are two conflicting installations of apache on your system. The rpm package gets built for the system httpd in /etc/httpd and loads rapache from /etc/httpd/modules/mod_R.so. This module has been compiled against httpd-devel with apache 2.2, so you can't load this module in 2.4.

Iif you build apache from source, you need to build rapache manually from source as well so that you can set the proper include and linker flags to /opt/rh/httpd24/ or wherever your apache 2.4 sources are.

@jeroen
Copy link
Collaborator

jeroen commented Aug 4, 2015

I don't have a linux box right now but you need to build rapache using something like:

./configure --include=/opt/rh/httpd24/root/usr/include --ldflags=-L/opt/rh/httpd24/root/usr/lib

Or whatever ./configure --help suggests to get the right headers and libraries.

@mbacou
Copy link
Author

mbacou commented Aug 4, 2015

Thanks Jeroen, yeh I think that's the problem. Will start from scratch again, and add the httpd24 config flags.

@mbacou
Copy link
Author

mbacou commented Aug 4, 2015

That said, I didn't build apache 2.4 manually, just a standard yum install from EPEL.

@jeroen
Copy link
Collaborator

jeroen commented Aug 4, 2015

What is this package called then? As far as I know (but I could be wrong), official rpm packages never install into /opt. You sure it's not from some custom third party repo?

@mbacou
Copy link
Author

mbacou commented Aug 4, 2015

This is apache 2.4, and I removed all existing rapache packages.

$ yum list *httpd24*
Loaded plugins: fastestmirror, security
Loading mirror speeds from cached hostfile
 * base: centos-mirror.jchost.net
 * elrepo: repos.lax-noc.com
 * epel: mirrors.syringanetworks.net
 * extras: mirrors.syringanetworks.net
 * remi: mirrors.mediatemple.net
 * remi-safe: mirrors.mediatemple.net
 * updates: linux.mirrors.es.net
Installed Packages
httpd24.x86_64                             1-6.el6                              @epel-httpd24

$ yum list *rapache*
Loaded plugins: fastestmirror, security
Loading mirror speeds from cached hostfile
 * base: centos-mirror.jchost.net
 * elrepo: repos.lax-noc.com
 * epel: mirrors.syringanetworks.net
 * extras: mirrors.syringanetworks.net
 * remi: mirrors.mediatemple.net
 * remi-safe: mirrors.mediatemple.net
 * updates: linux.mirrors.es.net
Error: No matching Packages to list

@jeroen
Copy link
Collaborator

jeroen commented Aug 4, 2015

Make sure you install httpd24-devel and remove httpd-devel then.

@mbacou
Copy link
Author

mbacou commented Aug 4, 2015

OK thx, can I rebuild rapache the standard way then (I mean without any custom flag)?

@jeroen
Copy link
Collaborator

jeroen commented Aug 4, 2015

You'll still need to manually configure, make, make install because the rapache rpm scripts all assume apache is in /etc/httpd which is not the case apparently. But if you make sure there is only a single version of httpd installed on the machine, the configure script will probably pick it up so you don't have to manually set include flags... hopefully.

@mbacou
Copy link
Author

mbacou commented Aug 4, 2015

Removed httpd-devel and installed httpd24-devel, tried to rebuild.

$ rpmbuild -ba ~/rpmbuild/SPECS/rapache.spec
error: Failed build dependencies:
        httpd-devel is needed by rapache-1.2.7-rpm0.x86_64
        libapreq2-devel is needed by rapache-1.2.7-rpm0.x86_64

Can I prevent it from building against apache 2.2?

@jeroen
Copy link
Collaborator

jeroen commented Aug 4, 2015

No you need to build from source:

wget https://github.com/jeffreyhorner/rapache/archive/v1.2.7.tar.gz
tar xzvf v1.2.7.tar.gz
cd rapache-1.2.7
./configure
make
sudo make install

@mbacou
Copy link
Author

mbacou commented Aug 4, 2015

Sorry I need to be spoon-fed here. Got a problem during make...

& ./configure
[...]
checking whether to enable maintainer-specific portions of Makefiles... no
./configure: line 19356: apxs: command not found
./configure: line 19370: apxs: command not found
./configure: line 19374: apxs: command not found
./configure: line 19378: apxs: command not found
./configure: line 19378: apxs: command not found
build/version_check.pl failed: no version_string found in '' for 'apache2'.
configure: error: Bad apache2 binary (/)
./configure: line 11393: /home/mbacou/rapache-1.2.7/libapreq2/apreq2-config: No such file or directory
./configure: line 11394: /home/mbacou/rapache-1.2.7/libapreq2/apreq2-config: No such file or directory
./configure: line 11395: /home/mbacou/rapache-1.2.7/libapreq2/apreq2-config: No such file or directory
configure: creating ./config.status
config.status: creating Makefile
config.status: creating mod_R.h
config.status: executing libtool commands

$ make

Configuring libapreq2

(cd libapreq2; make apreq2-config; cd library; make)
make[1]: Entering directory `/home/mbacou/rapache-1.2.7/libapreq2'
make[1]: *** No rule to make target `apreq2-config'.  Stop.
make[1]: Leaving directory `/home/mbacou/rapache-1.2.7/libapreq2'
make[1]: Entering directory `/home/mbacou/rapache-1.2.7/libapreq2/library'
make[1]: *** No targets specified and no makefile found.  Stop.
make[1]: Leaving directory `/home/mbacou/rapache-1.2.7/libapreq2/library'
make: *** [.apreq-config] Error 2

$ yum list libapreq2
Loaded plugins: fastestmirror, security
Loading mirror speeds from cached hostfile
 * base: centos-mirror.jchost.net
 * elrepo: repos.lax-noc.com
 * epel: mirrors.syringanetworks.net
 * extras: mirrors.syringanetworks.net
 * remi: mirrors.mediatemple.net
 * remi-safe: mirrors.mediatemple.net
 * updates: linux.mirrors.es.net
Installed Packages
libapreq2.x86_64                               2.13-1.el6                               @epel

Do I need to fully uninstall httpd (2.2) package?

@jeroen
Copy link
Collaborator

jeroen commented Aug 4, 2015

I think uninstalling httpd-devel should suffice. Can you check if apache 2.4 includes apxs or apxs2? You need something like:

./configure --with-apache2-apxs=/opt/rh/httpd24/root/usr/bin/apxs

See also chapter 2.1 Building from source from the rapache manual. Also have a look at

./configure --help

You might need to pass some other flags point it to the /opt/rh/httpd24 installation (which is highly unusual...).

@jeroen
Copy link
Collaborator

jeroen commented Aug 4, 2015

I think you need to yum install httpd24-apr-devel httpd24-httpd-devel

@mbacou
Copy link
Author

mbacou commented Aug 4, 2015

OK, nearly there, but I seem to have another link problem with /usr/lib64/httpd/build/config_vars.mk (guess shoud be /opt/rh/httpd24/root/usr/lib64/httpd/build/config_vars.mk).

I really have no idea why yum installed apache 2.4 in this odd location.

$ ./configure  --with-apxs=/opt/rh/httpd24/root/usr/bin/apxs

checking whether to enable maintainer-specific portions of Makefiles... no
cannot open /usr/lib64/httpd/build/config_vars.mk: No such file or directory at /opt/rh/httpd24/root/usr/bin/apxs line 214.
cannot open /usr/lib64/httpd/build/config_vars.mk: No such file or directory at /opt/rh/httpd24/root/usr/bin/apxs line 214.
cannot open /usr/lib64/httpd/build/config_vars.mk: No such file or directory at /opt/rh/httpd24/root/usr/bin/apxs line 214.
cannot open /usr/lib64/httpd/build/config_vars.mk: No such file or directory at /opt/rh/httpd24/root/usr/bin/apxs line 214.
cannot open /usr/lib64/httpd/build/config_vars.mk: No such file or directory at /opt/rh/httpd24/root/usr/bin/apxs line 214.
build/version_check.pl failed: no version_string found in '' for 'apache2'.
configure: error: Bad apache2 binary (/)
./configure: line 11393: /home/mbacou/rapache-1.2.7/libapreq2/apreq2-config: No such file or directory
./configure: line 11394: /home/mbacou/rapache-1.2.7/libapreq2/apreq2-config: No such file or directory
./configure: line 11395: /home/mbacou/rapache-1.2.7/libapreq2/apreq2-config: No such file or directory
configure: creating ./config.status
config.status: creating Makefile
config.status: creating mod_R.h
config.status: executing libtool commands

$ ll /opt/rh/httpd24/root/usr/lib64/httpd/build
total 40
-rw-r--r--. 1 root root 4119 Sep 25  2013 config_vars.mk
-rwxr-xr-x. 1 root root 3095 Sep 25  2013 instdso.sh
-rw-r--r--. 1 root root 1060 Sep 25  2013 library.mk
-rw-r--r--. 1 root root  951 Sep 25  2013 ltlib.mk
-rwxr-xr-x. 1 root root 1660 Sep 25  2013 mkdir.sh
-rw-r--r--. 1 root root 1032 Sep 25  2013 program.mk
-rw-r--r--. 1 root root 7603 Sep 25  2013 rules.mk
-rw-r--r--. 1 root root 1278 Sep 25  2013 special.mk

@jeroen
Copy link
Collaborator

jeroen commented Aug 4, 2015

Maybe talk to this guy? https://groups.google.com/forum/#!topic/rapache/yFP1t2yPOCc

@mbacou
Copy link
Author

mbacou commented Aug 4, 2015

That worked. Thx so much! Recap:

$ scl enable httpd24 bash # prepends /opt/rh/httpd24/root/usr/bin:/opt/rh/httpd24/root/usr/sbin: to $PATH
$ ./configure  --with-apxs=/opt/rh/httpd24/root/usr/bin/apxs
$ sudo make clean
$ sudo scl enable httpd24 'make install'

[...]
Libraries have been installed in:
   /opt/rh/httpd24/root/usr/lib

@jeroen
Copy link
Collaborator

jeroen commented Aug 4, 2015

OK great. FYI usually you don't need sudo for the second step make clean, only for the installation.

@mbacou
Copy link
Author

mbacou commented Aug 4, 2015

I had some locked files left from previous failed make, sudo make clean fixed that.
@jeroenooms I suppose I also need to config make install opencpu as well or rpmbuild -ba ~/rpmbuild/SPECS/opencpu.spec should do?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants