-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapache
71 lines (52 loc) · 2.19 KB
/
apache
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
#!/bin/bash
export CFLAGS=-"O2"
export CXXFLAGS="-O2"
PKG_VER=2.4.63
URL=https://archive.apache.org/dist/httpd/httpd-$PKG_VER.tar.bz2
TAR=$(echo $URL | sed -r 's|(.*)/||')
DIR=$(echo $TAR | sed 's|.tar.*||g')
PACKAGE=apache
# Thanks LFS for systemd units
BLFS_SYSTEMD_VER=20241211
# Get Package
cd /blfs/builds
wget $URL
wget https://www.linuxfromscratch.org/patches/blfs/svn/httpd-$PKG_VER-blfs_layout-1.patch
tar -xvf $TAR
cd $DIR
# Build
patch -Np1 -i ../httpd-$PKG_VER-blfs_layout-1.patch &&
sed '/dir.*CFG_PREFIX/s@^@#@' -i support/apxs.in &&
sed -e '/HTTPD_ROOT/s:${ap_prefix}:/etc/httpd:' \
-e '/SERVER_CONFIG_FILE/s:${rel_sysconfdir}/::' \
-e '/AP_TYPES_CONFIG_FILE/s:${rel_sysconfdir}/::' \
-i configure &&
./configure --enable-authnz-fcgi \
--enable-layout=BLFS \
--enable-mods-shared="all cgi" \
--enable-mpms-shared=all \
--enable-suexec=shared \
--with-apr=/usr/bin/apr-1-config \
--with-apr-util=/usr/bin/apu-1-config \
--with-suexec-bin=/usr/lib/httpd/suexec \
--with-suexec-caller=apache \
--with-suexec-docroot=/srv/www \
--with-suexec-logfile=/var/log/httpd/suexec.log \
--with-suexec-uidmin=100 \
--with-suexec-userdir=public_html
make -j22
# Install
sudo make DESTDIR=/pkgs/$PACKAGE install
mv -v /pkgs/$PACKAGE/usr/sbin/suexec /pkgs/$PACKAGE/usr/lib/httpd/suexec &&
chgrp apache /pkgs/$PACKAGE/usr/lib/httpd/suexec &&
chmod 4754 /pkgs/$PACKAGE/usr/lib/httpd/suexec
echo 'groupadd -g 25 apache &&
useradd -c "Apache Server" -d /srv/www -g apache \
-s /bin/false -u 25 apache' > /pkgs/$PACKAGE/postinst
cd /pkgs
sudo echo "apr-util nghttp2 openssl pcre2 zlib libxcrypt" > /pkgs/$PACKAGE/depends
sudo echo "" > /pkgs/$PACKAGE/make-depends
sudo tar -cvzpf $PACKAGE.tar.xz $PACKAGE
sudo cp $PACKAGE.tar.xz /finished
cd /blfs/builds
sudo rm -r $DIR