Compilando mod_jk no Fedora 18

Pré-requisitos

Instale o compilador gcc

[root@sfantin]# yum install gcc

Instale o módulo gcc-c++

[root@sfantin]# yum install gcc-c++

Instale o Apache

[root@sfantin]# yum install httpd

Compilando o mod_jk

Download do código fonte

tomcat-connectors-1.2.37-src.tar.gz

Descompactar

[root@sfantin tmp]# tar xzvf tomcat-connectors-1.2.37-src.tar.gz

Entrar no diretório

[root@sfantin tmp]# cd tomcat-connectors-1.2.37-src/native

Localize o apxs

[root@sfantin tomcat-connectors-1.2.37-src]# whereis apxs

apxs: /bin/apxs /usr/bin/apxs /usr/share/man/man1/apxs.1.gz

Execute

[root@sfantin native]# ./configure --with-apxs=/usr/bin/apxs

checking build system type… x86_64-unknown-linux-gnu
checking host system type… x86_64-unknown-linux-gnu
checking target system type… x86_64-unknown-linux-gnu
checking for a BSD-compatible install… /bin/install -c
checking whether build environment is sane… yes
checking for gawk… gawk

APRINCLUDEDIR is -I/usr/include/apr-1 -I/usr/include/apr-1
building connector for “apache-2.0”
checking for gcc… gcc -std=gnu99
checking for C compiler default output file name… a.out
checking whether the C compiler works… yes

checking for sys/stat.h… yes

checking for g++… g++
checking whether we are using the GNU C++ compiler… yes
checking whether g++ accepts -g… yes
checking dependency style of g++… none
checking how to run the C++ preprocessor… g++ -E

checking the maximum length of command line arguments… 32768
checking command to parse /bin/nm -B output from gcc -std=gnu99 object… ok
checking for objdir… .libs
checking for ar… ar
checking for ranlib… ranlib
checking for strip… strip
checking if gcc -std=gnu99 supports -c -o file.o… yes
checking whether the gcc -std=gnu99 linker (/bin/ld -m elf_x86_64) supports shared libraries… yes

checking for shl_load in -ldld… no
checking for dlopen… no
checking for dlopen in -ldl… yes
checking whether a program can dlopen itself… yes
checking whether a statically linked program can dlopen itself… yes

checking for dlopen in -ldl… (cached) yes
checking whether a program can dlopen itself… (cached) yes
checking whether a statically linked program can dlopen itself… (cached) yes
appending configuration tag “F77” to libtool
checking if libtool supports shared libraries… yes
checking whether to build shared libraries… yes
checking whether to build static libraries… yes
checking for f95 option to produce PIC… -fPIC
checking if f95 PIC flag -fPIC works… yes
checking if f95 supports -c -o file.o… yes
checking whether the f95 linker (/bin/ld -m elf_x86_64) supports shared libraries… yes
checking dynamic linker characteristics… GNU/Linux ld.so
checking how to hardcode library paths into programs… immediate
checking whether stripping libraries is possible… yes

configure: creating ./config.status
config.status: creating Makefile
config.status: creating apache-1.3/Makefile

config.status: creating common/config.h
config.status: executing depfiles commands

Execute o comando

[root@sfantin native]# make

Making all in common
make[1]: Entering directory `/tmp/tomcat-connectors-1.2.37-src/native/common’
/usr/lib64/apr-1/build/libtool –silent –mode=compile gcc -std=gnu99 -I/usr/include/httpd -DHAVE_CONFIG_H -O2 -g -pipe -Wall -Wp,-

Making all in apache-2.0
make[1]: Entering directory `/tmp/tomcat-connectors-1.2.37-src/native/apache-2.0′
/usr/lib64/apr-1/build/libtool –silent –mode=compile gcc -std=gnu99 -I/usr/include/httpd -DHAVE_CONFIG_H -DUSE_APACHE_MD5 -I ../common -DLINUX=2 -D_REENTRANT -D_GNU_SOURCE -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector –param=ssp-buffer-size=4 -m64 -mtune=generic -pthread -DHAVE_APR -I/usr/include/apr-1 -I/usr/include/apr-1 -DHAVE_CONFIG_H -pthread -DLINUX=2 -D_REENTRANT -D_GNU_SOURCE -c mod_jk.c -o mod_jk.lo
/usr/lib64/apr-1/build/libtool –silent –mode=link gcc -std=gnu99 -I/usr/include/httpd -DHAVE_CONFIG_H -DUSE_APACHE_MD5 -I ../common -DLINUX=2 -D_REENTRANT -D_GNU_SOURCE -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector –param=ssp-buffer-size=4 -m64 -mtune=generic -pthread -DHAVE_APR -I/usr/include/apr-1 -I/usr/include/apr-1 -DHAVE_CONFIG_H -pthread -DLINUX=2 -D_REENTRANT -D_GNU_SOURCE -Wl,-z,relro,-z,now -o mod_jk.la -module -rpath /usr/lib64/httpd/modules -avoid-version mod_jk.lo ../common/jk_ajp12_worker.lo ../common/jk_connect.lo ../common/jk_msg_buff.lo ../common/jk_util.lo ../common/jk_ajp13.lo ../common/jk_pool.lo ../common/jk_worker.lo ../common/jk_ajp13_worker.lo ../common/jk_lb_worker.lo ../common/jk_sockbuf.lo ../common/jk_map.lo ../common/jk_uri_worker_map.lo ../common/jk_ajp14.lo ../common/jk_ajp14_worker.lo ../common/jk_md5.lo ../common/jk_shm.lo ../common/jk_ajp_common.lo ../common/jk_context.lo ../common/jk_url.lo ../common/jk_status.lo
../scripts/build/instdso.sh SH_LIBTOOL=’/usr/lib64/apr-1/build/libtool –silent’ mod_jk.la `pwd`
/usr/lib64/apr-1/build/libtool –silent –mode=install cp mod_jk.la /tmp/tomcat-connectors-1.2.37-src/native/apache-2.0/
libtool: install: warning: remember to run `libtool –finish /usr/lib64/httpd/modules’
make[1]: Leaving directory `/tmp/tomcat-connectors-1.2.37-src/native/apache-2.0′
make[1]: Entering directory `/tmp/tomcat-connectors-1.2.37-src/native’
make[1]: Nothing to be done for `all-am’.
make[1]: Leaving directory `/tmp/tomcat-connectors-1.2.37-src/native’
target=”all”; \
list=’common apache-2.0′; \
for i in $list; do \
echo “Making $target in $i”; \
if test “$i” != “.”; then \
(cd $i && make $target) || exit 1; \
fi; \
done;
Making all in common
make[1]: Entering directory `/tmp/tomcat-connectors-1.2.37-src/native/common’
make[1]: Nothing to be done for `all’.
make[1]: Leaving directory `/tmp/tomcat-connectors-1.2.37-src/native/common’
Making all in apache-2.0
make[1]: Entering directory `/tmp/tomcat-connectors-1.2.37-src/native/apache-2.0′
../scripts/build/instdso.sh SH_LIBTOOL=’/usr/lib64/apr-1/build/libtool –silent’ mod_jk.la `pwd`
/usr/lib64/apr-1/build/libtool –silent –mode=install cp mod_jk.la /tmp/tomcat-connectors-1.2.37-src/native/apache-2.0/
libtool: install: warning: remember to run `libtool –finish /usr/lib64/httpd/modules’
make[1]: Leaving directory `/tmp/tomcat-connectors-1.2.37-src/native/apache-2.0′

Execute o comando

[root@sfantin native]# make install

Making install in common
make[1]: Entering directory `/tmp/tomcat-connectors-1.2.37-src/native/common’
make[1]: Nothing to be done for `install’.
make[1]: Leaving directory `/tmp/tomcat-connectors-1.2.37-src/native/common’
Making install in apache-2.0
make[1]: Entering directory `/tmp/tomcat-connectors-1.2.37-src/native/apache-2.0′

Installing files to Apache Modules Directory…
/usr/bin/apxs -i mod_jk.la
/usr/lib64/httpd/build/instdso.sh SH_LIBTOOL=’/usr/lib64/apr-1/build/libtool’ mod_jk.la /usr/lib64/httpd/modules
/usr/lib64/apr-1/build/libtool –mode=install install mod_jk.la /usr/lib64/httpd/modules/
libtool: install: install .libs/mod_jk.so /usr/lib64/httpd/modules/mod_jk.so
libtool: install: install .libs/mod_jk.lai /usr/lib64/httpd/modules/mod_jk.la
libtool: install: install .libs/mod_jk.a /usr/lib64/httpd/modules/mod_jk.a
libtool: install: chmod 644 /usr/lib64/httpd/modules/mod_jk.a
libtool: install: ranlib /usr/lib64/httpd/modules/mod_jk.a
libtool: finish: PATH=”/usr/local/apache-maven/apache-maven-3.0.5/bin:/usr/lib64/qt-3.3/bin:/usr/lib64/ccache:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin:/sbin” ldconfig -n /usr/lib64/httpd/modules
———————————————————————-
Libraries have been installed in:
/usr/lib64/httpd/modules

If you ever happen to want to link against installed libraries
in a given directory, LIBDIR, you must either use libtool, and
specify the full pathname of the library, or use the `-LLIBDIR’
flag during linking and do at least one of the following:
– add LIBDIR to the `LD_LIBRARY_PATH’ environment variable
during execution
– add LIBDIR to the `LD_RUN_PATH’ environment variable
during linking
– use the `-Wl,-rpath -Wl,LIBDIR’ linker flag
– have your system administrator add LIBDIR to `/etc/ld.so.conf’

See any operating system documentation about shared libraries for
more information, such as the ld(1) and ld.so(8) manual pages.
———————————————————————-
chmod 755 /usr/lib64/httpd/modules/mod_jk.so

Please be sure to arrange /etc/httpd/conf/httpd.conf…

make[1]: Leaving directory `/tmp/tomcat-connectors-1.2.37-src/native/apache-2.0′
make[1]: Entering directory `/tmp/tomcat-connectors-1.2.37-src/native’
make[2]: Entering directory `/tmp/tomcat-connectors-1.2.37-src/native’
make[2]: Nothing to be done for `install-exec-am’.
make[2]: Nothing to be done for `install-data-am’.
make[2]: Leaving directory `/tmp/tomcat-connectors-1.2.37-src/native’
make[1]: Leaving directory `/tmp/tomcat-connectors-1.2.37-src/native’

O conector que acabou de ser criado está em:

/usr/lib64/httpd/modules/mod_jk.so

PS: dica do meu caro Raul Leite

Pronto!

 


2 Comentários on “Compilando mod_jk no Fedora 18”

  1. Raul disse:

    Agora eu quero saber onde está o meu crédito ? Tá no pelo ?


Deixe uma resposta

Preencha os seus dados abaixo ou clique em um ícone para log in:

Logotipo do WordPress.com

Você está comentando utilizando sua conta WordPress.com. Sair / Alterar )

Imagem do Twitter

Você está comentando utilizando sua conta Twitter. Sair / Alterar )

Foto do Facebook

Você está comentando utilizando sua conta Facebook. Sair / Alterar )

Foto do Google+

Você está comentando utilizando sua conta Google+. Sair / Alterar )

Conectando a %s