apache: systemd support, revbump.

This commit is contained in:
Juan RP 2012-01-27 10:47:02 +01:00
parent a31ac153b1
commit 6d18855296
6 changed files with 31 additions and 91 deletions

View file

@ -1,15 +0,0 @@
# Configuration file for the Apache httpd service.
#
# The default processing model (MPM) is the process-based
# 'prefork' model. A thread-based model, 'worker', is also
# available, but does not work with some modules (such as PHP).
# The service must be stopped before changing this variable.
#
#HTTPD=/usr/sbin/httpd.worker
#
# To pass additional options (for instance, -D definitions) to the
# httpd binary at startup, set OPTIONS here.
#
#OPTIONS=

View file

@ -1,47 +0,0 @@
#!/sbin/runscript
#
command=/usr/sbin/apachectl
pidfile=/var/run/httpd/httpd.pid
extra_commands="reload"
describe="The Apache HTTP server"
depend()
{
need localmount
provide httpd
}
start()
{
if [ ! -d /var/run/httpd ]; then
mkdir -p /var/run/httpd
fi
if [ ! -d /var/log/httpd ]; then
mkdir -p /var/log/httpd
fi
ebegin "Starting Apache HTTP server"
${command} start >/dev/null
eend $?
}
stop()
{
ebegin "Stopping Apache HTTP server"
${command} stop >/dev/null
eend $?
}
restart()
{
ebegin "Restarting Apache HTTP server"
${command} restart >/dev/null
eend $?
}
reload()
{
ebegin "Restarting Apache gracefully"
${command} graceful >/dev/null
eend $?
}

View file

@ -0,0 +1,16 @@
[Unit]
Description=The Apache HTTP Server
After=syslog.target network.target remote-fs.target
Conflicts=apache-mpm-event.target apache-mpm-worker.target
[Service]
Type=forking
PIDFile=/var/run/httpd/httpd.pid
ExecStart=/usr/sbin/httpd -k start
ExecReload=/usr/sbin/httpd -t
ExecReload=/bin/kill -HUP $MAINPID
ExecStop=/usr/sbin/httpd -k stop
PrivateTmp=true
[Install]
WantedBy=multi-user.target

View file

@ -0,0 +1,4 @@
d /var/log/httpd 755 root httpd
d /var/run/httpd 710 root httpd
d /srv/httpd 755 root httpd
d /srv/httpd/cgi-bin 755 root httpd

View file

@ -1,15 +0,0 @@
--- support/apachectl.in.orig 2010-03-06 18:09:11.000000000 +0100
+++ support/apachectl.in 2010-03-06 18:12:31.000000000 +0100
@@ -56,6 +56,12 @@
# the URL to your server's mod_status status page. If you do not
# have one, then status and fullstatus will not work.
STATUSURL="http://localhost:@PORT@/server-status"
+
+# Source /etc/conf.d/apache for $HTTPD setting, etc.
+if [ -r /etc/conf.d/apache ]; then
+ . /etc/conf.d/apache
+fi
+
#
# Set this variable to a command that increases the maximum
# number of file descriptors allowed per child process. This is

View file

@ -19,7 +19,7 @@ configure_args="--prefix= --enable-pie --enable-modules=all
--enable-dav --enable-info --enable-cgi --enable-cgid --enable-dav-fs
--enable-dav-lock --enable-vhost-alias --enable-imagemap --enable-so
--enable-rewrite --with-pcre=/usr --enable-layout=XBPS --sysconfdir=/etc/httpd"
revision=2
revision=3
short_desc="The Number One HTTP Server On The Internet"
maintainer="Juan RP <xtraeme@gmail.com>"
homepage="http://httpd.apache.org/"
@ -35,7 +35,6 @@ long_desc="
subpackages="apache-devel"
conf_files="
/etc/conf.d/apache
/etc/httpd/extra/httpd-autoindex.conf
/etc/httpd/extra/httpd-dav.conf
/etc/httpd/extra/httpd-manual.conf
@ -51,13 +50,12 @@ conf_files="
/etc/httpd/magic
/etc/httpd/mime.types"
systemd_services="apache.service on"
system_accounts="httpd"
httpd_descr="Apache HTTP server"
httpd_homedir="/srv/httpd"
openrc_services="apache default false"
keep_empty_dirs=yes
Add_dependency run libdb
Add_dependency run gdbm
Add_dependency run expat
@ -68,26 +66,24 @@ Add_dependency build perl ">=0"
Add_dependency build zlib-devel
Add_dependency build libuuid-devel
Add_dependency build pcre-devel
Add_dependency build openssl-devel
Add_dependency build db-devel
Add_dependency build gdbm-devel
Add_dependency build expat-devel
Add_dependency build libldap-devel
Add_dependency build openssl-devel
Add_dependency build apr-devel
Add_dependency build apr-util-devel
pre_configure()
{
pre_configure() {
# set default user
sed -e 's#User daemon#User httpd#' \
-e 's#Group daemon#Group httpd#' \
-i ${wrksrc}/docs/conf/httpd.conf.in
-i docs/conf/httpd.conf.in
cat ${FILESDIR}/xbps.layout >> ${wrksrc}/config.layout
cat ${FILESDIR}/xbps.layout >> config.layout
}
post_install()
{
post_install() {
# Enable userdir, languages, autoindex, errors.
# Set a working ServerRoot, disable mod_unique_id.
# Set and enable ServerName to 127.0.0.1.
@ -112,9 +108,10 @@ post_install()
rm -f ${DESTDIR}/srv/httpd/cgi-bin/printenv
rm -f ${DESTDIR}/srv/httpd/index.html
# systemd and logrotate files.
vinstall ${FILESDIR}/apache.logrotate 644 etc/logrotate.d apache
vinstall ${FILESDIR}/apache.rc 755 etc/init.d apache
vinstall ${FILESDIR}/apache.confd 644 etc/conf.d apache
vinstall ${FILESDIR}/apache.service 644 lib/systemd/system
vinstall ${FILESDIR}/apache.tmpfiles 644 usr/lib/tmpfiles.d apache.conf
rm -rf ${DESTDIR}/etc/httpd/original
}