Commit b2a4894d authored by Vladimir Bashkirtsev's avatar Vladimir Bashkirtsev

Initial commit

parents
all: httpd-service
rm /etc/passwd
mv -v /data/etc/passwd /etc/passwd
rm /etc/group
mv -v /data/etc/group /etc/group
rm /etc/shadow
mv -v /data/etc/shadow /etc/shadow
rm /etc/gshadow
mv -v /data/etc/gshadow /etc/gshadow
groupadd -g 25 apache
useradd -c "Apache Server" -d /srv/www -g apache -s /bin/false -u 25 apache
rm /etc/passwd-
rm /etc/group-
rm /etc/shadow-
rm /etc/gshadow-
mv -v /etc/passwd /data/etc/passwd
ln -sv /data/etc/passwd /etc/passwd
mv -v /etc/group /data/etc/group
ln -sv /data/etc/group /etc/group
mv -v /etc/shadow /data/etc/shadow
ln -sv /data/etc/shadow /etc/shadow
mv -v /etc/gshadow /data/etc/gshadow
ln -sv /data/etc/gshadow /etc/gshadow
tar xf httpd-2.4.26.tar.bz2
patch -Np1 -d httpd-2.4.26 < httpd-2.4.26-blfs_layout-1.patch
cd httpd-2.4.26 && sed '/dir.*CFG_PREFIX/s@^@#@' -i support/apxs.in
cd httpd-2.4.26 && ./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) -C httpd-2.4.26
$(MAKE) -C httpd-2.4.26 install
mv -v /usr/sbin/suexec /usr/lib/httpd/suexec
chgrp apache /usr/lib/httpd/suexec
chmod 4754 /usr/lib/httpd/suexec
chown -v -R apache:apache /srv/www
mkdir -p /etc/httpd/conf
cat /etc/httpd/httpd.conf | sed -n '/^# DocumentRoot:/,/^# DirectoryIndex:/{ /^# DirectoryIndex:.*$$/d; p; }' > /etc/httpd/conf/DocumentRoot.conf
sed '/^# DocumentRoot:/,/^# DirectoryIndex:/{/^# DirectoryIndex:/!d}' -i /etc/httpd/httpd.conf
cat /etc/httpd/httpd.conf | sed -n '/^# DirectoryIndex:/,/^# The following/{ /^# The following.*$$/d; p; }' > /etc/httpd/conf/DirectoryIndex.conf
sed '/^# DirectoryIndex:/,/^# The following/{/^# The following/!d}' -i /etc/httpd/httpd.conf
@echo "IncludeOptional conf/*.conf" >> /etc/httpd/httpd.conf
@echo "d /run/httpd 755 root root -" > /usr/lib/tmpfiles.d/httpd.conf
@echo "$$HTTPD_SERVICE" > /lib/systemd/system/httpd.service
systemctl enable httpd.service
rm -rf httpd-2.4.26
httpd-service:
define HTTPD_SERVICE
[Unit]
Description=Apache Web Server
After=network.target remote-fs.target nss-lookup.target
[Service]
Type=forking
PIDFile=/run/httpd/httpd.pid
ExecStart=/usr/sbin/apachectl start
ExecStop=/usr/sbin/apachectl graceful-stop
ExecReload=/usr/sbin/apachectl graceful
PrivateTmp=true
LimitNOFILE=infinity
[Install]
WantedBy=multi-user.target
endef
export HTTPD_SERVICE
This diff is collapsed.
etc
/etc/.*
bin
/usr/bin/.*
/usr/sbin/.*
/usr/share/httpd/icons/.*
/usr/share/httpd/build/.*
/usr/share/httpd/error/.*
/usr/lib/tmpfiles.d/.*
/lib/systemd/system/.*
/usr/lib/httpd/modules/.*
/usr/lib/httpd/cgi-bin/.*
/usr/lib/httpd/suexec
headers
/usr/include/.*
man
/usr/share/man/.*
doc
/usr/share/httpd/manual/.*
www
/srv/www/.*
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment