Arch-Linux

Arch Linux:Yaourt/Makepkg 無法建構 Apache

  • June 21, 2016

每次有可用的更新時,我都使用 yaourt 從原始碼自動編譯 Apache extra。我這樣做是為了可以有一個自定義的 suexec docroot(/srv/www而不是預設的/srv/http)。到目前為止,這已經完美地進行了幾次更新。

$ yaourt -S apache
==> Building apache from sources.

==> Retrieving PKGBUILD and local sources...
receiving file list ... done
./
PKGBUILD
apache.conf.d
apache.install
apache.tmpfiles.conf
apachectl-confd.patch
arch.layout
httpd
httpd.logrotate
pcre_info.patch

sent 199 bytes  received 10416 bytes  7076.67 bytes/sec
total size is 9809  speedup is 0.92
=> removes/replaces '--with-suexec-docroot=\/srv\/http' by '--with-suexec-docroot=\/srv\/www' in global
--- ./PKGBUILD  2012-07-06 00:02:13.000000000 -0400
+++ ./PKGBUILD.custom   2012-07-06 15:49:03.000000000 -0400
@@ -102,7 +102,7 @@
           --enable-so \
           --enable-suexec \
           --with-suexec-caller=http \
-           --with-suexec-docroot=/srv/http \
+           --with-suexec-docroot=/srv/www \
           --with-suexec-logfile=/var/log/httpd/suexec.log \
           --with-suexec-bin=/usr/sbin/suexec \
           --with-suexec-uidmin=99 --with-suexec-gidmin=99 \
==> Edit PKGBUILD ? [y/N] ("A" to abort)
==> ------------------------------------
==> n

==> apache dependencies:
- openssl (already installed)
- zlib (already installed)
- apr-util (already installed)
- pcre (already installed)


==> Edit apache.install ? [y/N] ("A" to abort)
==> ------------------------------------------
==> n

==> Continue building apache ? [Y/n]
==> --------------------------------
==> 
==> Building and installing package
==> Making package: apache 2.2.22-4 (Thu Jul  5 14:47:33 EDT 2012)
==> Checking runtime dependencies...
==> Checking buildtime dependencies...
==> Retrieving Sources...
 -> Downloading httpd-2.2.22.tar.bz2...
 % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                Dload  Upload   Total   Spent    Left  Speed
100 5252k  100 5252k    0     0  93231      0  0:00:57  0:00:57 --:--:-- 93283
 -> Downloading httpd-2.2.22.tar.bz2.asc...
 % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                Dload  Upload   Total   Spent    Left  Speed
100   835  100   835    0     0   5191      0 --:--:-- --:--:-- --:--:-- 10437
 -> Downloading 02-rename-prefork-to-itk.patch...
 % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                Dload  Upload   Total   Spent    Left  Speed
 0     0    0     0    0     0      0      0 --:--:--  0:01:06 --:--:--     0curl: (7)     couldn't connect to host
==> ERROR: Failure while downloading 02-rename-prefork-to-itk.patch
   Aborting...
==> ERROR: Makepkg was unable to build apache.
==> Restart building apache ? [y/N]
==> -------------------------------
==> 

問題似乎是 curl 找不到02-rename-prefork-to-itk.patch. 我不知道它位於哪個 URL,它在哪個文件中指定,或者我如何找到它的備用位置。知道發生了什麼/如何排除故障嗎?

部分更新檔所在的主機宕機。但我們可以將其更改為另一個。

第一的。只需使用 yaourt 下載 PKGBUILD:

yaourt -G apache

更改 PKGBUILD 中的以下行:

_itkurl=http://mpm-itk.sesse.net/apache2.2-mpm-itk-2.2.17-01

到:

_itkurl=http://distfiles.alpinelinux.org/distfiles/

此外,更新檔 03-add-mpm-to-build-system.patch 具有不同的 md5,因此我們對其進行了修復。只需更改數組“md5sums”中的第 4 行

'cdfa04985a0efa850976aef01c2a0c40'

到:

'131408ad4dc7b18547b4e062e7e495ab'

工作的 PKGBUILD 在這裡: http: //pastebin.com/iK48xx8f

如果你願意,你可以直接更換它。並使用以下命令建構 apache:

makepkg -i
curl: (7)     couldn't connect to host

根據 curl 的說法,它無法連接到主機。這可能有很多原因,例如文件不在伺服器上。我的建議是稍後再試,如果這不起作用,那麼聯繫正在下載文件的主機。

引用自:https://unix.stackexchange.com/questions/42406