※rpm作成環境の構築はこちら ソースコードを入手し、さくっとrpmを作成してみる。
$ mkdir ~/rpmbuild/SOURCES/httpd-2.4.12-1.src $ cd ~/rpmbuild/SOURCES/httpd-2.4.12-1.src $ wget http://ftp.riken.jp/net/apache//httpd/httpd-2.4.12.tar.bz2 $ rpmbuild --clean -tb ~/rpmbuild/SOURCES/httpd-2.4.12-1.src/httpd-2.4.12.tar.bz2 error: Failed build dependencies: zlib-devel is needed by httpd-2.4.12-1.x86_64 libselinux-devel is needed by httpd-2.4.12-1.x86_64 libuuid-devel is needed by httpd-2.4.12-1.x86_64 apr-devel >= 1.4.0 is needed by httpd-2.4.12-1.x86_64 apr-util-devel >= 1.4.0 is needed by httpd-2.4.12-1.x86_64 pcre-devel >= 5.0 is needed by httpd-2.4.12-1.x86_64 openldap-devel is needed by httpd-2.4.12-1.x86_64 lua-devel is needed by httpd-2.4.12-1.x86_64 libxml2-devel is needed by httpd-2.4.12-1.x86_64 distcache-devel is needed by httpd-2.4.12-1.x86_64 openssl-devel is needed by httpd-2.4.12-1.x86_64まぁ、足りませんね。ということで、確認してみます。
$ sudo yum install zlib-devel libselinux-devel libuuid-devel apr-devel apr-util-devel pcre-devel openldap-devel lua-devel libxml2-devel distcache-devel openssl-devel Dependencies Resolved ======================================================================================================================== Package Arch Version Repository Size ======================================================================================================================== Installing: apr-devel x86_64 1.3.9-5.el6_2 base 176 k apr-util-devel x86_64 1.3.9-3.el6_0.1 base 69 k libselinux-devel x86_64 2.0.94-5.8.el6 base 137 k libuuid-devel x86_64 2.17.2-12.18.el6 base 85 k libxml2-devel x86_64 2.7.6-17.el6_6.1 updates 1.1 M lua-devel x86_64 5.1.4-4.1.el6 base 20 k openldap-devel x86_64 2.4.39-8.el6 base 1.1 M openssl-devel x86_64 1.0.1e-30.el6_6.5 updates 1.2 M pcre-devel x86_64 7.8-6.el6 base 318 k zlib-devel x86_64 1.2.3-29.el6 base 44 k Installing for dependencies: cyrus-sasl-devel x86_64 2.1.23-15.el6_6.1 updates 303 k db4-cxx x86_64 4.7.25-18.el6_4 base 588 k db4-devel x86_64 4.7.25-18.el6_4 base 6.6 M expat-devel x86_64 2.0.1-11.el6_2 base 120 k keyutils-libs-devel x86_64 1.4-5.el6 base 29 k krb5-devel x86_64 1.10.3-33.el6 base 498 k libcom_err-devel x86_64 1.41.12-21.el6 base 32 k libsepol-devel x86_64 2.0.41-4.el6 base 64 k Updating for dependencies: cyrus-sasl x86_64 2.1.23-15.el6_6.1 updates 78 k cyrus-sasl-lib x86_64 2.1.23-15.el6_6.1 updates 136 k e2fsprogs x86_64 1.41.12-21.el6 base 553 k e2fsprogs-libs x86_64 1.41.12-21.el6 base 121 k keyutils x86_64 1.4-5.el6 base 39 k keyutils-libs x86_64 1.4-5.el6 base 20 k krb5-libs x86_64 1.10.3-33.el6 base 765 k libblkid x86_64 2.17.2-12.18.el6 base 116 k libcom_err x86_64 1.41.12-21.el6 base 37 k libselinux x86_64 2.0.94-5.8.el6 base 108 k libselinux-utils x86_64 2.0.94-5.8.el6 base 82 k libss x86_64 1.41.12-21.el6 base 41 k libuuid x86_64 2.17.2-12.18.el6 base 69 k libxml2 x86_64 2.7.6-17.el6_6.1 updates 801 k openldap x86_64 2.4.39-8.el6 base 280 k openssl x86_64 1.0.1e-30.el6_6.5 updates 1.5 M util-linux-ng x86_64 2.17.2-12.18.el6 base 1.6 M Transaction Summary ======================================================================================================================== Install 18 Package(s) Upgrade 17 Package(s) ・ ・apr-develとapr-util-develについては、レポジトリ上のものが古いみたい。 ということで、こちらもソースからrpm化をして、インストールしてみる。 入手先はこちら
$ cd ~/rpmbuild/SOURCES/ $ wget http://ftp.jaist.ac.jp/pub/apache//apr/apr-1.5.1.tar.bz2 $ wget http://ftp.jaist.ac.jp/pub/apache//apr/apr-util-1.5.4.tar.bz2 $ rpmbuild --clean -tb ~/rpmbuild/SOURCES/apr-1.5.1.tar.bz2 error: Failed build dependencies: doxygen is needed by apr-1.5.1-1.x86_64 $ sudo yum install doxygen -y $ rpmbuild --clean -tb ~/rpmbuild/SOURCES/apr-1.5.1.tar.bz2 ・ ・ ・ $ ll ../RPMS/x86_64/ total 1320 -rw-rw-r-- 1 hayashi hayashi 93308 Jan 30 14:34 apr-1.5.1-1.x86_64.rpm -rw-rw-r-- 1 hayashi hayashi 416372 Jan 30 14:34 apr-debuginfo-1.5.1-1.x86_64.rpm -rw-rw-r-- 1 hayashi hayashi 839308 Jan 30 14:34 apr-devel-1.5.1-1.x86_64.rpm出来上がり!つぎに進む。
$ rpmbuild --clean -tb ~/rpmbuild/SOURCES/apr-util-1.5.4.tar.bz2 error: Failed build dependencies: apr-devel >= 1.4.0 is needed by apr-util-1.5.4-1.x86_64 expat-devel is needed by apr-util-1.5.4-1.x86_64 libuuid-devel is needed by apr-util-1.5.4-1.x86_64 db4-devel is needed by apr-util-1.5.4-1.x86_64 postgresql-devel is needed by apr-util-1.5.4-1.x86_64 mysql-devel is needed by apr-util-1.5.4-1.x86_64 sqlite-devel >= 3.0.0 is needed by apr-util-1.5.4-1.x86_64 freetds-devel is needed by apr-util-1.5.4-1.x86_64 unixODBC-devel is needed by apr-util-1.5.4-1.x86_64 openldap-devel is needed by apr-util-1.5.4-1.x86_64 openssl-devel is needed by apr-util-1.5.4-1.x86_64 nss-devel is needed by apr-util-1.5.4-1.x86_64とりあえず、apr-develは先ほどのやつをインストール。
$ sudo rpm -ivh ../RPMS/x86_64/apr-1.5.1-1.x86_64.rpm ../RPMS/x86_64/apr-devel-1.5.1-1.x86_64.rpm file /usr/lib64/libapr-1.so.0 from install of apr-1.5.1-1.x86_64 conflicts with file from package apr-1.3.9-5.el6_2.x86_64失敗・・気を取り直して、、
$ sudo rpm -Uvh ../RPMS/x86_64/apr-1.5.1-1.x86_64.rpm ../RPMS/x86_64/apr-devel-1.5.1-1.x86_64.rpm成功。それ以外をチェック
$ sudo yum install expat-devel libuuid-devel db4-devel postgresql-devel mysql-devel sqlite-devel freetds-devel unixODBC-devel openldap-devel openssl-devel nss-devel Dependencies Resolved ======================================================================================================================== Package Arch Version Repository Size ======================================================================================================================== Installing: db4-devel x86_64 4.7.25-18.el6_4 base 6.6 M expat-devel x86_64 2.0.1-11.el6_2 base 120 k freetds-devel x86_64 0.91-2.el6 epel 39 k libuuid-devel x86_64 2.17.2-12.18.el6 base 85 k mysql-devel x86_64 5.1.73-3.el6_5 base 129 k nss-devel x86_64 3.16.2.3-3.el6_6 updates 198 k openldap-devel x86_64 2.4.39-8.el6 base 1.1 M openssl-devel x86_64 1.0.1e-30.el6_6.5 updates 1.2 M postgresql-devel x86_64 8.4.20-1.el6_5 base 815 k sqlite-devel x86_64 3.6.20-1.el6 base 81 k unixODBC-devel x86_64 2.2.14-14.el6 base 53 k Installing for dependencies: cyrus-sasl-devel x86_64 2.1.23-15.el6_6.1 updates 303 k db4-cxx x86_64 4.7.25-18.el6_4 base 588 k freetds x86_64 0.91-2.el6 epel 568 k keyutils-libs-devel x86_64 1.4-5.el6 base 29 k krb5-devel x86_64 1.10.3-33.el6 base 498 k libcom_err-devel x86_64 1.41.12-21.el6 base 32 k libselinux-devel x86_64 2.0.94-5.8.el6 base 137 k libsepol-devel x86_64 2.0.41-4.el6 base 64 k libtool-ltdl x86_64 2.2.6-15.5.el6 base 44 k mysql x86_64 5.1.73-3.el6_5 base 894 k nspr-devel x86_64 4.10.6-1.el6_5 base 111 k nss-softokn-devel x86_64 3.14.3-22.el6_6 updates 14 k nss-softokn-freebl-devel x86_64 3.14.3-22.el6_6 updates 139 k nss-util-devel x86_64 3.16.2.3-2.el6_6 updates 68 k postgresql x86_64 8.4.20-1.el6_5 base 2.6 M postgresql-libs x86_64 8.4.20-1.el6_5 base 201 k unixODBC x86_64 2.2.14-14.el6 base 378 k Updating for dependencies: cyrus-sasl x86_64 2.1.23-15.el6_6.1 updates 78 k cyrus-sasl-lib x86_64 2.1.23-15.el6_6.1 updates 136 k e2fsprogs x86_64 1.41.12-21.el6 base 553 k e2fsprogs-libs x86_64 1.41.12-21.el6 base 121 k keyutils x86_64 1.4-5.el6 base 39 k keyutils-libs x86_64 1.4-5.el6 base 20 k krb5-libs x86_64 1.10.3-33.el6 base 765 k libblkid x86_64 2.17.2-12.18.el6 base 116 k libcom_err x86_64 1.41.12-21.el6 base 37 k libselinux x86_64 2.0.94-5.8.el6 base 108 k libselinux-utils x86_64 2.0.94-5.8.el6 base 82 k libss x86_64 1.41.12-21.el6 base 41 k libuuid x86_64 2.17.2-12.18.el6 base 69 k mysql-libs x86_64 5.1.73-3.el6_5 base 1.2 M nspr x86_64 4.10.6-1.el6_5 base 113 k nss x86_64 3.16.2.3-3.el6_6 updates 834 k nss-softokn x86_64 3.14.3-22.el6_6 updates 262 k nss-softokn-freebl x86_64 3.14.3-22.el6_6 updates 167 k nss-sysinit x86_64 3.16.2.3-3.el6_6 updates 44 k nss-tools x86_64 3.16.2.3-3.el6_6 updates 427 k nss-util x86_64 3.16.2.3-2.el6_6 updates 66 k openldap x86_64 2.4.39-8.el6 base 280 k openssl x86_64 1.0.1e-30.el6_6.5 updates 1.5 M util-linux-ng x86_64 2.17.2-12.18.el6 base 1.6 M Transaction Summary ======================================================================================================================== Install 28 Package(s) Upgrade 24 Package(s) Total download size: 25 M Is this ok [y/N]: y ・ ・ ・ $ rpmbuild -tb ~/rpmbuild/SOURCES/apr-util-1.5.4.tar.bz2 $ ll ../RPMS/x86_64/ total 2428 -rw-rw-r-- 1 hayashi hayashi 93308 Jan 30 14:34 apr-1.5.1-1.x86_64.rpm -rw-rw-r-- 1 hayashi hayashi 416372 Jan 30 14:34 apr-debuginfo-1.5.1-1.x86_64.rpm -rw-rw-r-- 1 hayashi hayashi 839308 Jan 30 14:34 apr-devel-1.5.1-1.x86_64.rpm -rw-rw-r-- 1 hayashi hayashi 77904 Jan 30 14:56 apr-util-1.5.4-1.x86_64.rpm -rw-rw-r-- 1 hayashi hayashi 7100 Jan 30 14:56 apr-util-dbm-1.5.4-1.x86_64.rpm -rw-rw-r-- 1 hayashi hayashi 433820 Jan 30 14:56 apr-util-debuginfo-1.5.4-1.x86_64.rpm -rw-rw-r-- 1 hayashi hayashi 489180 Jan 30 14:56 apr-util-devel-1.5.4-1.x86_64.rpm -rw-rw-r-- 1 hayashi hayashi 12184 Jan 30 14:56 apr-util-freetds-1.5.4-1.x86_64.rpm -rw-rw-r-- 1 hayashi hayashi 9032 Jan 30 14:56 apr-util-ldap-1.5.4-1.x86_64.rpm -rw-rw-r-- 1 hayashi hayashi 14872 Jan 30 14:56 apr-util-mysql-1.5.4-1.x86_64.rpm -rw-rw-r-- 1 hayashi hayashi 11052 Jan 30 14:56 apr-util-nss-1.5.4-1.x86_64.rpm -rw-rw-r-- 1 hayashi hayashi 20600 Jan 30 14:56 apr-util-odbc-1.5.4-1.x86_64.rpm -rw-rw-r-- 1 hayashi hayashi 10328 Jan 30 14:56 apr-util-openssl-1.5.4-1.x86_64.rpm -rw-rw-r-- 1 hayashi hayashi 14816 Jan 30 14:56 apr-util-pgsql-1.5.4-1.x86_64.rpm -rw-rw-r-- 1 hayashi hayashi 11376 Jan 30 14:56 apr-util-sqlite-1.5.4-1.x86_64.rpm出来上がり!ということで、必要なものをインストールして、再度apacheにチャレンジ。
$ sudo rpm -Uvh ../RPMS/x86_64/apr-util-1.5.4-1.x86_64.rpm ../RPMS/x86_64/apr-util-devel-1.5.4-1.x86_64.rpm $ sudo yum install zlib-devel libselinux-devel libuuid-devel pcre-devel openldap-devel lua-devel libxml2-devel distcache-devel openssl-devel ・ ・ No package distcache-devel available. ・ ・よく見たらdistcache-develがレポジトリにないらしい。
$ cd ~/rpmbuild/SOURCES/ $ wget http://ftp.riken.jp/Linux/fedora/releases/18/Everything/source/SRPMS/d/distcache-1.4.5-23.src.rpm $ rpmbuild --clean --rebuild ~/rpmbuild/SOURCES/distcache-1.4.5-23.src.rpm $ ll ~/rpmbuild/RPMS/x86_64/distcache-* ・ ・ rw-rw-r-- 1 hayashi hayashi 114528 Jan 30 15:51 distcache-1.4.5-23.x86_64.rpm -rw-rw-r-- 1 hayashi hayashi 197836 Jan 30 15:51 distcache-debuginfo-1.4.5-23.x86_64.rpm -rw-rw-r-- 1 hayashi hayashi 59216 Jan 30 15:51 distcache-devel-1.4.5-23.x86_64.rpm $ sudo rpm -ivh ~/rpmbuild/RPMS/x86_64/distcache-1.4.5-23.x86_64.rpm ~/rpmbuild/RPMS/x86_64/distcache-devel-1.4.5-23.x86_64.rpm $ rpmbuild --clean -tb ~/rpmbuild/SOURCES/httpd-2.4.12-1.src/httpd-2.4.12.tar.bz2 $ ll ~/rpmbuild/RPMS/x86_64/ ・ ・ -rw-rw-r-- 1 hayashi hayashi 1165260 Jan 30 15:57 httpd-2.4.12-1.x86_64.rpm -rw-rw-r-- 1 hayashi hayashi 3448912 Jan 30 15:57 httpd-debuginfo-2.4.12-1.x86_64.rpm -rw-rw-r-- 1 hayashi hayashi 188052 Jan 30 15:57 httpd-devel-2.4.12-1.x86_64.rpm -rw-rw-r-- 1 hayashi hayashi 3320124 Jan 30 15:57 httpd-manual-2.4.12-1.x86_64.rpm -rw-rw-r-- 1 hayashi hayashi 69988 Jan 30 15:57 httpd-tools-2.4.12-1.x86_64.rpm -rw-rw-r-- 1 hayashi hayashi 44376 Jan 30 15:57 mod_authnz_ldap-2.4.12-1.x86_64.rpm -rw-rw-r-- 1 hayashi hayashi 43448 Jan 30 15:57 mod_lua-2.4.12-1.x86_64.rpm -rw-rw-r-- 1 hayashi hayashi 22308 Jan 30 15:57 mod_proxy_html-2.4.12-1.x86_64.rpm -rw-rw-r-- 1 hayashi hayashi 5648 Jan 30 15:57 mod_socache_dc-2.4.12-1.x86_64.rpm -rw-rw-r-- 1 hayashi hayashi 81724 Jan 30 15:57 mod_ssl-2.4.12-1.x86_64.rpmようやくできました!でインストールをしてみます。
$ rpm -ivh ~/rpmbuild/RPMS/x86_64/httpd-2.4.12-1.x86_64.rpm error: Failed dependencies: /etc/mime.types is needed by httpd-2.4.12-1.x86_64まだあったか・・
$ yum provides /etc/mime.types Loaded plugins: fastestmirror, versionlock Determining fastest mirrors * base: www.ftp.ne.jp * epel: ftp.kddilabs.jp * extras: www.ftp.ne.jp * updates: www.ftp.ne.jp mailcap-2.1.31-2.el6.noarch : Helper application and MIME type associations for file types Repo : base Matched from: Filename : /etc/mime.types $ sudo yum install mailcap $ rpm -ivh ~/rpmbuild/RPMS/x86_64/httpd-2.4.12-1.x86_64.rpmできました!最後にwordpressでphpということもあり、以下の対応をする。
MPMの変更
phpの場合は、2.4から標準のeventや、workerだと挙動が不安定になる(threadsafeではない)ため、preworkで変更 ⇒2.4からはmod_proxy_fcgiを使うことでeventでも問題ない?(ここ)
#LoadModule mpm_event_module lib64/httpd/modules/mod_mpm_event.so LoadModule mpm_prefork_module lib64/httpd/modules/mod_mpm_prefork.so
$ sudo service httpd start $ /usr/sbin/apachectl -V Server version: Apache/2.4.12 (Unix) Server built: Jan 30 2015 15:55:16 Server's Module Magic Number: 20120211:41 Server loaded: APR 1.5.1, APR-UTIL 1.5.4 Compiled using: APR 1.5.1, APR-UTIL 1.5.4 Architecture: 64-bit Server MPM: prefork threaded: no forked: yes (variable process count) Server compiled with.... -D APR_HAS_SENDFILE -D APR_HAS_MMAP -D APR_HAVE_IPV6 (IPv4-mapped addresses enabled) -D APR_USE_SYSVSEM_SERIALIZE -D APR_USE_PTHREAD_SERIALIZE -D SINGLE_LISTEN_UNSERIALIZED_ACCEPT -D APR_HAS_OTHER_CHILD -D AP_HAVE_RELIABLE_PIPED_LOGS -D DYNAMIC_MODULE_LIMIT=256 -D HTTPD_ROOT="/usr" -D SUEXEC_BIN="/usr/sbin/suexec" -D DEFAULT_PIDLOG="/var/run/httpd.pid" -D DEFAULT_SCOREBOARD="logs/apache_runtime_status" -D DEFAULT_ERRORLOG="logs/error_log" -D AP_TYPES_CONFIG_FILE="/etc/httpd/conf/mime.types" -D SERVER_CONFIG_FILE="/etc/httpd/conf/httpd.conf"お~。次はphp。