Как добавить php в список apt и модули apache внутри образа Ubuntu 16.04 на докере?

Я только что создал контейнер из этого образа (Ubuntu 16.04) в концентраторе Docker.

Мне нужно установить redis-server, php-redis и включить некоторые модули в apache, один из них - mod_rewrite

Теперь контейнер запущен, и я получил доступ к машинной лотке -ti ... bash.

Когда я запускаю:

root@e0173642725d:~# php -m [PHP Modules] Core ctype curl date dom ereg fileinfo filter ftp hash iconv json libxml mbstring mysqlnd openssl pcre PDO pdo_sqlite Phar posix readline Reflection session SimpleXML SPL sqlite3 standard tokenizer xml xmlreader xmlwriter zlib [Zend Modules]

Я вижу, что там не является php-redis. Обычно для версии Xenial я бы сделал apt-get install -y php-redis, и я бы установил этот модуль. Проблема в том, что у меня нет php-redis внутри apt. У меня даже нет redis-server:

root@e0173642725d:~# apt list Listing... Done acl/now 2.2.52-2 amd64 [installed,local] adduser/now 3.113+nmu3 all [installed,local] apache2/now 2.4.10-10+deb8u10 amd64 [installed,local] apache2-bin/now 2.4.10-10+deb8u10 amd64 [installed,local] apache2-data/now 2.4.10-10+deb8u10 all [installed,local] apache2-utils/now 2.4.10-10+deb8u10 amd64 [installed,local] apt/now 1.0.9.8.4 amd64 [installed,local] autoconf/now 2.69-8 all [installed,local] base-files/now 8+deb8u9 amd64 [installed,local] base-passwd/now 3.5.37 amd64 [installed,local] bash/now 4.3-11+deb8u1 amd64 [installed,local] binutils/now 2.25-5+deb8u1 amd64 [installed,local] bsdutils/now 1:2.25.2-6 amd64 [installed,local] bzip2/now 1.0.6-7+b3 amd64 [installed,local] ca-certificates/now 20141019+deb8u3 all [installed,local] coreutils/now 8.23-4 amd64 [installed,local] cpp/now 4:4.9.2-2 amd64 [installed,local] cpp-4.9/now 4.9.2-10 amd64 [installed,local] curl/now 7.38.0-4+deb8u5 amd64 [installed,local] dash/now 0.5.7-4+b1 amd64 [installed,local] debconf/now 1.5.56+deb8u1 all [installed,local] debconf-i18n/now 1.5.56+deb8u1 all [installed,local] debian-archive-keyring/now 2017.5~deb8u1 all [installed,local] debianutils/now 4.4+b1 amd64 [installed,local] diffutils/now 1:3.3-1+b1 amd64 [installed,local] dmsetup/now 2:1.02.90-2.2+deb8u1 amd64 [installed,local] dpkg/now 1.17.27 amd64 [installed,local] dpkg-dev/now 1.17.27 all [installed,local] e2fslibs/now 1.42.12-2+b1 amd64 [installed,local] e2fsprogs/now 1.42.12-2+b1 amd64 [installed,local] file/now 1:5.22+15-2+deb8u3 amd64 [installed,local] findutils/now 4.4.2-9+b1 amd64 [installed,local] g++/now 4:4.9.2-2 amd64 [installed,local] g++-4.9/now 4.9.2-10 amd64 [installed,local] gcc/now 4:4.9.2-2 amd64 [installed,local] gcc-4.8-base/now 4.8.4-1 amd64 [installed,local] gcc-4.9/now 4.9.2-10 amd64 [installed,local] gcc-4.9-base/now 4.9.2-10 amd64 [installed,local] gnupg/now 1.4.18-7+deb8u4 amd64 [installed,local] gpgv/now 1.4.18-7+deb8u4 amd64 [installed,local] grep/now 2.20-4.1 amd64 [installed,local] gzip/now 1.6-4 amd64 [installed,local] hostname/now 3.15 amd64 [installed,local] inetutils-ping/now 2:1.9.2.39.3a460-3 amd64 [installed,local] init/now 1.22 amd64 [installed,local] initscripts/now 2.88dsf-59 amd64 [installed,local] insserv/now 1.14.0-5 amd64 [installed,local] iproute2/now 3.16.0-2 amd64 [installed,local] libacl1/now 2.2.52-2 amd64 [installed,local] libapr1/now 1.5.1-3 amd64 [installed,local] libaprutil1/now 1.5.4-1 amd64 [installed,local] libaprutil1-dbd-sqlite3/now 1.5.4-1 amd64 [installed,local] libaprutil1-ldap/now 1.5.4-1 amd64 [installed,local] libapt-pkg4.12/now 1.0.9.8.4 amd64 [installed,local] libasan1/now 4.9.2-10 amd64 [installed,local] libatomic1/now 4.9.2-10 amd64 [installed,local] libattr1/now 1:2.4.47-2 amd64 [installed,local] libaudit-common/now 1:2.4-1 all [installed,local] libaudit1/now 1:2.4-1+b1 amd64 [installed,local] libblkid1/now 2.25.2-6 amd64 [installed,local] libbsd0/now 0.7.0-2 amd64 [installed,local] libbz2-1.0/now 1.0.6-7+b3 amd64 [installed,local] libc-bin/now 2.19-18+deb8u10 amd64 [installed,local] libc-dev-bin/now 2.19-18+deb8u10 amd64 [installed,local] libc6/now 2.19-18+deb8u10 amd64 [installed,local] libc6-dev/now 2.19-18+deb8u10 amd64 [installed,local] libcap2/now 1:2.24-8 amd64 [installed,local] libcap2-bin/now 1:2.24-8 amd64 [installed,local] libcilkrts5/now 4.9.2-10 amd64 [installed,local] libcloog-isl4/now 0.18.2-1+b2 amd64 [installed,local] libcomerr2/now 1.42.12-2+b1 amd64 [installed,local] libcryptsetup4/now 2:1.6.6-5 amd64 [installed,local] libcurl3/now 7.38.0-4+deb8u5 amd64 [installed,local] libdb5.3/now 5.3.28-9 amd64 [installed,local] libdebconfclient0/now 0.192 amd64 [installed,local] libdevmapper1.02.1/now 2:1.02.90-2.2+deb8u1 amd64 [installed,local] libdpkg-perl/now 1.17.27 all [installed,local] libedit2/now 3.1-20140620-2 amd64 [installed,local] libexpat1/now 2.1.0-6+deb8u4 amd64 [installed,local] libffi6/now 3.1-2+deb8u1 amd64 [installed,local] libgcc-4.9-dev/now 4.9.2-10 amd64 [installed,local] libgcc1/now 1:4.9.2-10 amd64 [installed,local] libgcrypt20/now 1.6.3-2+deb8u4 amd64 [installed,local] libgdbm3/now 1.8.3-13.1 amd64 [installed,local] libglib2.0-0/now 2.42.1-1+b1 amd64 [installed,local] libgmp10/now 2:6.0.0+dfsg-6 amd64 [installed,local] libgnutls-deb0-28/now 3.3.8-6+deb8u7 amd64 [installed,local] libgomp1/now 4.9.2-10 amd64 [installed,local] libgpg-error0/now 1.17-3 amd64 [installed,local] libgssapi-krb5-2/now 1.12.1+dfsg-19+deb8u2 amd64 [installed,local] libhogweed2/now 2.7.1-5+deb8u2 amd64 [installed,local] libidn11/now 1.29-1+deb8u2 amd64 [installed,local] libisl10/now 0.12.2-2 amd64 [installed,local] libitm1/now 4.9.2-10 amd64 [installed,local] libk5crypto3/now 1.12.1+dfsg-19+deb8u2 amd64 [installed,local] libkeyutils1/now 1.5.9-5+b1 amd64 [installed,local] libkmod2/now 18-3 amd64 [installed,local] libkrb5-3/now 1.12.1+dfsg-19+deb8u2 amd64 [installed,local] libkrb5support0/now 1.12.1+dfsg-19+deb8u2 amd64 [installed,local] libldap-2.4-2/now 2.4.40+dfsg-1+deb8u3 amd64 [installed,local] liblocale-gettext-perl/now 1.05-8+b1 amd64 [installed,local] liblsan0/now 4.9.2-10 amd64 [installed,local] liblua5.1-0/now 5.1.5-7.1 amd64 [installed,local] liblzma5/now 5.1.1alpha+20120614-2+b3 amd64 [installed,local] libmagic1/now 1:5.22+15-2+deb8u3 amd64 [installed,local] libmount1/now 2.25.2-6 amd64 [installed,local] libmpc3/now 1.0.2-1 amd64 [installed,local] libmpfr4/now 3.1.2-2 amd64 [installed,local] libncurses5/now 5.9+20140913-1+b1 amd64 [installed,local] libncursesw5/now 5.9+20140913-1+b1 amd64 [installed,local] libnettle4/now 2.7.1-5+deb8u2 amd64 [installed,local] libp11-kit0/now 0.20.7-1 amd64 [installed,local] libpam-modules/now 1.1.8-3.1+deb8u2+b1 amd64 [installed,local] libpam-modules-bin/now 1.1.8-3.1+deb8u2+b1 amd64 [installed,local] libpam-runtime/now 1.1.8-3.1+deb8u2 all [installed,local] libpam0g/now 1.1.8-3.1+deb8u2+b1 amd64 [installed,local] libpcre3/now 2:8.35-3.3+deb8u4 amd64 [installed,local] libpcre3-dev/now 2:8.35-3.3+deb8u4 amd64 [installed,local] libpcrecpp0/now 2:8.35-3.3+deb8u4 amd64 [installed,local] libprocps3/now 2:3.3.9-9 amd64 [installed,local] libquadmath0/now 4.9.2-10 amd64 [installed,local] libreadline6/now 6.3-8+b3 amd64 [installed,local] librtmp1/now 2.4+20150115.gita107cef-1+deb8u1 amd64 [installed,local] libsasl2-2/now 2.1.26.dfsg1-13+deb8u1 amd64 [installed,local] libsasl2-modules-db/now 2.1.26.dfsg1-13+deb8u1 amd64 [installed,local] libselinux1/now 2.3-2 amd64 [installed,local] libsemanage-common/now 2.3-1 all [installed,local] libsemanage1/now 2.3-1+b1 amd64 [installed,local] libsepol1/now 2.3-2 amd64 [installed,local] libsigsegv2/now 2.10-4+b1 amd64 [installed,local] libslang2/now 2.3.0-2 amd64 [installed,local] libsmartcols1/now 2.25.2-6 amd64 [installed,local] libsqlite3-0/now 3.8.7.1-1+deb8u2 amd64 [installed,local] libss2/now 1.42.12-2+b1 amd64 [installed,local] libssh2-1/now 1.4.3-4.1+deb8u1 amd64 [installed,local] libssl1.0.0/now 1.0.1t-1+deb8u6 amd64 [installed,local] libstdc++-4.9-dev/now 4.9.2-10 amd64 [installed,local] libstdc++6/now 4.9.2-10 amd64 [installed,local] libsystemd0/now 215-17+deb8u7 amd64 [installed,local] libtasn1-6/now 4.2-3+deb8u3 amd64 [installed,local] libtext-charwidth-perl/now 0.04-7+b3 amd64 [installed,local] libtext-iconv-perl/now 1.7-5+b2 amd64 [installed,local] libtext-wrapi18n-perl/now 0.06-7 all [installed,local] libtimedate-perl/now 2.3000-2 all [installed,local] libtinfo5/now 5.9+20140913-1+b1 amd64 [installed,local] libtsan0/now 4.9.2-10 amd64 [installed,local] libubsan0/now 4.9.2-10 amd64 [installed,local] libudev1/now 215-17+deb8u7 amd64 [installed,local] libusb-0.1-4/now 2:0.1.12-25 amd64 [installed,local] libustr-1.0-1/now 1.0.4-3+b2 amd64 [installed,local] libuuid1/now 2.25.2-6 amd64 [installed,local] libxml2/now 2.9.1+dfsg1-5+deb8u5 amd64 [installed,local] linux-libc-dev/now 3.16.43-2+deb8u3 amd64 [installed,local] login/now 1:4.2-3+deb8u4 amd64 [installed,local] lsb-base/now 4.1+Debian13+nmu1 all [installed,local] m4/now 1.4.17-4 amd64 [installed,local] make/now 4.0-8.1 amd64 [installed,local] mawk/now 1.3.3-17 amd64 [installed,local] mime-support/now 3.58 all [installed,local] mount/now 2.25.2-6 amd64 [installed,local] multiarch-support/now 2.19-18+deb8u10 amd64 [installed,local] ncurses-base/now 5.9+20140913-1 all [installed,local] ncurses-bin/now 5.9+20140913-1+b1 amd64 [installed,local] netbase/now 5.3 all [installed,local] openssl/now 1.0.1t-1+deb8u6 amd64 [installed,local] passwd/now 1:4.2-3+deb8u4 amd64 [installed,local] patch/now 2.7.5-1 amd64 [installed,local] perl/now 5.20.2-3+deb8u8 amd64 [installed,local] perl-base/now 5.20.2-3+deb8u8 amd64 [installed,local] perl-modules/now 5.20.2-3+deb8u8 all [installed,local] pkg-config/now 0.28-1 amd64 [installed,local] procps/now 2:3.3.9-9 amd64 [installed,local] re2c/now 0.13.5-1 amd64 [installed,local] readline-common/now 6.3-8 all [installed,local] sed/now 4.2.2-4+deb8u1 amd64 [installed,local] sensible-utils/now 0.0.9 all [installed,local] startpar/now 0.59-3 amd64 [installed,local] systemd/now 215-17+deb8u7 amd64 [installed,local] systemd-sysv/now 215-17+deb8u7 amd64 [installed,local] sysv-rc/now 2.88dsf-59 all [installed,local] sysvinit-utils/now 2.88dsf-59 amd64 [installed,local] tar/now 1.27.1-2+deb8u1 amd64 [installed,local] tzdata/now 2017b-0+deb8u1 all [installed,local] udev/now 215-17+deb8u7 amd64 [installed,local] util-linux/now 2.25.2-6 amd64 [installed,local] xz-utils/now 5.1.1alpha+20120614-2+b3 amd64 [installed,local] zlib1g/now 1:1.2.8.dfsg-2+b1 amd64 [installed,local]

Еще одна проблема заключается в перезаписи модуля для apache. Когда я пытаюсь активировать, это то, что я получаю:

root@e0173642725d:~# a2enmod rewritee ERROR: Module rewritee does not exist!

Это доступные модули для apache

root@e0173642725d:~# apachectl -M AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 172.17.0.2. Set the 'ServerName' directive globally to suppress this message Loaded Modules: core_module (static) so_module (static) watchdog_module (static) http_module (static) log_config_module (static) logio_module (static) version_module (static) unixd_module (static) access_compat_module (shared) alias_module (shared) auth_basic_module (shared) authn_core_module (shared) authn_file_module (shared) authz_core_module (shared) authz_host_module (shared) authz_user_module (shared) autoindex_module (shared) deflate_module (shared) dir_module (shared) env_module (shared) filter_module (shared) mime_module (shared) mpm_prefork_module (shared) negotiation_module (shared) php5_module (shared) reqtimeout_module (shared) setenvif_module (shared) status_module (shared)

Итак, мой вопрос: как я могу сделать модули доступными для apache и

UPDATE: после того, как проблема с Apache-узлом Apache была завершена:

root@e0173642725d:~# a2enmod rewrite Enabling module rewrite. To activate the new configuration, you need to run: service apache2 restart root@e0173642725d:~# service apache2 restart [....] Restarting web server: apache2AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 172.17.0.2. Set the 'ServerName' directive globally to suppress this message . ok

Теперь rewrite_module:

root@e0173642725d:~# apachectl -M AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 172.17.0.2. Set the 'ServerName' directive globally to suppress this message Loaded Modules: core_module (static) so_module (static) watchdog_module (static) http_module (static) log_config_module (static) logio_module (static) version_module (static) unixd_module (static) access_compat_module (shared) alias_module (shared) auth_basic_module (shared) authn_core_module (shared) authn_file_module (shared) authz_core_module (shared) authz_host_module (shared) authz_user_module (shared) autoindex_module (shared) deflate_module (shared) dir_module (shared) env_module (shared) filter_module (shared) mime_module (shared) mpm_prefork_module (shared) negotiation_module (shared) php5_module (shared) reqtimeout_module (shared) *rewrite_module (shared)* setenvif_module (shared) status_module (shared)
0
задан 20 September 2017 в 16:23

0 ответов

Другие вопросы по тегам:

Похожие вопросы: