Installing mod_jk in centos 7 on docker for windows -
i tried apache ubuntu in docker (docker windows) in https://github.com/paritosh-anand/docker-httpd-tomcat
the dockerfile
from ubuntu:latest maintainer <user>@<domain>.com run apt-get update && apt-get install -y --no-install-recommends apache2 libapache2-mod-jk add apache2.conf /etc/apache2/apache2.conf add 000-default.conf /etc/apache2/sites-enabled/000-default.conf add worker.properties /etc/libapache2-mod-jk/workers.properties add jk.conf /etc/apache2/mods-available/jk.conf volume ["/var/log/apache2"] expose 80 443 cmd ["apachectl", "-k", "start", "-dforeground"]
however, need run apache in centos 7, not in ubuntu. changed dockerfile
from centos:7 maintainer <user>@<domain>.com run yum -y --setopt=tsflags=nodocs update run yum -y --setopt=tsflags=nodocs install httpd run yum -y --setopt=tsflags=nodocs install mod-jk run yum clean add apache2.conf /etc/apache2/apache2.conf add 000-default.conf /etc/apache2/sites-enabled/000-default.conf add worker.properties /etc/libapache2-mod-jk/workers.properties add jk.conf /etc/apache2/mods-available/jk.conf volume ["/var/log/apache2"] expose 80 443 cmd ["apachectl", "-k", "start", "-dforeground"]
on running, getting error
step 5/13 : run yum -y --setopt=tsflags=nodocs install mod-jk ---> running in a98487a9509c loaded plugins: fastestmirror, ovl loading mirror speeds cached hostfile * base: mirrors.nhanhoa.com * extras: mirrors.nhanhoa.com * updates: mirror.ehost.vn no package mod-jk available. error: nothing error: service 'httpd' failed build: command '/bin/sh -c yum -y --setopt=tsflags=nodocs install mod-jk' returned non-zero code: 1
is problem mirror? how can install mod_jk in docker operating system centos 7? host operating system windows 10
for centos 7 need compile module source. consider below dockerfile example
from centos:7 run yum -y update && yum clean run yum -y install httpd httpd-devel gcc* make && yum clean # install mod_jk run curl -sl http://mirror.sdunix.com/apache/tomcat/tomcat-connectors/jk/tomcat-connectors-1.2.40-src.tar.gz -o tomcat-connectors-1.2.40-src.tar.gz \ && mkdir -p src/tomcat-connectors \ && tar xzf tomcat-connectors-1.2.40-src.tar.gz -c src/tomcat-connectors --strip-components=1 \ && cd src/tomcat-connectors/native/ \ && ./configure --with-apxs=/usr/bin/apxs \ && make \ && cp apache-2.0/mod_jk.so /usr/lib64/httpd/modules/ \ && ./libtool --finish /usr/lib64/httpd/modules/ \ && cd / \ && rm -rf src/ \ && rm -f tomcat-connectors-1.2.40-src.tar.gz # mod_jk conf files add mod_jk.conf /etc/httpd/conf.d/ add workers.properties /etc/httpd/conf.d/ expose 80 # simple startup script avoid issues observed container restart add run-httpd.sh /run-httpd.sh run chmod -v +x /run-httpd.sh cmd ["/run-httpd.sh"]
taken https://github.com/maeharin/apache-tomcat-docker-sample/blob/master/docker/httpd/dockerfile
Comments
Post a Comment