summaryrefslogtreecommitdiff
path: root/strata/apache-httpd-server
diff options
context:
space:
mode:
Diffstat (limited to 'strata/apache-httpd-server')
-rw-r--r--strata/apache-httpd-server/apr.morph25
-rw-r--r--strata/apache-httpd-server/httpd-server.morph60
-rw-r--r--strata/apache-httpd-server/mod_wsgi.morph22
3 files changed, 107 insertions, 0 deletions
diff --git a/strata/apache-httpd-server/apr.morph b/strata/apache-httpd-server/apr.morph
new file mode 100644
index 00000000..87e05910
--- /dev/null
+++ b/strata/apache-httpd-server/apr.morph
@@ -0,0 +1,25 @@
+name: apr
+kind: chunk
+configure-commands:
+- ./buildconf
+- |
+ ./configure --prefix="$PREFIX" \
+ --disable-static \
+ --enable-threads \
+ --with-installbuilddir="$PREFIX"/share/apr-1/build
+build-commands:
+- make
+install-commands:
+- PREFIX="$PREFIX" DESTDIR="$DESTDIR" make install
+# Install files required for apr-util and httpd
+- |
+ for file in find_apr.m4 apr_common.m4 install.sh gen-build.py get-version.sh \
+ config.guess config.sub; do \
+ cp build/$file "$DESTDIR$PREFIX"/share/apr-1/build/$file ; \
+ done
+# Create a symlink in the build directory to the include directory (this is needed for httpd)
+- ln -sf /usr/include/apr-2 "$DESTDIR$PREFIX"/share/apr-1/build/
+post-install-commands:
+# Copy apr headers needed for mod_wsgi
+- cp include/private/apr_support.h "$DESTDIR$PREFIX"/include/apr-2
+- cp include/arch/unix/apr_private.h "$DESTDIR$PREFIX"/include/apr-2
diff --git a/strata/apache-httpd-server/httpd-server.morph b/strata/apache-httpd-server/httpd-server.morph
new file mode 100644
index 00000000..ffaf28fd
--- /dev/null
+++ b/strata/apache-httpd-server/httpd-server.morph
@@ -0,0 +1,60 @@
+name: httpd-server
+kind: chunk
+configure-commands:
+- ./buildconf --with-apr=/usr/share/apr-1
+- |
+ ./configure --prefix="$PREFIX" \
+ --libdir="$PREFIX"/lib \
+ --sysconfdir="$PREFIX"/httpd/conf \
+ --includedir="$PREFIX"/httpd \
+ --libexecdir="$PREFIX"/lib/httpd/modules \
+ --datadir=/srv/www \
+ --enable-layout=RedHat \
+ --enable-mpms-shared=all \
+ --with-apr=/usr/bin/apr-2-config \
+ --with-apr-util=/usr/bin/apu-1-config \
+ --enable-suexec --with-suexec \
+ --with-suexec-caller=apache \
+ --with-suexec-docroot=/srv/www \
+ --with-suexec-logfile=/var/log/httpd/suexec.log \
+ --with-suexec-bin=/usr/lib/httpd/suexec \
+ --with-suexec-uidmin=500 --with-suexec-gidmin=100\
+ --with-suexec-userdir=public_html \
+ --enable-pie \
+ --with-pcre \
+ --enable-mods-shared=all \
+ --enable-ssl --with-ssl \
+ --enable-case-filter --enable-case-filter-in \
+ --enable-cgid --enable-cgi\
+ --enable-so
+build-commands:
+- make
+install-commands:
+- PREFIX="$PREFIX" DESTDIR="$DESTDIR" make install
+post-install-commands:
+# Add perl interpreter path to apxs script, required for loading mod_wsgi.
+- |
+ sed -i 's|#!/replace/with/path/to/perl/interpreter -w|#!/usr/bin/perl -w|g' \
+ "$DESTDIR$PREFIX"/bin/apxs
+# Add conf.d directory where apache will look for other configurations to load.
+- mkdir -p "$DESTDIR$PREFIX"/httpd/conf.d
+- echo 'Include /usr/httpd/conf.d/*.conf' >> "$DESTDIR$PREFIX"/httpd/conf/httpd.conf
+####################################################################################
+# This chunk should add an apache user and an apache group, create the apache home
+# directory and move suexec to /usr/lib/httpd/suexec as system-integration time.
+# This is not possible due a bug in linux-chroot which does not allow to change
+# the owners of directories or files. So for now you should create an script
+# which includes the following commands:
+# - mkdir -p /srv/www
+# - groupadd -r apache
+# - |
+# useradd -c "Apache Server" -d /srv/www -g apache \
+# -s /bin/false apache
+#
+# - mkdir -p /usr/lib/httpd
+# - mv -v /usr/bin/suexec /usr/lib/httpd/suexec
+# - chgrp apache /usr/lib/httpd/suexec
+# - chmod 4754 /usr/lib/httpd/suexec
+# - chown -R apache:apache /srv/www
+####################################################################################
+
diff --git a/strata/apache-httpd-server/mod_wsgi.morph b/strata/apache-httpd-server/mod_wsgi.morph
new file mode 100644
index 00000000..48126787
--- /dev/null
+++ b/strata/apache-httpd-server/mod_wsgi.morph
@@ -0,0 +1,22 @@
+name: mod_wsgi
+kind: chunk
+configure-commands:
+- |
+ ./configure --prefix="$PREFIX" \
+ --enable-shared \
+ --with-apxs=/usr/bin/apxs
+build-commands:
+- make
+install-commands:
+- PREFIX="$PREFIX" DESTDIR="$DESTDIR" make install
+post-install-commands:
+- |
+ install -D -m 644 /proc/self/fd/0 <<'EOF' "$DESTDIR$PREFIX"/httpd/conf.d/wsgi.conf
+ # NOTE: mod_wsgi can not coexist in the same apache process as
+ # mod_wsgi_python3. Only load if mod_wsgi_python3 is not
+ # already loaded.
+
+ <IfModule !wsgi_module>
+ LoadModule wsgi_module /usr/lib/httpd/modules/mod_wsgi.so
+ </IfModule>
+ EOF