summaryrefslogtreecommitdiffstats
path: root/meta-webserver/recipes-httpd
diff options
context:
space:
mode:
authorTudor Florea <tudor.florea@enea.com>2014-10-10 03:20:04 +0200
committerTudor Florea <tudor.florea@enea.com>2014-10-10 03:20:04 +0200
commit1b8dfe266937a37a4c642f96ceb2347bf4c00a17 (patch)
tree0c6aab146bb3c82efd9c7846a9a4e70dcb0ec84f /meta-webserver/recipes-httpd
downloadmeta-openembedded-daisy-140929.tar.gz
initial commit for Enea Linux 4.0-140929daisy-140929
Migrated from the internal git server on the daisy-enea-point-release branch Signed-off-by: Tudor Florea <tudor.florea@enea.com>
Diffstat (limited to 'meta-webserver/recipes-httpd')
-rw-r--r--meta-webserver/recipes-httpd/apache2/apache2-native_2.4.9.bb42
-rw-r--r--meta-webserver/recipes-httpd/apache2/apache2/apache-configure_perlbin.patch37
-rw-r--r--meta-webserver/recipes-httpd/apache2/apache2/apache-ssl-ltmain-rpath.patch76
-rw-r--r--meta-webserver/recipes-httpd/apache2/apache2/fix-libtool-name.patch55
-rw-r--r--meta-webserver/recipes-httpd/apache2/apache2/httpd-2.4.1-corelimit.patch37
-rw-r--r--meta-webserver/recipes-httpd/apache2/apache2/httpd-2.4.1-selinux.patch63
-rw-r--r--meta-webserver/recipes-httpd/apache2/apache2/httpd-2.4.4-export.patch22
-rw-r--r--meta-webserver/recipes-httpd/apache2/apache2/npn-patch-2.4.7.patch289
-rw-r--r--meta-webserver/recipes-httpd/apache2/apache2/replace-lynx-to-curl-in-apachectl-script.patch52
-rw-r--r--meta-webserver/recipes-httpd/apache2/apache2/server-makefile.patch11
-rw-r--r--meta-webserver/recipes-httpd/apache2/apache2_2.4.9.bb142
-rw-r--r--meta-webserver/recipes-httpd/apache2/files/apache2-volatile.conf2
-rw-r--r--meta-webserver/recipes-httpd/apache2/files/httpd-2.4.3-fix-race-issue-of-dir-install.patch21
-rwxr-xr-xmeta-webserver/recipes-httpd/apache2/files/init73
-rw-r--r--meta-webserver/recipes-httpd/cherokee/cherokee/cherokee-install-configured.py-once.patch40
-rw-r--r--meta-webserver/recipes-httpd/cherokee/cherokee/cherokee.init32
-rw-r--r--meta-webserver/recipes-httpd/cherokee/cherokee/cherokee.service10
-rw-r--r--meta-webserver/recipes-httpd/cherokee/cherokee_1.2.98.bb67
-rw-r--r--meta-webserver/recipes-httpd/hiawatha/files/hiawatha-init44
-rw-r--r--meta-webserver/recipes-httpd/hiawatha/files/hiawatha.service16
-rw-r--r--meta-webserver/recipes-httpd/hiawatha/hiawatha_9.2.bb66
-rw-r--r--meta-webserver/recipes-httpd/nginx/files/nginx-cross.patch217
-rw-r--r--meta-webserver/recipes-httpd/nginx/files/nginx-volatile.conf2
-rw-r--r--meta-webserver/recipes-httpd/nginx/files/nginx.conf118
-rwxr-xr-xmeta-webserver/recipes-httpd/nginx/files/nginx.init52
-rw-r--r--meta-webserver/recipes-httpd/nginx/nginx_1.4.4.bb117
-rw-r--r--meta-webserver/recipes-httpd/nostromo/files/0001-GNUmakefile-add-possibility-to-override-variables.patch141
-rw-r--r--meta-webserver/recipes-httpd/nostromo/files/nhttpd.conf55
-rw-r--r--meta-webserver/recipes-httpd/nostromo/files/nostromo34
-rw-r--r--meta-webserver/recipes-httpd/nostromo/files/tmpfiles.conf1
-rw-r--r--meta-webserver/recipes-httpd/nostromo/files/volatiles2
-rw-r--r--meta-webserver/recipes-httpd/nostromo/nostromo_1.9.5.bb69
-rw-r--r--meta-webserver/recipes-httpd/sthttpd/sthttpd/init52
-rw-r--r--meta-webserver/recipes-httpd/sthttpd/sthttpd/thttpd.service10
-rw-r--r--meta-webserver/recipes-httpd/sthttpd/sthttpd_2.26.4.bb40
35 files changed, 2107 insertions, 0 deletions
diff --git a/meta-webserver/recipes-httpd/apache2/apache2-native_2.4.9.bb b/meta-webserver/recipes-httpd/apache2/apache2-native_2.4.9.bb
new file mode 100644
index 000000000..aaa7e607d
--- /dev/null
+++ b/meta-webserver/recipes-httpd/apache2/apache2-native_2.4.9.bb
@@ -0,0 +1,42 @@
1DESCRIPTION = "The Apache HTTP Server is a powerful, efficient, and \
2extensible web server."
3SUMMARY = "Apache HTTP Server"
4HOMEPAGE = "http://httpd.apache.org/"
5DEPENDS = "expat-native pcre-native apr-native apr-util-native"
6SECTION = "net"
7LICENSE = "Apache-2.0"
8
9inherit native
10
11SRC_URI = "http://www.apache.org/dist/httpd/httpd-${PV}.tar.bz2"
12
13S = "${WORKDIR}/httpd-${PV}"
14
15LIC_FILES_CHKSUM = "file://LICENSE;md5=dbff5a2b542fa58854455bf1a0b94b83"
16SRC_URI[md5sum] = "2ef4e65353497606b24fa9bb3e5a3c40"
17SRC_URI[sha256sum] = "f78cc90dfa47caf3d83ad18fd6b4e85f237777c1733fc9088594b70ce2847603"
18
19do_configure () {
20 ./configure --with-apr=${STAGING_BINDIR_CROSS}/apr-1-config \
21 --with-apr-util=${STAGING_BINDIR_CROSS}/apu-1-config \
22 --prefix=${prefix} --datadir=${datadir}/apache2
23}
24
25do_install () {
26 install -d ${D}${bindir} ${D}${libdir}
27 cp server/gen_test_char ${D}${bindir}
28 install -m 755 support/apxs ${D}${bindir}/
29 install -m 755 httpd ${D}${bindir}/
30 install -d ${D}${datadir}/apache2/build
31 cp build/*.mk ${D}${datadir}/apache2/build
32 cp build/instdso.sh ${D}${datadir}/apache2/build
33
34 install -d ${D}${includedir}/apache2
35 cp include/* ${D}${includedir}/apache2
36 cp os/unix/os.h ${D}${includedir}/apache2
37 cp os/unix/unixd.h ${D}${includedir}/apache2
38
39 cp support/envvars-std ${D}${bindir}/envvars
40 chmod 755 ${D}${bindir}/envvars
41}
42
diff --git a/meta-webserver/recipes-httpd/apache2/apache2/apache-configure_perlbin.patch b/meta-webserver/recipes-httpd/apache2/apache2/apache-configure_perlbin.patch
new file mode 100644
index 000000000..baa739fd4
--- /dev/null
+++ b/meta-webserver/recipes-httpd/apache2/apache2/apache-configure_perlbin.patch
@@ -0,0 +1,37 @@
1# Author: echo <fei.geng@windriver.com>
2# Date: April 28 2009
3# Summary:Fix perl install directory to /usr/bin
4#
5# Upstream-Status: Inappropriate [configuration]
6
7--- a/configure
8+++ b/configure
9@@ -22365,13 +22365,7 @@
10 #define APACHE_MPM_DIR "$MPM_DIR"
11 _ACEOF
12
13-
14-perlbin=`$ac_aux_dir/PrintPath perl`
15-if test "x$perlbin" = "x"; then
16- perlbin="/replace/with/path/to/perl/interpreter"
17-fi
18-
19-
20+perlbin='/usr/bin/perl'
21
22 BSD_MAKEFILE=no
23 ap_make_include=include
24--- a/configure.in
25+++ b/configure.in
26@@ -638,10 +638,7 @@
27 AC_DEFINE_UNQUOTED(APACHE_MPM_DIR, "$MPM_DIR",
28 [Location of the source for the current MPM])
29
30-perlbin=`$ac_aux_dir/PrintPath perl`
31-if test "x$perlbin" = "x"; then
32- perlbin="/replace/with/path/to/perl/interpreter"
33-fi
34+perlbin='/usr/bin/perl'
35 AC_SUBST(perlbin)
36
37 dnl If we are running on BSD/OS, we need to use the BSD .include syntax.
diff --git a/meta-webserver/recipes-httpd/apache2/apache2/apache-ssl-ltmain-rpath.patch b/meta-webserver/recipes-httpd/apache2/apache2/apache-ssl-ltmain-rpath.patch
new file mode 100644
index 000000000..3a59fb079
--- /dev/null
+++ b/meta-webserver/recipes-httpd/apache2/apache2/apache-ssl-ltmain-rpath.patch
@@ -0,0 +1,76 @@
1--- httpd-2.2.8.orig/build/ltmain.sh
2+++ httpd-2.2.8/build/ltmain.sh
3@@ -1515,7 +1515,7 @@ EOF
4 dir=`$echo "X$arg" | $Xsed -e 's/^-L//'`
5 # We need an absolute path.
6 case $dir in
7- [\\/]* | [A-Za-z]:[\\/]*) ;;
8+ =* | [\\/]* | [A-Za-z]:[\\/]*) ;;
9 *)
10 absdir=`cd "$dir" && pwd`
11 if test -z "$absdir"; then
12@@ -2558,7 +2558,7 @@ EOF
13 $echo "*** $linklib is not portable!"
14 fi
15 if test "$linkmode" = lib &&
16- test "$hardcode_into_libs" = yes; then
17+ test "x$wrs_use_rpaths" = "xyes" && test "$hardcode_into_libs" = yes; then
18 # Hardcode the library path.
19 # Skip directories that are in the system default run-time
20 # search path.
21@@ -2832,7 +2832,7 @@ EOF
22
23 if test "$linkmode" = lib; then
24 if test -n "$dependency_libs" &&
25- { test "$hardcode_into_libs" != yes ||
26+ { test "$hardcode_into_libs" != yes || test "x$wrs_use_rpaths" != "xyes" ||
27 test "$build_old_libs" = yes ||
28 test "$link_static" = yes; }; then
29 # Extract -R from dependency_libs
30@@ -3426,7 +3426,8 @@ EOF
31 *) finalize_rpath="$finalize_rpath $libdir" ;;
32 esac
33 done
34- if test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then
35+ if test "$hardcode_into_libs" != yes || test "x$wrs_use_rpaths" != "xyes" ||
36+ test "$build_old_libs" = yes; then
37 dependency_libs="$temp_xrpath $dependency_libs"
38 fi
39 fi
40@@ -3843,7 +3844,7 @@ EOF
41 case $archive_cmds in
42 *\$LD\ *) wl= ;;
43 esac
44- if test "$hardcode_into_libs" = yes; then
45+ if test "$hardcode_into_libs" = yes && test "x$wrs_use_rpaths" = "xyes" ; then
46 # Hardcode the library paths
47 hardcode_libdirs=
48 dep_rpath=
49@@ -4397,6 +4398,27 @@ EOF
50 # Now hardcode the library paths
51 rpath=
52 hardcode_libdirs=
53+
54+ # short circuit putting rpaths in executables
55+ #
56+ if test "x$wrs_use_rpaths" != "xyes" ; then
57+ flag=
58+ for libdir in $compile_rpath; do
59+ case $(echo $libdir | ${SED} 's,/[/]*,/,g') in
60+ /usr/lib/* | /usr/lib32/* | /usr/lib64/* ) flag="$flag $libdir" ;;
61+ esac
62+ done
63+ compile_rpath="$flag"
64+
65+ flag=
66+ for libdir in $finalize_rpath; do
67+ case $(echo $libdir | ${SED} 's,/[/]*,/,g') in
68+ /usr/lib/* | /usr/lib32/* | /usr/lib64/* ) flag="$flag $libdir" ;;
69+ esac
70+ done
71+ finalize_rpath="$flag"
72+ fi
73+
74 for libdir in $compile_rpath $finalize_rpath; do
75 if test -n "$hardcode_libdir_flag_spec"; then
76 if test -n "$hardcode_libdir_separator"; then
diff --git a/meta-webserver/recipes-httpd/apache2/apache2/fix-libtool-name.patch b/meta-webserver/recipes-httpd/apache2/apache2/fix-libtool-name.patch
new file mode 100644
index 000000000..027af04c3
--- /dev/null
+++ b/meta-webserver/recipes-httpd/apache2/apache2/fix-libtool-name.patch
@@ -0,0 +1,55 @@
1Fix build scripts to use correct libtool filename
2
3Upstream-Status: Inappropriate [configuration]
4
5---
6 httpd-2.4.2/build/config_vars.sh.in | 2 +-
7 httpd-2.4.2/configure | 2 +-
8 httpd-2.4.2/configure.in | 2 +-
9 httpd-2.4.2/support/apxs.in | 2 +-
10 4 files changed, 4 insertions(+), 4 deletions(-)
11
12--- a/build/config_vars.sh.in
13+++ b/build/config_vars.sh.in
14@@ -35,7 +35,7 @@ else
15 APU_CONFIG=@APU_CONFIG@
16 fi
17
18-APR_LIBTOOL="`${APR_CONFIG} --apr-libtool`"
19+APR_LIBTOOL="`${APR_CONFIG} --apr-libtool | sed -e s,libtool,${host_alias}-libtool,`"
20 APR_INCLUDEDIR="`${APR_CONFIG} --includedir`"
21 test -n "@APU_CONFIG@" && APU_INCLUDEDIR="`${APU_CONFIG} --includedir`"
22
23--- a/configure
24+++ b/configure
25@@ -6205,7 +6205,7 @@ case $host in
26 if test "x$LTFLAGS" = "x"; then
27 LTFLAGS='--silent'
28 fi
29- my_libtool=`$apr_config --apr-libtool`
30+ my_libtool=`$apr_config --apr-libtool | sed -e s,libtool,${host_alias}-libtool,`
31 LIBTOOL="$my_libtool \$(LTFLAGS)"
32 libtoolversion=`$my_libtool --version`
33 case $libtoolversion in
34--- a/configure.in
35+++ b/configure.in
36@@ -264,7 +264,7 @@ case $host in
37 if test "x$LTFLAGS" = "x"; then
38 LTFLAGS='--silent'
39 fi
40- my_libtool=`$apr_config --apr-libtool`
41+ my_libtool=`$apr_config --apr-libtool | sed -e s,libtool,${host_alias}-libtool,`
42 LIBTOOL="$my_libtool \$(LTFLAGS)"
43 libtoolversion=`$my_libtool --version`
44 case $libtoolversion in
45--- a/support/apxs.in
46+++ b/support/apxs.in
47@@ -352,7 +352,7 @@ if ($apr_major_version < 2) {
48 }
49 }
50
51-my $libtool = `$apr_config --apr-libtool`;
52+my $libtool = `$apr_config --apr-libtool| sed -e s,libtool,${host_alias}-libtool,`;
53 chomp($libtool);
54
55 my $apr_includedir = `$apr_config --includes`;
diff --git a/meta-webserver/recipes-httpd/apache2/apache2/httpd-2.4.1-corelimit.patch b/meta-webserver/recipes-httpd/apache2/apache2/httpd-2.4.1-corelimit.patch
new file mode 100644
index 000000000..18e4107ec
--- /dev/null
+++ b/meta-webserver/recipes-httpd/apache2/apache2/httpd-2.4.1-corelimit.patch
@@ -0,0 +1,37 @@
1
2Bump up the core size limit if CoreDumpDirectory is
3configured.
4
5Upstream-Status: Pending
6
7Note: upstreaming was discussed but there are competing desires;
8 there are portability oddities here too.
9
10--- httpd-2.4.1/server/core.c.corelimit
11+++ httpd-2.4.1/server/core.c
12@@ -4433,6 +4433,25 @@ static int core_post_config(apr_pool_t *
13 }
14 apr_pool_cleanup_register(pconf, NULL, ap_mpm_end_gen_helper,
15 apr_pool_cleanup_null);
16+
17+#ifdef RLIMIT_CORE
18+ if (ap_coredumpdir_configured) {
19+ struct rlimit lim;
20+
21+ if (getrlimit(RLIMIT_CORE, &lim) == 0 && lim.rlim_cur == 0) {
22+ lim.rlim_cur = lim.rlim_max;
23+ if (setrlimit(RLIMIT_CORE, &lim) == 0) {
24+ ap_log_error(APLOG_MARK, APLOG_NOTICE, 0, NULL,
25+ "core dump file size limit raised to %lu bytes",
26+ lim.rlim_cur);
27+ } else {
28+ ap_log_error(APLOG_MARK, APLOG_NOTICE, errno, NULL,
29+ "core dump file size is zero, setrlimit failed");
30+ }
31+ }
32+ }
33+#endif
34+
35 return OK;
36 }
37
diff --git a/meta-webserver/recipes-httpd/apache2/apache2/httpd-2.4.1-selinux.patch b/meta-webserver/recipes-httpd/apache2/apache2/httpd-2.4.1-selinux.patch
new file mode 100644
index 000000000..873328d9b
--- /dev/null
+++ b/meta-webserver/recipes-httpd/apache2/apache2/httpd-2.4.1-selinux.patch
@@ -0,0 +1,63 @@
1
2Log the SELinux context at startup.
3
4Upstream-Status: Inappropriate [other]
5
6Note: unlikely to be any interest in this upstream
7
8--- httpd-2.4.1/configure.in.selinux
9+++ httpd-2.4.1/configure.in
10@@ -458,6 +458,11 @@ fopen64
11 dnl confirm that a void pointer is large enough to store a long integer
12 APACHE_CHECK_VOID_PTR_LEN
13
14+AC_CHECK_LIB(selinux, is_selinux_enabled, [
15+ AC_DEFINE(HAVE_SELINUX, 1, [Defined if SELinux is supported])
16+ APR_ADDTO(AP_LIBS, [-lselinux])
17+])
18+
19 AC_CACHE_CHECK([for gettid()], ac_cv_gettid,
20 [AC_TRY_RUN(#define _GNU_SOURCE
21 #include <unistd.h>
22--- httpd-2.4.1/server/core.c.selinux
23+++ httpd-2.4.1/server/core.c
24@@ -58,6 +58,10 @@
25 #include <unistd.h>
26 #endif
27
28+#ifdef HAVE_SELINUX
29+#include <selinux/selinux.h>
30+#endif
31+
32 /* LimitRequestBody handling */
33 #define AP_LIMIT_REQ_BODY_UNSET ((apr_off_t) -1)
34 #define AP_DEFAULT_LIMIT_REQ_BODY ((apr_off_t) 0)
35@@ -4452,6 +4456,28 @@ static int core_post_config(apr_pool_t *
36 }
37 #endif
38
39+#ifdef HAVE_SELINUX
40+ {
41+ static int already_warned = 0;
42+ int is_enabled = is_selinux_enabled() > 0;
43+
44+ if (is_enabled && !already_warned) {
45+ security_context_t con;
46+
47+ if (getcon(&con) == 0) {
48+
49+ ap_log_error(APLOG_MARK, APLOG_NOTICE, 0, NULL,
50+ "SELinux policy enabled; "
51+ "httpd running as context %s", con);
52+
53+ already_warned = 1;
54+
55+ freecon(con);
56+ }
57+ }
58+ }
59+#endif
60+
61 return OK;
62 }
63
diff --git a/meta-webserver/recipes-httpd/apache2/apache2/httpd-2.4.4-export.patch b/meta-webserver/recipes-httpd/apache2/apache2/httpd-2.4.4-export.patch
new file mode 100644
index 000000000..afbed8e55
--- /dev/null
+++ b/meta-webserver/recipes-httpd/apache2/apache2/httpd-2.4.4-export.patch
@@ -0,0 +1,22 @@
1
2There is no need to "suck in" the apr/apr-util symbols when using
3a shared libapr{,util}, it just bloats the symbol table; so don't.
4
5Upstream-HEAD: needed
6Upstream-2.0: omit
7Upstream-Status: Pending
8
9Note: EXPORT_DIRS change is conditional on using shared apr
10
11--- httpd-2.4.4/server/Makefile.in.export
12+++ httpd-2.4.4/server/Makefile.in
13@@ -57,9 +57,6 @@ export_files:
14 ( for dir in $(EXPORT_DIRS); do \
15 ls $$dir/*.h ; \
16 done; \
17- for dir in $(EXPORT_DIRS_APR); do \
18- ls $$dir/ap[ru].h $$dir/ap[ru]_*.h 2>/dev/null; \
19- done; \
20 ) | sed -e s,//,/,g | sort -u > $@
21
22 exports.c: export_files
diff --git a/meta-webserver/recipes-httpd/apache2/apache2/npn-patch-2.4.7.patch b/meta-webserver/recipes-httpd/apache2/apache2/npn-patch-2.4.7.patch
new file mode 100644
index 000000000..a4f185501
--- /dev/null
+++ b/meta-webserver/recipes-httpd/apache2/apache2/npn-patch-2.4.7.patch
@@ -0,0 +1,289 @@
1Add support for TLS Next Protocol Negotiation:
2
3* modules/ssl/mod_ssl.c, modules/ssl/mod_ssl.h: Add and implement new
4 hooks for next protocol advertisement/discovery.
5
6* modules/ssl/ssl_engine_init.c (ssl_init_ctx_callbacks): Enable
7 NPN advertisement callback in handshake.
8
9* modules/ssl/ssl_engine_io.c (ssl_io_filter_input): Invoke
10 next-protocol discovery hook.
11
12* modules/ssl/ssl_engine_kernel.c (ssl_callback_AdvertiseNextProtos):
13 New callback.
14
15* modules/ssl/ssl_private.h: Add prototype.
16
17Submitted by: Matthew Steele <mdsteele google.com>
18 with slight tweaks by jorton
19
20http://svn.apache.org/viewvc?view=revision&revision=1332643
21https://bugzilla.redhat.com//show_bug.cgi?id=809599
22Upstream-Status: Backport
23Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
24---
25 CHANGES | 2 +
26 modules/ssl/mod_ssl.c | 12 ++++++
27 modules/ssl/mod_ssl.h | 21 +++++++++++
28 modules/ssl/ssl_engine_init.c | 5 +++
29 modules/ssl/ssl_engine_io.c | 24 ++++++++++++
30 modules/ssl/ssl_engine_kernel.c | 82 +++++++++++++++++++++++++++++++++++++++++
31 modules/ssl/ssl_private.h | 6 +++
32 7 files changed, 152 insertions(+)
33
34diff --git a/CHANGES b/CHANGES
35--- a/CHANGES
36+++ b/CHANGES
37@@ -1,6 +1,8 @@
38 -*- coding: utf-8 -*-
39
40 Changes with Apache 2.4.7
41+ *) mod_ssl: Add support for TLS Next Protocol Negotiation. PR 52210.
42+ [Matthew Steele <mdsteele google.com>]
43
44 *) APR 1.5.0 or later is now required for the event MPM.
45
46diff --git a/modules/ssl/mod_ssl.c b/modules/ssl/mod_ssl.c
47--- a/modules/ssl/mod_ssl.c
48+++ b/modules/ssl/mod_ssl.c
49@@ -275,6 +275,18 @@ static const command_rec ssl_config_cmds[] = {
50 AP_END_CMD
51 };
52
53+/* Implement 'modssl_run_npn_advertise_protos_hook'. */
54+APR_IMPLEMENT_OPTIONAL_HOOK_RUN_ALL(
55+ modssl, AP, int, npn_advertise_protos_hook,
56+ (conn_rec *connection, apr_array_header_t *protos),
57+ (connection, protos), OK, DECLINED);
58+
59+/* Implement 'modssl_run_npn_proto_negotiated_hook'. */
60+APR_IMPLEMENT_OPTIONAL_HOOK_RUN_ALL(
61+ modssl, AP, int, npn_proto_negotiated_hook,
62+ (conn_rec *connection, const char *proto_name, apr_size_t proto_name_len),
63+ (connection, proto_name, proto_name_len), OK, DECLINED);
64+
65 /*
66 * the various processing hooks
67 */
68diff --git a/modules/ssl/mod_ssl.h b/modules/ssl/mod_ssl.h
69--- a/modules/ssl/mod_ssl.h
70+++ b/modules/ssl/mod_ssl.h
71@@ -63,5 +63,26 @@ APR_DECLARE_OPTIONAL_FN(int, ssl_proxy_enable, (conn_rec *));
72
73 APR_DECLARE_OPTIONAL_FN(int, ssl_engine_disable, (conn_rec *));
74
75+/** The npn_advertise_protos optional hook allows other modules to add entries
76+ * to the list of protocol names advertised by the server during the Next
77+ * Protocol Negotiation (NPN) portion of the SSL handshake. The hook callee is
78+ * given the connection and an APR array; it should push one or more char*'s
79+ * pointing to null-terminated strings (such as "http/1.1" or "spdy/2") onto
80+ * the array and return OK, or do nothing and return DECLINED. */
81+APR_DECLARE_EXTERNAL_HOOK(modssl, AP, int, npn_advertise_protos_hook,
82+ (conn_rec *connection, apr_array_header_t *protos));
83+
84+/** The npn_proto_negotiated optional hook allows other modules to discover the
85+ * name of the protocol that was chosen during the Next Protocol Negotiation
86+ * (NPN) portion of the SSL handshake. Note that this may be the empty string
87+ * (in which case modules should probably assume HTTP), or it may be a protocol
88+ * that was never even advertised by the server. The hook callee is given the
89+ * connection, a non-null-terminated string containing the protocol name, and
90+ * the length of the string; it should do something appropriate (i.e. insert or
91+ * remove filters) and return OK, or do nothing and return DECLINED. */
92+APR_DECLARE_EXTERNAL_HOOK(modssl, AP, int, npn_proto_negotiated_hook,
93+ (conn_rec *connection, const char *proto_name,
94+ apr_size_t proto_name_len));
95+
96 #endif /* __MOD_SSL_H__ */
97 /** @} */
98diff --git a/modules/ssl/ssl_engine_init.c b/modules/ssl/ssl_engine_init.c
99--- a/modules/ssl/ssl_engine_init.c
100+++ b/modules/ssl/ssl_engine_init.c
101@@ -546,6 +546,11 @@ static void ssl_init_ctx_callbacks(server_rec *s,
102 SSL_CTX_set_tmp_dh_callback(ctx, ssl_callback_TmpDH);
103
104 SSL_CTX_set_info_callback(ctx, ssl_callback_Info);
105+
106+#ifdef HAVE_TLS_NPN
107+ SSL_CTX_set_next_protos_advertised_cb(
108+ ctx, ssl_callback_AdvertiseNextProtos, NULL);
109+#endif
110 }
111
112 static void ssl_init_ctx_verify(server_rec *s,
113diff --git a/modules/ssl/ssl_engine_io.c b/modules/ssl/ssl_engine_io.c
114--- a/modules/ssl/ssl_engine_io.c
115+++ b/modules/ssl/ssl_engine_io.c
116@@ -28,6 +28,7 @@
117 core keeps dumping.''
118 -- Unknown */
119 #include "ssl_private.h"
120+#include "mod_ssl.h"
121 #include "apr_date.h"
122
123 /* _________________________________________________________________
124@@ -297,6 +298,7 @@ typedef struct {
125 apr_pool_t *pool;
126 char buffer[AP_IOBUFSIZE];
127 ssl_filter_ctx_t *filter_ctx;
128+ int npn_finished; /* 1 if NPN has finished, 0 otherwise */
129 } bio_filter_in_ctx_t;
130
131 /*
132@@ -1412,6 +1414,27 @@ static apr_status_t ssl_io_filter_input(ap_filter_t *f,
133 APR_BRIGADE_INSERT_TAIL(bb, bucket);
134 }
135
136+#ifdef HAVE_TLS_NPN
137+ /* By this point, Next Protocol Negotiation (NPN) should be completed (if
138+ * our version of OpenSSL supports it). If we haven't already, find out
139+ * which protocol was decided upon and inform other modules by calling
140+ * npn_proto_negotiated_hook. */
141+ if (!inctx->npn_finished) {
142+ const unsigned char *next_proto = NULL;
143+ unsigned next_proto_len = 0;
144+
145+ SSL_get0_next_proto_negotiated(
146+ inctx->ssl, &next_proto, &next_proto_len);
147+ ap_log_cerror(APLOG_MARK, APLOG_DEBUG, APR_SUCCESS, f->c,
148+ "SSL NPN negotiated protocol: '%s'",
149+ apr_pstrmemdup(f->c->pool, (const char*)next_proto,
150+ next_proto_len));
151+ modssl_run_npn_proto_negotiated_hook(
152+ f->c, (const char*)next_proto, next_proto_len);
153+ inctx->npn_finished = 1;
154+ }
155+#endif
156+
157 return APR_SUCCESS;
158 }
159
160@@ -1893,6 +1916,7 @@ static void ssl_io_input_add_filter(ssl_filter_ctx_t *filter_ctx, conn_rec *c,
161 inctx->block = APR_BLOCK_READ;
162 inctx->pool = c->pool;
163 inctx->filter_ctx = filter_ctx;
164+ inctx->npn_finished = 0;
165 }
166
167 /* The request_rec pointer is passed in here only to ensure that the
168diff --git a/modules/ssl/ssl_engine_kernel.c b/modules/ssl/ssl_engine_kernel.c
169--- a/modules/ssl/ssl_engine_kernel.c
170+++ b/modules/ssl/ssl_engine_kernel.c
171@@ -29,6 +29,7 @@
172 time I was too famous.''
173 -- Unknown */
174 #include "ssl_private.h"
175+#include "mod_ssl.h"
176 #include "util_md5.h"
177
178 static void ssl_configure_env(request_rec *r, SSLConnRec *sslconn);
179@@ -2139,3 +2140,84 @@ int ssl_callback_SRPServerParams(SSL *ssl, int *ad, void *arg)
180 }
181
182 #endif /* HAVE_SRP */
183+
184+#ifdef HAVE_TLS_NPN
185+/*
186+ * This callback function is executed when SSL needs to decide what protocols
187+ * to advertise during Next Protocol Negotiation (NPN). It must produce a
188+ * string in wire format -- a sequence of length-prefixed strings -- indicating
189+ * the advertised protocols. Refer to SSL_CTX_set_next_protos_advertised_cb
190+ * in OpenSSL for reference.
191+ */
192+int ssl_callback_AdvertiseNextProtos(SSL *ssl, const unsigned char **data_out,
193+ unsigned int *size_out, void *arg)
194+{
195+ conn_rec *c = (conn_rec*)SSL_get_app_data(ssl);
196+ apr_array_header_t *protos;
197+ int num_protos;
198+ unsigned int size;
199+ int i;
200+ unsigned char *data;
201+ unsigned char *start;
202+
203+ *data_out = NULL;
204+ *size_out = 0;
205+
206+ /* If the connection object is not available, then there's nothing for us
207+ * to do. */
208+ if (c == NULL) {
209+ return SSL_TLSEXT_ERR_OK;
210+ }
211+
212+ /* Invoke our npn_advertise_protos hook, giving other modules a chance to
213+ * add alternate protocol names to advertise. */
214+ protos = apr_array_make(c->pool, 0, sizeof(char*));
215+ modssl_run_npn_advertise_protos_hook(c, protos);
216+ num_protos = protos->nelts;
217+
218+ /* We now have a list of null-terminated strings; we need to concatenate
219+ * them together into a single string, where each protocol name is prefixed
220+ * by its length. First, calculate how long that string will be. */
221+ size = 0;
222+ for (i = 0; i < num_protos; ++i) {
223+ const char *string = APR_ARRAY_IDX(protos, i, const char*);
224+ unsigned int length = strlen(string);
225+ /* If the protocol name is too long (the length must fit in one byte),
226+ * then log an error and skip it. */
227+ if (length > 255) {
228+ ap_log_cerror(APLOG_MARK, APLOG_ERR, 0, c,
229+ "SSL NPN protocol name too long (length=%u): %s",
230+ length, string);
231+ continue;
232+ }
233+ /* Leave room for the length prefix (one byte) plus the protocol name
234+ * itself. */
235+ size += 1 + length;
236+ }
237+
238+ /* If there is nothing to advertise (either because no modules added
239+ * anything to the protos array, or because all strings added to the array
240+ * were skipped), then we're done. */
241+ if (size == 0) {
242+ return SSL_TLSEXT_ERR_OK;
243+ }
244+
245+ /* Now we can build the string. Copy each protocol name string into the
246+ * larger string, prefixed by its length. */
247+ data = apr_palloc(c->pool, size * sizeof(unsigned char));
248+ start = data;
249+ for (i = 0; i < num_protos; ++i) {
250+ const char *string = APR_ARRAY_IDX(protos, i, const char*);
251+ apr_size_t length = strlen(string);
252+ *start = (unsigned char)length;
253+ ++start;
254+ memcpy(start, string, length * sizeof(unsigned char));
255+ start += length;
256+ }
257+
258+ /* Success. */
259+ *data_out = data;
260+ *size_out = size;
261+ return SSL_TLSEXT_ERR_OK;
262+}
263+#endif /* HAVE_TLS_NPN */
264diff --git a/modules/ssl/ssl_private.h b/modules/ssl/ssl_private.h
265--- a/modules/ssl/ssl_private.h
266+++ b/modules/ssl/ssl_private.h
267@@ -123,6 +123,11 @@
268 #define MODSSL_SSL_METHOD_CONST
269 #endif
270
271+#if OPENSSL_VERSION_NUMBER >= 0x10001000L && !defined(OPENSSL_NO_NEXTPROTONEG) \
272+ && !defined(OPENSSL_NO_TLSEXT)
273+#define HAVE_TLS_NPN
274+#endif
275+
276 #if defined(OPENSSL_FIPS)
277 #define HAVE_FIPS
278 #endif
279@@ -800,6 +805,7 @@ int ssl_callback_ServerNameIndication(SSL *, int *, modssl_ctx_t *);
280 int ssl_callback_SessionTicket(SSL *, unsigned char *, unsigned char *,
281 EVP_CIPHER_CTX *, HMAC_CTX *, int);
282 #endif
283+int ssl_callback_AdvertiseNextProtos(SSL *ssl, const unsigned char **data, unsigned int *len, void *arg);
284
285 /** Session Cache Support */
286 void ssl_scache_init(server_rec *, apr_pool_t *);
287--
2881.8.1.2
289
diff --git a/meta-webserver/recipes-httpd/apache2/apache2/replace-lynx-to-curl-in-apachectl-script.patch b/meta-webserver/recipes-httpd/apache2/apache2/replace-lynx-to-curl-in-apachectl-script.patch
new file mode 100644
index 000000000..584ddc8d9
--- /dev/null
+++ b/meta-webserver/recipes-httpd/apache2/apache2/replace-lynx-to-curl-in-apachectl-script.patch
@@ -0,0 +1,52 @@
1From 760ccbb2fb046621a2aeaecabb2b1ef9aa280cf1 Mon Sep 17 00:00:00 2001
2From: Yulong Pei <Yulong.pei@windriver.com>
3Date: Thu, 1 Sep 2011 01:03:14 +0800
4Subject: [PATCH] replace lynx to curl in apachectl script
5
6Upstream-Status: Inappropriate [configuration]
7
8Signed-off-by: Yulong Pei <Yulong.pei@windriver.com>
9---
10 support/apachectl.in | 14 ++++++++++----
11 1 files changed, 10 insertions(+), 4 deletions(-)
12
13diff --git a/support/apachectl.in b/support/apachectl.in
14index d4dff38..109ea13 100644
15--- a/support/apachectl.in
16+++ b/support/apachectl.in
17@@ -51,11 +51,11 @@ fi
18 # a command that outputs a formatted text version of the HTML at the
19 # url given on the command line. Designed for lynx, however other
20 # programs may work.
21-LYNX="@LYNX_PATH@ -dump"
22+CURL="/usr/bin/curl"
23 #
24 # the URL to your server's mod_status status page. If you do not
25 # have one, then status and fullstatus will not work.
26-STATUSURL="http://localhost:@PORT@/server-status"
27+STATUSURL="http://localhost:@PORT@/"
28 #
29 # Set this variable to a command that increases the maximum
30 # number of file descriptors allowed per child process. This is
31@@ -91,10 +91,16 @@ configtest)
32 ERROR=$?
33 ;;
34 status)
35- $LYNX $STATUSURL | awk ' /process$/ { print; exit } { print } '
36+ $CURL -s $STATUSURL | grep -o "It works!"
37+ if [ $? != 0 ] ; then
38+ echo The httpd server does not work!
39+ fi
40 ;;
41 fullstatus)
42- $LYNX $STATUSURL
43+ $CURL -s $STATUSURL | grep -o "It works!"
44+ if [ $? != 0 ] ; then
45+ echo The httpd server does not work!
46+ fi
47 ;;
48 *)
49 $HTTPD $ARGV
50--
511.6.4
52
diff --git a/meta-webserver/recipes-httpd/apache2/apache2/server-makefile.patch b/meta-webserver/recipes-httpd/apache2/apache2/server-makefile.patch
new file mode 100644
index 000000000..f1349cb6a
--- /dev/null
+++ b/meta-webserver/recipes-httpd/apache2/apache2/server-makefile.patch
@@ -0,0 +1,11 @@
1--- http-2.0.54/server/Makefile.in-old 2005-12-20 13:26:56.000000000 -0500
2+++ http-2.0.54/server/Makefile.in 2005-12-20 13:27:22.000000000 -0500
3@@ -27,7 +27,7 @@
4 $(LINK) $(EXTRA_LDFLAGS) $(gen_test_char_OBJECTS) $(EXTRA_LIBS)
5
6 test_char.h: gen_test_char
7- ./gen_test_char > test_char.h
8+ gen_test_char > test_char.h
9
10 util.lo: test_char.h
11
diff --git a/meta-webserver/recipes-httpd/apache2/apache2_2.4.9.bb b/meta-webserver/recipes-httpd/apache2/apache2_2.4.9.bb
new file mode 100644
index 000000000..33e197ab8
--- /dev/null
+++ b/meta-webserver/recipes-httpd/apache2/apache2_2.4.9.bb
@@ -0,0 +1,142 @@
1DESCRIPTION = "The Apache HTTP Server is a powerful, efficient, and \
2extensible web server."
3SUMMARY = "Apache HTTP Server"
4HOMEPAGE = "http://httpd.apache.org/"
5DEPENDS = "libtool-native apache2-native openssl expat pcre apr apr-util"
6SECTION = "net"
7LICENSE = "Apache-2.0"
8
9SRC_URI = "http://www.apache.org/dist/httpd/httpd-${PV}.tar.bz2 \
10 file://server-makefile.patch \
11 file://httpd-2.4.1-corelimit.patch \
12 file://httpd-2.4.4-export.patch \
13 file://httpd-2.4.1-selinux.patch \
14 file://apache-configure_perlbin.patch \
15 file://replace-lynx-to-curl-in-apachectl-script.patch \
16 file://apache-ssl-ltmain-rpath.patch \
17 file://httpd-2.4.3-fix-race-issue-of-dir-install.patch \
18 file://npn-patch-2.4.7.patch \
19 file://init \
20 file://apache2-volatile.conf"
21
22LIC_FILES_CHKSUM = "file://LICENSE;md5=dbff5a2b542fa58854455bf1a0b94b83"
23SRC_URI[md5sum] = "2ef4e65353497606b24fa9bb3e5a3c40"
24SRC_URI[sha256sum] = "f78cc90dfa47caf3d83ad18fd6b4e85f237777c1733fc9088594b70ce2847603"
25
26S = "${WORKDIR}/httpd-${PV}"
27
28inherit autotools update-rc.d
29
30SSTATE_SCAN_FILES += "apxs config_vars.mk config.nice"
31
32CFLAGS_append = " -DPATH_MAX=4096"
33CFLAGS_prepend = "-I${STAGING_INCDIR}/openssl "
34EXTRA_OECONF = "--enable-ssl \
35 --with-ssl=${STAGING_LIBDIR}/.. \
36 --with-expat=${STAGING_LIBDIR}/.. \
37 --with-apr=${STAGING_BINDIR_CROSS}/apr-1-config \
38 --with-apr-util=${STAGING_BINDIR_CROSS}/apu-1-config \
39 --enable-info \
40 --enable-rewrite \
41 --with-dbm=sdbm \
42 --with-berkeley-db=no \
43 --localstatedir=/var/${BPN} \
44 --with-gdbm=no \
45 --with-ndbm=no \
46 --includedir=${includedir}/${BPN} \
47 --datadir=${datadir}/${BPN} \
48 --sysconfdir=${sysconfdir}/${BPN} \
49 --libexecdir=${libdir}/${BPN}/modules \
50 ap_cv_void_ptr_lt_long=no \
51 --enable-mpms-shared \
52 ac_cv_have_threadsafe_pollset=no"
53
54do_install_append() {
55 install -d ${D}/${sysconfdir}/init.d
56 cat ${WORKDIR}/init | \
57 sed -e 's,/usr/sbin/,${sbindir}/,g' \
58 -e 's,/usr/bin/,${bindir}/,g' \
59 -e 's,/usr/lib,${libdir}/,g' \
60 -e 's,/etc/,${sysconfdir}/,g' \
61 -e 's,/usr/,${prefix}/,g' > ${D}/${sysconfdir}/init.d/${BPN}
62 chmod 755 ${D}/${sysconfdir}/init.d/${BPN}
63 # remove the goofy original files...
64 rm -rf ${D}/${sysconfdir}/${BPN}/original
65 # Expat should be found in the staging area via DEPENDS...
66 rm -f ${D}/${libdir}/libexpat.*
67
68 install -d ${D}${sysconfdir}/${BPN}/conf.d
69 install -d ${D}${sysconfdir}/${BPN}/modules.d
70
71 # Ensure configuration file pulls in conf.d and modules.d
72 printf "\nIncludeOptional ${sysconfdir}/${BPN}/conf.d/*.conf" >> ${D}/${sysconfdir}/${BPN}/httpd.conf
73 printf "\nIncludeOptional ${sysconfdir}/${BPN}/modules.d/*.conf\n\n" >> ${D}/${sysconfdir}/${BPN}/httpd.conf
74 # match with that is in init script
75 printf "\nPidFile /run/httpd.pid" >> ${D}/${sysconfdir}/${BPN}/httpd.conf
76 # Set 'ServerName' to fix error messages when restart apache service
77 sed -i 's/^#ServerName www.example.com/ServerName localhost/' ${D}/${sysconfdir}/${BPN}/httpd.conf
78
79 if ${@base_contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then
80 install -d ${D}${sysconfdir}/tmpfiles.d/
81 install -m 0644 ${WORKDIR}/apache2-volatile.conf ${D}${sysconfdir}/tmpfiles.d/
82 fi
83}
84
85SYSROOT_PREPROCESS_FUNCS += "apache_sysroot_preprocess"
86
87apache_sysroot_preprocess () {
88 install -d ${SYSROOT_DESTDIR}${bindir_crossscripts}/
89 install -m 755 ${D}${bindir}/apxs ${SYSROOT_DESTDIR}${bindir_crossscripts}/
90 sed -i 's!my $installbuilddir = .*!my $installbuilddir = "${STAGING_DIR_HOST}/${datadir}/${BPN}/build";!' ${SYSROOT_DESTDIR}${bindir_crossscripts}/apxs
91 sed -i 's!my $libtool = .*!my $libtool = "${STAGING_BINDIR_CROSS}/${TARGET_PREFIX}libtool";!' ${SYSROOT_DESTDIR}${bindir_crossscripts}/apxs
92
93 sed -i 's!^APR_CONFIG = .*!APR_CONFIG = ${STAGING_BINDIR_CROSS}/apr-1-config!' ${SYSROOT_DESTDIR}${datadir}/${BPN}/build/config_vars.mk
94 sed -i 's!^APU_CONFIG = .*!APU_CONFIG = ${STAGING_BINDIR_CROSS}/apu-1-config!' ${SYSROOT_DESTDIR}${datadir}/${BPN}/build/config_vars.mk
95 sed -i 's!^includedir = .*!includedir = ${STAGING_INCDIR}/apache2!' ${SYSROOT_DESTDIR}${datadir}/${BPN}/build/config_vars.mk
96}
97
98#
99# implications - used by update-rc.d scripts
100#
101INITSCRIPT_NAME = "apache2"
102INITSCRIPT_PARAMS = "defaults 91 20"
103LEAD_SONAME = "libapr-1.so.0"
104
105PACKAGES = "${PN}-doc ${PN}-dev ${PN}-dbg ${PN}"
106
107CONFFILES_${PN} = "${sysconfdir}/${BPN}/httpd.conf \
108 ${sysconfdir}/${BPN}/magic \
109 ${sysconfdir}/${BPN}/mime.types \
110 ${sysconfdir}/init.d/${BPN} "
111
112# we override here rather than append so that .so links are
113# included in the runtime package rather than here (-dev)
114# and to get build, icons, error into the -dev package
115FILES_${PN}-dev = "${datadir}/${BPN}/build \
116 ${datadir}/${BPN}/icons \
117 ${datadir}/${BPN}/error \
118 ${bindir}/apr-config ${bindir}/apu-config \
119 ${libdir}/apr*.exp \
120 ${includedir}/${BPN} \
121 ${libdir}/*.la \
122 ${libdir}/*.a"
123
124# manual to manual
125FILES_${PN}-doc += " ${datadir}/${BPN}/manual"
126
127#
128# override this too - here is the default, less datadir
129#
130FILES_${PN} = "${bindir} ${sbindir} ${libexecdir} ${libdir}/lib*.so.* ${sysconfdir} \
131 ${sharedstatedir} ${localstatedir} /bin /sbin /lib/*.so* \
132 ${libdir}/${BPN}"
133
134# we want htdocs and cgi-bin to go with the binary
135FILES_${PN} += "${datadir}/${BPN}/htdocs ${datadir}/${BPN}/cgi-bin"
136
137#make sure the lone .so links also get wrapped in the base package
138FILES_${PN} += "${libdir}/lib*.so ${libdir}/pkgconfig/*"
139
140FILES_${PN}-dbg += "${libdir}/${BPN}/modules/.debug"
141
142RDEPENDS_${PN} += "openssl libgcc"
diff --git a/meta-webserver/recipes-httpd/apache2/files/apache2-volatile.conf b/meta-webserver/recipes-httpd/apache2/files/apache2-volatile.conf
new file mode 100644
index 000000000..ff2c58704
--- /dev/null
+++ b/meta-webserver/recipes-httpd/apache2/files/apache2-volatile.conf
@@ -0,0 +1,2 @@
1d /var/run/apache2 0755 root root -
2d /var/log/apache2 0755 root root -
diff --git a/meta-webserver/recipes-httpd/apache2/files/httpd-2.4.3-fix-race-issue-of-dir-install.patch b/meta-webserver/recipes-httpd/apache2/files/httpd-2.4.3-fix-race-issue-of-dir-install.patch
new file mode 100644
index 000000000..b948753b4
--- /dev/null
+++ b/meta-webserver/recipes-httpd/apache2/files/httpd-2.4.3-fix-race-issue-of-dir-install.patch
@@ -0,0 +1,21 @@
1Upstream-Status: Pending
2
3fix following race issue when do parallel install
4| mkdir: cannot create directory `/home/mypc/workspace/poky/build_p4080ds_release/tmp/work/ppce500mc-fsl_networking-linux/apache2/2.4.3-r1/image/usr/share/apache2': File exists
5...
6| mkdir: cannot create directory `/home/mypc/workspace/poky/build_p4080ds_release/tmp/work/ppce500mc-fsl_networking-linux/apache2/2.4.3-r1/image/usr/share/apache2': File exists
7| make[1]: *** [install-man] Error 1
8| make[1]: *** Waiting for unfinished jobs....
9
10-Signed-off-by: Zhenhua Luo <zhenhua.luo@freescale.com>
11--- httpd-2.4.3/build/mkdir.sh.orig 2013-01-25 03:47:21.565255420 -0600
12+++ httpd-2.4.3/build/mkdir.sh 2013-01-25 03:46:17.833051230 -0600
13@@ -39,7 +39,7 @@
14 esac
15 if test ! -d "$pathcomp"; then
16 echo "mkdir $pathcomp" 1>&2
17- mkdir "$pathcomp" || errstatus=$?
18+ mkdir -p "$pathcomp" || errstatus=$?
19 fi
20 pathcomp="$pathcomp/"
21 done
diff --git a/meta-webserver/recipes-httpd/apache2/files/init b/meta-webserver/recipes-httpd/apache2/files/init
new file mode 100755
index 000000000..a1adbd74f
--- /dev/null
+++ b/meta-webserver/recipes-httpd/apache2/files/init
@@ -0,0 +1,73 @@
1#!/bin/sh
2### BEGIN INIT INFO
3# Provides: httpd
4# Required-Start: $local_fs $remote_fs $network $named
5# Required-Stop: $local_fs $remote_fs $network
6# Should-Start: distcache
7# Short-Description: start and stop Apache HTTP Server
8# Description: The Apache HTTP Server is an extensible server
9# implementing the current HTTP standards.
10### END INIT INFO
11
12ARGS="-D SSL -D PHP5 -k start"
13NAME=apache2
14PATH=/bin:/usr/bin:/sbin:/usr/sbin
15DAEMON=/usr/sbin/httpd
16SUEXEC=/usr/lib/apache/suexec
17PIDFILE=/run/httpd.pid
18CONF=/etc/apache2/httpd.conf
19APACHECTL=/usr/sbin/apachectl
20
21trap "" 1
22export LANG=C
23export PATH
24
25test -f $DAEMON || exit 0
26test -f $APACHECTL || exit 0
27
28# ensure we don't leak environment vars into apachectl
29APACHECTL="env -i LANG=${LANG} PATH=${PATH} $APACHECTL"
30
31case "$1" in
32 start)
33 echo -n "Starting web server: $NAME"
34 $APACHECTL $ARGS
35 ;;
36
37 stop)
38 $APACHECTL stop
39 ;;
40
41 reload)
42 echo -n "Reloading $NAME configuration"
43 kill -HUP `cat $PIDFILE`
44 ;;
45
46 reload-modules)
47 echo -n "Reloading $NAME modules"
48 $APACHECTL restart
49 ;;
50
51 restart)
52 $APACHECTL restart
53 exit $?
54 ;;
55
56 force-reload)
57 $0 reload-modules
58 exit $?
59 ;;
60
61 *)
62 echo "Usage: /etc/init.d/$NAME {start|stop|reload|reload-modules|force-reload|restart}"
63 exit 1
64 ;;
65esac
66
67if [ $? = 0 ]; then
68 echo .
69 exit 0
70else
71 echo failed
72 exit 1
73fi
diff --git a/meta-webserver/recipes-httpd/cherokee/cherokee/cherokee-install-configured.py-once.patch b/meta-webserver/recipes-httpd/cherokee/cherokee/cherokee-install-configured.py-once.patch
new file mode 100644
index 000000000..3336f7df7
--- /dev/null
+++ b/meta-webserver/recipes-httpd/cherokee/cherokee/cherokee-install-configured.py-once.patch
@@ -0,0 +1,40 @@
1From 98a0f19df0a31d5649ad89d395fd1b8de5591827 Mon Sep 17 00:00:00 2001
2From: Robert Yang <liezhi.yang@windriver.com>
3Date: Thu, 3 Apr 2014 21:33:25 +0800
4Subject: [PATCH] admin/Makefile.am: only install configured.py once
5
6Both the two rules install-adminpyDATA and install-generatedDATA will
7install the configured.py to the same location, they can run parallel,
8and they use "install -m", which would might build failures:
9
10/usr/bin/install: setting permissions for `/path/to/configured.py': No such file or directory
11
12This is because the first install is setting the permission while the
13second install is removing the file an re-install.
14
15Only install the configured.py once will fix the problem, I think that
16there is no side effect since it installed the same file to the same
17location twice in the past.
18
19Upstream-Status: Pending
20
21Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
22---
23 admin/Makefile.am | 1 -
24 1 file changed, 1 deletion(-)
25
26diff --git a/admin/Makefile.am b/admin/Makefile.am
27index ce5937b..6f96934 100644
28--- a/admin/Makefile.am
29+++ b/admin/Makefile.am
30@@ -73,7 +73,6 @@ SystemStatsWidgets.py \
31 Wizard.py \
32 XMLServerDigest.py \
33 config_version.py \
34-configured.py \
35 consts.py \
36 util.py \
37 popen.py \
38--
391.8.2.1
40
diff --git a/meta-webserver/recipes-httpd/cherokee/cherokee/cherokee.init b/meta-webserver/recipes-httpd/cherokee/cherokee/cherokee.init
new file mode 100644
index 000000000..93603b84d
--- /dev/null
+++ b/meta-webserver/recipes-httpd/cherokee/cherokee/cherokee.init
@@ -0,0 +1,32 @@
1#!/bin/sh
2DAEMON=/usr/sbin/cherokee
3CONFIG=/etc/cherokee/cherokee.conf
4PIDFILE=/var/run/cherokee.pid
5NAME="cherokee"
6DESC="Cherokee http server"
7
8test -r /etc/default/cherokee && . /etc/default/cherokee
9test -x "$DAEMON" || exit 0
10test ! -r "$CONFIG" && exit 0
11
12case "$1" in
13 start)
14 echo "Starting $DESC: "
15 start-stop-daemon --oknodo -S -x $DAEMON -- -d -C $CONFIG
16 ;;
17
18 stop)
19 echo "Stopping $DESC:"
20 start-stop-daemon -K -p $PIDFILE
21 ;;
22
23 restart)
24 $0 stop >/dev/null 2>&1
25 $0 start
26 ;;
27
28 *)
29 echo "Usage: $0 {start|stop|restart}"
30 exit 0
31 ;;
32esac
diff --git a/meta-webserver/recipes-httpd/cherokee/cherokee/cherokee.service b/meta-webserver/recipes-httpd/cherokee/cherokee/cherokee.service
new file mode 100644
index 000000000..a2d703185
--- /dev/null
+++ b/meta-webserver/recipes-httpd/cherokee/cherokee/cherokee.service
@@ -0,0 +1,10 @@
1[Unit]
2Description=Cherokee web server
3After=syslog.target
4
5[Service]
6Type=forking
7ExecStart=/usr/sbin/cherokee -d -C /etc/cherokee/cherokee.conf
8
9[Install]
10WantedBy=multi-user.target
diff --git a/meta-webserver/recipes-httpd/cherokee/cherokee_1.2.98.bb b/meta-webserver/recipes-httpd/cherokee/cherokee_1.2.98.bb
new file mode 100644
index 000000000..054858ed3
--- /dev/null
+++ b/meta-webserver/recipes-httpd/cherokee/cherokee_1.2.98.bb
@@ -0,0 +1,67 @@
1SUMMARY = "Cherokee Web Server fast and secure"
2SUMMARY_cget = "Small downloader based in the Cherokee client library"
3HOMEPAGE = "http://www.cherokee-project.com/"
4SECTION = "network"
5LICENSE = "GPLv2"
6LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f"
7
8PR = "r9"
9
10DEPENDS = "libpcre openssl mysql5 ${@base_contains('DISTRO_FEATURES', 'pam', 'libpam', '', d)}"
11
12SRC_URI = "http://www.cherokee-project.de/mirrors/cherokee/1.2/${PV}/cherokee-${PV}.tar.gz \
13 file://cherokee.init \
14 file://cherokee.service \
15 file://cherokee-install-configured.py-once.patch \
16"
17SRC_URI[md5sum] = "21b01e7d45c0e82ecc0c4257a9c27feb"
18SRC_URI[sha256sum] = "042b5687b1a3db3ca818167548ce5d32c35e227c6640732dcb622a6f4a078b7d"
19
20inherit autotools pkgconfig binconfig update-rc.d systemd
21
22PACKAGECONFIG ??= ""
23PACKAGECONFIG[ffmpeg] = "--with-ffmpeg,--without-ffmpeg,libav"
24PACKAGECONFIG[ldap] = "--with-ldap,--without-ldap,openldap"
25
26EXTRA_OECONF = "--disable-static \
27 --disable-nls \
28 ${@base_contains('DISTRO_FEATURES', 'pam', '--enable-pam', '--disable-pam', d)} \
29 --with-wwwroot=${localstatedir}/www/cherokee \
30"
31
32do_install_append () {
33 install -m 0755 -d ${D}${sysconfdir}/init.d
34 install -m 755 ${WORKDIR}/cherokee.init ${D}${sysconfdir}/init.d/cherokee
35
36 # clean up .la files for plugins
37 rm -f ${D}${libdir}/cherokee/*.la
38
39 install -d ${D}${systemd_unitdir}/system
40 install -m 0644 ${WORKDIR}/cherokee.service ${D}${systemd_unitdir}/system
41 rmdir "${D}${localstatedir}/run"
42 rmdir --ignore-fail-on-non-empty "${D}${localstatedir}"
43}
44
45# Put -dev near the front so we can move the .la files into it with a wildcard
46PACKAGES =+ "libcherokee-server libcherokee-client libcherokee-base cget"
47
48FILES_cget = "${bindir}/cget"
49FILES_libcherokee-server = "${libdir}/libcherokee-server${SOLIBS}"
50FILES_libcherokee-client = "${libdir}/libcherokee-client${SOLIBS}"
51FILES_libcherokee-base = "${libdir}/libcherokee-base${SOLIBS}"
52
53# Pack the htdocs
54FILES_${PN} += "${localstatedir}/www/cherokee"
55
56CONFFILES_${PN} = " \
57 ${sysconfdir}/cherokee/cherokee.conf \
58 ${sysconfdir}/init.d/cherokee \
59"
60
61INITSCRIPT_NAME = "cherokee"
62INITSCRIPT_PARAMS = "defaults 91 91"
63
64RPROVIDES_${PN} += "${PN}-systemd"
65RREPLACES_${PN} += "${PN}-systemd"
66RCONFLICTS_${PN} += "${PN}-systemd"
67SYSTEMD_SERVICE_${PN} = "cherokee.service"
diff --git a/meta-webserver/recipes-httpd/hiawatha/files/hiawatha-init b/meta-webserver/recipes-httpd/hiawatha/files/hiawatha-init
new file mode 100644
index 000000000..47fc0877a
--- /dev/null
+++ b/meta-webserver/recipes-httpd/hiawatha/files/hiawatha-init
@@ -0,0 +1,44 @@
1#!/bin/sh
2
3### BEGIN INIT INFO
4# Provides: hiawatha httpd httpd-cgi
5# Required-Start: $syslog $network $remote_fs
6# Required-Stop: $syslog $network $remote_fs
7# Default-Start: 2 3 4 5
8# Default-Stop: 0 1 6
9# Short-Description: Hiawatha webserver
10# Description: Hiawatha, a secure and advanced webserver.
11### END INIT INFO
12
13PATH=/sbin:/bin:/usr/sbin:/usr/bin
14DAEMON=sed_sbin_path/hiawatha
15NAME=hiawatha
16DESC="Hiawatha Web Server"
17OPTS=""
18
19case "$1" in
20 start)
21 echo -n "Starting $DESC: "
22 start-stop-daemon --start -x "$DAEMON" -- $OPTS
23 echo "$NAME."
24 ;;
25 stop)
26 echo -n "Stopping $DESC: "
27 start-stop-daemon --stop -x "$DAEMON"
28 echo "$NAME."
29 ;;
30 restart|force-reload)
31 echo -n "Restarting $DESC: "
32 start-stop-daemon --stop -x "$DAEMON"
33 sleep 1
34 start-stop-daemon --start -x "$DAEMON" -- $OPTS
35 echo "$NAME."
36 ;;
37 *)
38 N=/etc/init.d/$NAME
39 echo "Usage: $N {start|stop|restart|force-reload}" >&2
40 exit 1
41 ;;
42esac
43
44exit 0
diff --git a/meta-webserver/recipes-httpd/hiawatha/files/hiawatha.service b/meta-webserver/recipes-httpd/hiawatha/files/hiawatha.service
new file mode 100644
index 000000000..26cb8d03d
--- /dev/null
+++ b/meta-webserver/recipes-httpd/hiawatha/files/hiawatha.service
@@ -0,0 +1,16 @@
1[Unit]
2Description=Hiawatha Web Server
3After=network.target remote-fs.target nss-lookup.target
4
5[Service]
6Type=simple
7SyslogIdentifier=hiawatha
8ExecStartPre=/usr/sbin/hiawatha -k ; /usr/sbin/wigwam
9ExecStart= /usr/sbin/hiawatha -d
10TimeoutSec=10
11#(doesn't like this setting. Can't find files) PrivateTmp=true
12LimitNOFILE=infinity
13CapabilityBoundingSet=CAP_NET_BIND_SERVICE CAP_CHOWN CAP_DAC_OVERRIDE CAP_FOWNER CAP_FSETID CAP_SETGID CAP_SETUID
14
15[Install]
16WantedBy=multi-user.target
diff --git a/meta-webserver/recipes-httpd/hiawatha/hiawatha_9.2.bb b/meta-webserver/recipes-httpd/hiawatha/hiawatha_9.2.bb
new file mode 100644
index 000000000..57005c5ef
--- /dev/null
+++ b/meta-webserver/recipes-httpd/hiawatha/hiawatha_9.2.bb
@@ -0,0 +1,66 @@
1SUMMARY = "Lightweight secure web server"
2HOMEPAGE = "http://www.hiawatha-webserver.org"
3LICENSE = "GPLv2"
4LIC_FILES_CHKSUM = "file://LICENSE;md5=751419260aa954499f7abaabaa882bbe"
5DEPENDS = "libxml2 libxslt"
6
7SECTION = "net"
8
9SRC_URI = "http://hiawatha-webserver.org/files/${PN}-${PV}.tar.gz \
10 file://hiawatha-init \
11 file://hiawatha.service "
12
13SRC_URI[md5sum] = "a77f044634884c4cc5d21dab44e822a3"
14SRC_URI[sha256sum] = "5d9cdec51c618bb3efab747030e593d9bd49dfaf3236254c8e0cb60715716dbf"
15
16INITSCRIPT_NAME = "hiawatha"
17INITSCRIPT_PARAMS = "defaults 70"
18
19SYSTEMD_SERVICE_${PN} = "hiawatha.service"
20
21inherit cmake update-rc.d systemd
22
23EXTRA_OECMAKE = " -DENABLE_IPV6=OFF \
24 -DENABLE_CACHE=OFF \
25 -DENABLE_DEBUG=OFF \
26 -DENABLE_SSL=OFF \
27 -DENABLE_TOOLKIT=OFF \
28 -DENABLE_CHROOT=OFF \
29 -DENABLE_XSLT=ON \
30 -DENABLE_TOMAHAWK=OFF \
31 -DCMAKE_INSTALL_MANDIR=${mandir} \
32 -DCMAKE_INSTALL_BINDIR=${bindir} \
33 -DCMAKE_INSTALL_SBINDIR=${sbindir} \
34 -DCMAKE_INSTALL_SYSCONFDIR=${sysconfdir} \
35 -DCMAKE_INSTALL_LIBDIR=${libdir} \
36 -DLOG_DIR=/var/log/hiawatha \
37 -DPID_DIR=/var/run \
38 -DWEBROOT_DIR=/var/www/hiawatha \
39 -DWORK_DIR=/var/lib/hiawatha "
40
41do_install_append() {
42 # Copy over init script and sed in the correct sbin path
43 sed -i 's,sed_sbin_path,${sbindir},' ${WORKDIR}/hiawatha-init
44 mkdir -p ${D}${sysconfdir}/init.d
45 install -m 0755 ${WORKDIR}/hiawatha-init ${D}${sysconfdir}/init.d/hiawatha
46
47 # configure php-fcgi to have a working configuration
48 # by default if php is installed
49 echo "Server = ${bindir}/php-cgi ; 2 ; 127.0.0.1:2005 ; nobody:nobody ; ${sysconfdir}/php/hiawatha-php5/php.ini" >> ${D}${sysconfdir}/hiawatha/php-fcgi.conf
50
51 if ${@base_contains('DISTRO_FEATURES','systemd','true','false',d)}; then
52 install -d ${D}/${systemd_unitdir}/system
53 install -m 644 ${WORKDIR}/hiawatha.service ${D}/${systemd_unitdir}/system
54 fi
55
56 rmdir "${D}${localstatedir}/run"
57 rmdir --ignore-fail-on-non-empty "${D}${localstatedir}"
58}
59
60CONFFILES_${PN} = " \
61 ${sysconfdir}/hiawatha/cgi-wrapper.conf \
62 ${sysconfdir}/hiawatha/hiawatha.conf \
63 ${sysconfdir}/hiawatha/index.xslt \
64 ${sysconfdir}/hiawatha/mimetype.conf \
65 ${sysconfdir}/hiawatha/php-fcgi.conf \
66"
diff --git a/meta-webserver/recipes-httpd/nginx/files/nginx-cross.patch b/meta-webserver/recipes-httpd/nginx/files/nginx-cross.patch
new file mode 100644
index 000000000..5f899a1d8
--- /dev/null
+++ b/meta-webserver/recipes-httpd/nginx/files/nginx-cross.patch
@@ -0,0 +1,217 @@
1We do not have capability to run binaries when cross compiling
2
3Upstream-Status: Pending
4
5
6diff -uraN nginx-1.0.11.orig/auto/feature nginx-1.0.11/auto/feature
7--- nginx-1.0.11.orig/auto/feature 2011-05-11 06:50:19.000000000 -0500
8+++ nginx-1.0.11/auto/feature 2011-12-27 13:56:42.323370040 -0600
9@@ -48,12 +48,20 @@
10
11 if [ -x $NGX_AUTOTEST ]; then
12
13+ if [ ".$NGX_CROSS_COMPILE" = ".yes" ]; then
14+ NGX_AUTOTEST_EXEC="true"
15+ NGX_FOUND_MSG=" (not tested, cross compiling)"
16+ else
17+ NGX_AUTOTEST_EXEC="$NGX_AUTOTEST"
18+ NGX_FOUND_MSG=""
19+ fi
20+
21 case "$ngx_feature_run" in
22
23 yes)
24 # /bin/sh is used to intercept "Killed" or "Abort trap" messages
25- if /bin/sh -c $NGX_AUTOTEST >> $NGX_AUTOCONF_ERR 2>&1; then
26- echo " found"
27+ if /bin/sh -c $NGX_AUTOTEST_EXEC >> $NGX_AUTOCONF_ERR 2>&1; then
28+ echo " found$NGX_FOUND_MSG"
29 ngx_found=yes
30
31 if test -n "$ngx_feature_name"; then
32@@ -67,17 +75,27 @@
33
34 value)
35 # /bin/sh is used to intercept "Killed" or "Abort trap" messages
36- if /bin/sh -c $NGX_AUTOTEST >> $NGX_AUTOCONF_ERR 2>&1; then
37- echo " found"
38+ if /bin/sh -c $NGX_AUTOTEST_EXEC >> $NGX_AUTOCONF_ERR 2>&1; then
39+ echo " found$NGX_FOUND_MSG"
40 ngx_found=yes
41
42- cat << END >> $NGX_AUTO_CONFIG_H
43+ if [ ".$NGX_CROSS_COMPILE" = ".yes" ]; then
44+ cat << END >> $NGX_AUTO_CONFIG_H
45
46 #ifndef $ngx_feature_name
47-#define $ngx_feature_name `$NGX_AUTOTEST`
48+#define $ngx_feature_name $(eval "echo \$NGX_WITH_${ngx_feature_name}")
49 #endif
50
51 END
52+ else
53+ cat << END >> $NGX_AUTO_CONFIG_H
54+
55+#ifndef $ngx_feature_name
56+#define $ngx_feature_name `$NGX_AUTOTEST_EXEC`
57+#endif
58+
59+END
60+ fi
61 else
62 echo " found but is not working"
63 fi
64@@ -85,7 +103,7 @@
65
66 bug)
67 # /bin/sh is used to intercept "Killed" or "Abort trap" messages
68- if /bin/sh -c $NGX_AUTOTEST >> $NGX_AUTOCONF_ERR 2>&1; then
69+ if /bin/sh -c $NGX_AUTOTEST_EXEC >> $NGX_AUTOCONF_ERR 2>&1; then
70 echo " not found"
71
72 else
73diff -uraN nginx-1.0.11.orig/auto/options nginx-1.0.11/auto/options
74--- nginx-1.0.11.orig/auto/options 2011-12-14 07:34:16.000000000 -0600
75+++ nginx-1.0.11/auto/options 2011-12-27 13:56:42.323370040 -0600
76@@ -289,6 +289,18 @@
77 --test-build-rtsig) NGX_TEST_BUILD_RTSIG=YES ;;
78 --test-build-solaris-sendfilev) NGX_TEST_BUILD_SOLARIS_SENDFILEV=YES ;;
79
80+ # cross compile support
81+ --with-int=*) NGX_WITH_INT="$value" ;;
82+ --with-long=*) NGX_WITH_LONG="$value" ;;
83+ --with-long-long=*) NGX_WITH_LONG_LONG="$value" ;;
84+ --with-ptr-size=*) NGX_WITH_PTR_SIZE="$value" ;;
85+ --with-sig-atomic-t=*) NGX_WITH_SIG_ATOMIC_T="$value" ;;
86+ --with-size-t=*) NGX_WITH_SIZE_T="$value" ;;
87+ --with-off-t=*) NGX_WITH_OFF_T="$value" ;;
88+ --with-time-t=*) NGX_WITH_TIME_T="$value" ;;
89+ --with-sys-nerr=*) NGX_WITH_NGX_SYS_NERR="$value" ;;
90+ --with-endian=*) NGX_WITH_ENDIAN="$value" ;;
91+
92 *)
93 echo "$0: error: invalid option \"$option\""
94 exit 1
95@@ -434,6 +446,17 @@
96
97 --with-debug enable debug logging
98
99+ --with-int=VALUE force int size
100+ --with-long=VALUE force long size
101+ --with-long-long=VALUE force long long size
102+ --with-ptr-size=VALUE force pointer size
103+ --with-sig-atomic-t=VALUE force sig_atomic_t size
104+ --with-size-t=VALUE force size_t size
105+ --with-off-t=VALUE force off_t size
106+ --with-time-t=VALUE force time_t size
107+ --with-sys-nerr=VALUE force sys_nerr value
108+ --with-endian=VALUE force system endianess
109+
110 END
111
112 exit 1
113@@ -455,6 +478,8 @@
114
115 if [ ".$NGX_PLATFORM" = ".win32" ]; then
116 NGX_WINE=$WINE
117+elif [ ! -z "$NGX_PLATFORM" ]; then
118+ NGX_CROSS_COMPILE="yes"
119 fi
120
121
122diff -uraN nginx-1.0.11.orig/auto/types/sizeof nginx-1.0.11/auto/types/sizeof
123--- nginx-1.0.11.orig/auto/types/sizeof 2006-06-28 11:00:26.000000000 -0500
124+++ nginx-1.0.11/auto/types/sizeof 2011-12-27 13:56:42.323370040 -0600
125@@ -11,9 +11,12 @@
126
127 END
128
129-ngx_size=
130+ngx_size=$(eval "echo \$NGX_WITH_${ngx_param}")
131
132-cat << END > $NGX_AUTOTEST.c
133+if [ ".$ngx_size" != "." ]; then
134+ echo " $ngx_size bytes"
135+else
136+ cat << END > $NGX_AUTOTEST.c
137
138 #include <sys/types.h>
139 #include <sys/time.h>
140@@ -31,19 +34,20 @@
141 END
142
143
144-ngx_test="$CC $CC_TEST_FLAGS $CC_AUX_FLAGS \
145- -o $NGX_AUTOTEST $NGX_AUTOTEST.c $NGX_LD_OPT $ngx_feature_libs"
146+ ngx_test="$CC $CC_TEST_FLAGS $CC_AUX_FLAGS \
147+ -o $NGX_AUTOTEST $NGX_AUTOTEST.c $NGX_LD_OPT $ngx_feature_libs"
148
149-eval "$ngx_test >> $NGX_AUTOCONF_ERR 2>&1"
150+ eval "$ngx_test >> $NGX_AUTOCONF_ERR 2>&1"
151
152
153-if [ -x $NGX_AUTOTEST ]; then
154- ngx_size=`$NGX_AUTOTEST`
155- echo " $ngx_size bytes"
156-fi
157+ if [ -x $NGX_AUTOTEST ]; then
158+ ngx_size=`$NGX_AUTOTEST`
159+ echo " $ngx_size bytes"
160+ fi
161
162
163-rm -f $NGX_AUTOTEST
164+ rm -f $NGX_AUTOTEST
165+fi
166
167
168 case $ngx_size in
169diff -uraN nginx-1.0.11.orig/auto/unix nginx-1.0.11/auto/unix
170--- nginx-1.0.11.orig/auto/unix 2011-12-14 07:34:16.000000000 -0600
171+++ nginx-1.0.11/auto/unix 2011-12-27 13:56:42.327370060 -0600
172@@ -393,13 +393,13 @@
173
174 # C types
175
176-ngx_type="int"; . auto/types/sizeof
177+ngx_type="int"; ngx_param="INT"; . auto/types/sizeof
178
179-ngx_type="long"; . auto/types/sizeof
180+ngx_type="long"; ngx_param="LONG"; . auto/types/sizeof
181
182-ngx_type="long long"; . auto/types/sizeof
183+ngx_type="long long"; ngx_param="LONG_LONG"; . auto/types/sizeof
184
185-ngx_type="void *"; . auto/types/sizeof; ngx_ptr_size=$ngx_size
186+ngx_type="void *"; ngx_param="PTR_SIZE"; . auto/types/sizeof; ngx_ptr_size=$ngx_size
187 ngx_param=NGX_PTR_SIZE; ngx_value=$ngx_size; . auto/types/value
188
189
190@@ -416,7 +416,7 @@
191
192 ngx_type="uint64_t"; ngx_types="u_int64_t"; . auto/types/typedef
193
194-ngx_type="sig_atomic_t"; ngx_types="int"; . auto/types/typedef
195+ngx_type="sig_atomic_t"; ngx_param="SIG_ATOMIC_T"; ngx_types="int"; . auto/types/typedef
196 . auto/types/sizeof
197 ngx_param=NGX_SIG_ATOMIC_T_SIZE; ngx_value=$ngx_size; . auto/types/value
198
199@@ -432,15 +432,15 @@
200
201 . auto/endianess
202
203-ngx_type="size_t"; . auto/types/sizeof
204+ngx_type="size_t"; ngx_param="SIZE_T"; . auto/types/sizeof
205 ngx_param=NGX_MAX_SIZE_T_VALUE; ngx_value=$ngx_max_value; . auto/types/value
206 ngx_param=NGX_SIZE_T_LEN; ngx_value=$ngx_max_len; . auto/types/value
207
208-ngx_type="off_t"; . auto/types/sizeof
209+ngx_type="off_t"; ngx_param="OFF_T"; . auto/types/sizeof
210 ngx_param=NGX_MAX_OFF_T_VALUE; ngx_value=$ngx_max_value; . auto/types/value
211 ngx_param=NGX_OFF_T_LEN; ngx_value=$ngx_max_len; . auto/types/value
212
213-ngx_type="time_t"; . auto/types/sizeof
214+ngx_type="time_t"; ngx_param="TIME_T"; . auto/types/sizeof
215 ngx_param=NGX_TIME_T_SIZE; ngx_value=$ngx_size; . auto/types/value
216 ngx_param=NGX_TIME_T_LEN; ngx_value=$ngx_max_len; . auto/types/value
217
diff --git a/meta-webserver/recipes-httpd/nginx/files/nginx-volatile.conf b/meta-webserver/recipes-httpd/nginx/files/nginx-volatile.conf
new file mode 100644
index 000000000..93f3c6634
--- /dev/null
+++ b/meta-webserver/recipes-httpd/nginx/files/nginx-volatile.conf
@@ -0,0 +1,2 @@
1d www www-data 0755 /run/nginx none
2d root root 0755 /var/log/nginx none
diff --git a/meta-webserver/recipes-httpd/nginx/files/nginx.conf b/meta-webserver/recipes-httpd/nginx/files/nginx.conf
new file mode 100644
index 000000000..fb7e4b65d
--- /dev/null
+++ b/meta-webserver/recipes-httpd/nginx/files/nginx.conf
@@ -0,0 +1,118 @@
1
2user www-data;
3worker_processes 1;
4
5error_log /var/log/nginx/error.log;
6#error_log logs/error.log notice;
7#error_log logs/error.log info;
8
9pid /run/nginx/nginx.pid;
10
11
12events {
13 worker_connections 1024;
14}
15
16
17http {
18 include mime.types;
19 default_type application/octet-stream;
20
21 log_format main '$remote_addr - $remote_user [$time_local] "$request" '
22 '$status $body_bytes_sent "$http_referer" '
23 '"$http_user_agent" "$http_x_forwarded_for"';
24
25 access_log /var/log/nginx/access.log main;
26
27 sendfile on;
28 #tcp_nopush on;
29
30 #keepalive_timeout 0;
31 keepalive_timeout 65;
32
33 #gzip on;
34
35 server {
36 listen 80;
37 server_name localhost;
38
39 #charset koi8-r;
40
41 #access_log logs/host.access.log main;
42
43 location / {
44 root /var/www/localhost/html;
45 index index.html index.htm;
46 }
47
48 #error_page 404 /404.html;
49
50 # redirect server error pages to the static page /50x.html
51 #
52 error_page 500 502 503 504 /50x.html;
53 location = /50x.html {
54 root /var/www/localhost/html;
55 }
56
57 # proxy the PHP scripts to Apache listening on 127.0.0.1:80
58 #
59 #location ~ \.php$ {
60 # proxy_pass http://127.0.0.1;
61 #}
62
63 # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
64 #
65 #location ~ \.php$ {
66 # root html;
67 # fastcgi_pass 127.0.0.1:9000;
68 # fastcgi_index index.php;
69 # fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name;
70 # include fastcgi_params;
71 #}
72
73 # deny access to .htaccess files, if Apache's document root
74 # concurs with nginx's one
75 #
76 #location ~ /\.ht {
77 # deny all;
78 #}
79 }
80
81
82 # another virtual host using mix of IP-, name-, and port-based configuration
83 #
84 #server {
85 # listen 8000;
86 # listen somename:8080;
87 # server_name somename alias another.alias;
88
89 # location / {
90 # root html;
91 # index index.html index.htm;
92 # }
93 #}
94
95
96 # HTTPS server
97 #
98 #server {
99 # listen 443;
100 # server_name localhost;
101
102 # ssl on;
103 # ssl_certificate cert.pem;
104 # ssl_certificate_key cert.key;
105
106 # ssl_session_timeout 5m;
107
108 # ssl_protocols SSLv2 SSLv3 TLSv1;
109 # ssl_ciphers HIGH:!aNULL:!MD5;
110 # ssl_prefer_server_ciphers on;
111
112 # location / {
113 # root html;
114 # index index.html index.htm;
115 # }
116 #}
117
118}
diff --git a/meta-webserver/recipes-httpd/nginx/files/nginx.init b/meta-webserver/recipes-httpd/nginx/files/nginx.init
new file mode 100755
index 000000000..0f38b9cdb
--- /dev/null
+++ b/meta-webserver/recipes-httpd/nginx/files/nginx.init
@@ -0,0 +1,52 @@
1#! /bin/sh
2PATH=/sbin:/bin:/usr/sbin:/usr/bin
3DAEMON=/usr/sbin/nginx
4NAME=nginx
5DESC=nginx
6PID=/var/run/nginx/nginx.pid
7
8test -x $DAEMON || exit 0
9
10# Include nginx defaults if available
11if [ -f /etc/default/nginx ] ; then
12 . /etc/default/nginx
13fi
14
15set -e
16
17case "$1" in
18 start)
19 echo -n "Starting $DESC: "
20 start-stop-daemon --start --quiet --pidfile $PID \
21 --name $NAME --exec $DAEMON -- $DAEMON_OPTS
22 echo "$NAME."
23 ;;
24 stop)
25 echo -n "Stopping $DESC: "
26 start-stop-daemon -K --quiet --pidfile $PID \
27 --name $NAME
28 echo "$NAME."
29 ;;
30 restart|force-reload)
31 echo -n "Restarting $DESC: "
32 start-stop-daemon -K --quiet --pidfile $PID \
33 --name $NAME
34 sleep 1
35 start-stop-daemon --start --quiet --pidfile $PID \
36 --name $NAME --exec $DAEMON -- $DAEMON_OPTS
37 echo "$NAME."
38 ;;
39 reload)
40 echo -n "Reloading $DESC configuration: "
41 start-stop-daemon --stop --signal HUP --quiet --pidfile $PID \
42 --exec $DAEMON
43 echo "$NAME."
44 ;;
45 *)
46 N=/etc/init.d/$NAME
47 echo "Usage: $N {start|stop|restart|force-reload}" >&2
48 exit 1
49 ;;
50esac
51
52exit 0
diff --git a/meta-webserver/recipes-httpd/nginx/nginx_1.4.4.bb b/meta-webserver/recipes-httpd/nginx/nginx_1.4.4.bb
new file mode 100644
index 000000000..e78ed34dd
--- /dev/null
+++ b/meta-webserver/recipes-httpd/nginx/nginx_1.4.4.bb
@@ -0,0 +1,117 @@
1SUMMARY = "HTTP and reverse proxy server"
2
3DESCRIPTION = "Nginx is a web server and a reverse proxy server for \
4HTTP, SMTP, POP3 and IMAP protocols, with a strong focus on high \
5concurrency, performance and low memory usage."
6
7HOMEPAGE = "http://nginx.org/"
8LICENSE = "BSD-2-Clause"
9LIC_FILES_CHKSUM = "file://LICENSE;md5=917bfdf005ffb6fd025550414ff05a9f"
10SECTION = "net"
11
12DEPENDS = "libpcre gzip openssl"
13
14SRC_URI = " \
15 http://nginx.org/download/nginx-${PV}.tar.gz \
16 file://nginx-cross.patch \
17 file://nginx.conf \
18 file://nginx.init \
19 file://nginx-volatile.conf \
20"
21SRC_URI[md5sum] = "5dfaba1cbeae9087f3949860a02caa9f"
22SRC_URI[sha256sum] = "7c989a58e5408c9593da0bebcd0e4ffc3d892d1316ba5042ddb0be5b0b4102b9"
23
24inherit update-rc.d useradd
25
26do_configure () {
27 if [ "${SITEINFO_BITS}" = "64" ]; then
28 PTRSIZE=8
29 else
30 PTRSIZE=4
31 fi
32
33 echo $CFLAGS
34 echo $LDFLAGS
35
36 ./configure \
37 --crossbuild=Linux:${TUNE_ARCH} \
38 --with-endian=${@base_conditional('SITEINFO_ENDIANNESS', 'le', 'little', 'big', d)} \
39 --with-int=4 \
40 --with-long=${PTRSIZE} \
41 --with-long-long=8 \
42 --with-ptr-size=${PTRSIZE} \
43 --with-sig-atomic-t=${PTRSIZE} \
44 --with-size-t=${PTRSIZE} \
45 --with-off-t=${PTRSIZE} \
46 --with-time-t=${PTRSIZE} \
47 --with-sys-nerr=132 \
48 --conf-path=${sysconfdir}/nginx/nginx.conf \
49 --http-log-path=${localstatedir}/log/nginx/access.log \
50 --error-log-path=${localstatedir}/log/nginx/error.log \
51 --pid-path=/run/nginx/nginx.pid \
52 --prefix=${prefix} \
53 --with-http_ssl_module \
54 --with-http_gzip_static_module
55}
56
57do_install () {
58 oe_runmake 'DESTDIR=${D}' install
59 rm -fr ${D}${localstatedir}/run ${D}/run
60 if ${@base_contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then
61 install -d ${D}${sysconfdir}/tmpfiles.d
62 echo "d /run/${BPN} - - - -" \
63 > ${D}${sysconfdir}/tmpfiles.d/${BPN}.conf
64 fi
65 install -d ${D}${sysconfdir}/${BPN}
66 ln -snf ${localstatedir}/run/${BPN} ${D}${sysconfdir}/${BPN}/run
67 install -d ${D}${localstatedir}/www/localhost
68 mv ${D}/usr/html ${D}${localstatedir}/www/localhost/
69 chown www:www-data -R ${D}${localstatedir}
70
71 install -d ${D}${sysconfdir}/init.d
72 install -m 0755 ${WORKDIR}/nginx.init ${D}${sysconfdir}/init.d/nginx
73 sed -i 's,/usr/sbin/,${sbindir}/,g' ${D}${sysconfdir}/init.d/nginx
74 sed -i 's,/etc/,${sysconfdir}/,g' ${D}${sysconfdir}/init.d/nginx
75
76 install -d ${D}${sysconfdir}/nginx
77 install -m 0644 ${WORKDIR}/nginx.conf ${D}${sysconfdir}/nginx/nginx.conf
78 sed -i 's,/var/,${localstatedir}/,g' ${D}${sysconfdir}/nginx/nginx.conf
79 install -d ${D}${sysconfdir}/nginx/sites-enabled
80
81 install -d ${D}${sysconfdir}/default/volatiles
82 install -m 0644 ${WORKDIR}/nginx-volatile.conf ${D}${sysconfdir}/default/volatiles/99_nginx
83 sed -i 's,/var/,${localstatedir}/,g' ${D}${sysconfdir}/default/volatiles/99_nginx
84}
85
86pkg_postinst_${PN} () {
87 if [ -z "$D" ]; then
88 if type systemd-tmpfiles >/dev/null; then
89 systemd-tmpfiles --create
90 elif [ -e ${sysconfdir}/init.d/populate-volatile.sh ]; then
91 ${sysconfdir}/init.d/populate-volatile.sh update
92 fi
93 fi
94}
95
96FILES_${PN} += "${localstatedir}/"
97
98CONFFILES_${PN} = "${sysconfdir}/nginx/nginx.conf \
99 ${sysconfdir}/nginx/fastcgi.conf\
100 ${sysconfdir}/nginx/fastcgi_params \
101 ${sysconfdir}/nginx/koi-utf \
102 ${sysconfdir}/nginx/koi-win \
103 ${sysconfdir}/nginx/mime.types \
104 ${sysconfdir}/nginx/scgi_params \
105 ${sysconfdir}/nginx/uwsgi_params \
106 ${sysconfdir}/nginx/win-utf \
107"
108
109INITSCRIPT_NAME = "nginx"
110INITSCRIPT_PARAMS = "defaults 92 20"
111
112USERADD_PACKAGES = "${PN}"
113USERADD_PARAM_${PN} = " \
114 --system --no-create-home \
115 --home ${localstatedir}/www/localhost \
116 --groups www-data \
117 --user-group www"
diff --git a/meta-webserver/recipes-httpd/nostromo/files/0001-GNUmakefile-add-possibility-to-override-variables.patch b/meta-webserver/recipes-httpd/nostromo/files/0001-GNUmakefile-add-possibility-to-override-variables.patch
new file mode 100644
index 000000000..7cf011b1c
--- /dev/null
+++ b/meta-webserver/recipes-httpd/nostromo/files/0001-GNUmakefile-add-possibility-to-override-variables.patch
@@ -0,0 +1,141 @@
1From 7fa0d31ec5c0be9dca84a03851b2d44f61527ec8 Mon Sep 17 00:00:00 2001
2From: =?UTF-8?q?Eric=20B=C3=A9nard?= <eric@eukrea.com>
3Date: Sun, 4 Dec 2011 16:01:04 +0100
4Subject: [PATCH] GNUmakefile: add possibility to override variables
5MIME-Version: 1.0
6Content-Type: text/plain; charset=UTF-8
7Content-Transfer-Encoding: 8bit
8
9this is useful for cross compilation
10
11Signed-off-by: Eric Bénard <eric@eukrea.com>
12---
13Upstream-Status: Inappropriate [embedded specific]
14 src/libbsd/GNUmakefile | 10 +++++-----
15 src/libmy/GNUmakefile | 26 +++++++++++++-------------
16 src/nhttpd/GNUmakefile | 12 ++++++------
17 src/tools/GNUmakefile | 8 ++++----
18 4 files changed, 28 insertions(+), 28 deletions(-)
19
20diff --git a/src/libbsd/GNUmakefile b/src/libbsd/GNUmakefile
21index e2d01a3..b034bc6 100644
22--- a/src/libbsd/GNUmakefile
23+++ b/src/libbsd/GNUmakefile
24@@ -1,12 +1,12 @@
25-CCFLAGS = -O2 -pipe -Wall -Werror -Wstrict-prototypes -c
26+CFLAGS := -O2 -pipe -Wall -Werror -Wstrict-prototypes -c
27
28 libbsd.a: strlcpy.o strlcat.o
29- ar -r libbsd.a strlcpy.o strlcat.o
30- ranlib libbsd.a
31+ $(AR) -r libbsd.a strlcpy.o strlcat.o
32+ $(RANLIB) libbsd.a
33
34 strlcpy.o: strlcpy.c
35- cc ${CCFLAGS} strlcpy.c
36+ $(CC) $(CFLAGS) strlcpy.c
37 strlcat.o: strlcat.c
38- cc ${CCFLAGS} strlcat.c
39+ $(CC) $(CFLAGS) strlcat.c
40 clean:
41 rm -f libbsd.a *.o
42diff --git a/src/libmy/GNUmakefile b/src/libmy/GNUmakefile
43index ce90dd9..891ffea 100644
44--- a/src/libmy/GNUmakefile
45+++ b/src/libmy/GNUmakefile
46@@ -1,30 +1,30 @@
47-CCFLAGS = -O2 -Wall -Werror -Wstrict-prototypes -c
48+CFLAGS := -O2 -Wall -Werror -Wstrict-prototypes -c
49
50 libmy.a: strcutl.o strcutw.o strcuts.o strcuti.o strcutf.o flog.o flogd.o fparse.o strlower.o strb64d.o
51- ar -r libmy.a strcutl.o strcutw.o strcuts.o strcuti.o strcutf.o flog.o flogd.o fparse.o strlower.o strb64d.o
52- ranlib libmy.a
53+ $(AR) -r libmy.a strcutl.o strcutw.o strcuts.o strcuti.o strcutf.o flog.o flogd.o fparse.o strlower.o strb64d.o
54+ $(RANLIB) libmy.a
55
56 strcutl.o: strcutl.c
57- cc ${CCFLAGS} strcutl.c
58+ $(CC) $(CFLAGS) strcutl.c
59 strcutw.o: strcutw.c
60- cc ${CCFLAGS} strcutw.c
61+ $(CC) $(CFLAGS) strcutw.c
62 strcuts.o: strcuts.c
63- cc ${CCFLAGS} strcuts.c
64+ $(CC) $(CFLAGS) strcuts.c
65 strcuti.o: strcuti.c
66- cc ${CCFLAGS} strcuti.c
67+ $(CC) $(CFLAGS) strcuti.c
68 strcutf.o: strcutf.c
69- cc ${CCFLAGS} strcutf.c
70+ $(CC) $(CFLAGS) strcutf.c
71 strlower.o: strlower.c
72- cc ${CCFLAGS} strlower.c
73+ $(CC) $(CFLAGS) strlower.c
74 strb64d.o: strb64d.c
75- cc ${CCFLAGS} strb64d.c
76+ $(CC) $(CFLAGS) strb64d.c
77
78 flog.o: flog.c
79- cc ${CCFLAGS} flog.c
80+ $(CC) $(CFLAGS) flog.c
81 flogd.o: flogd.c
82- cc ${CCFLAGS} flogd.c
83+ $(CC) $(CFLAGS) flogd.c
84 fparse.o: fparse.c
85- cc ${CCFLAGS} fparse.c
86+ $(CC) $(CFLAGS) fparse.c
87
88 clean:
89 rm -f libmy.a *.o
90diff --git a/src/nhttpd/GNUmakefile b/src/nhttpd/GNUmakefile
91index f6d12de..9524911 100644
92--- a/src/nhttpd/GNUmakefile
93+++ b/src/nhttpd/GNUmakefile
94@@ -1,18 +1,18 @@
95-CCFLAGS = -O2 -pipe -Wall -Wstrict-prototypes -c
96+CFLAGS := -O2 -pipe -Wall -Wstrict-prototypes -c
97
98 nhttpd: main.o http.o sys.o
99- cc -L../libmy -L../libbsd -o nhttpd main.o http.o sys.o -lmy -lbsd -lssl -lcrypt
100- strip nhttpd
101+ $(CC) -L../libmy -L../libbsd -o nhttpd main.o http.o sys.o -lmy -lbsd -lssl -lcrypt
102+# $(STRIP) nhttpd
103 nroff -Tascii -c -mandoc nhttpd.8 > nhttpd.cat8
104
105 main.o: main.c
106- cc ${CCFLAGS} main.c
107+ $(CC) $(CFLAGS) main.c
108
109 http.o: http.c
110- cc ${CCFLAGS} http.c
111+ $(CC) $(CFLAGS) http.c
112
113 sys.o: sys.c
114- cc ${CCFLAGS} sys.c
115+ $(CC) $(CFLAGS) sys.c
116
117 clean:
118 rm -f nhttpd nhttpd.cat8 *.o
119diff --git a/src/tools/GNUmakefile b/src/tools/GNUmakefile
120index 15bea61..663ddb5 100644
121--- a/src/tools/GNUmakefile
122+++ b/src/tools/GNUmakefile
123@@ -1,11 +1,11 @@
124-CCFLAGS = -O2 -pipe -Wall -Werror -Wstrict-prototypes -c
125+CCFLAGS := -O2 -pipe -Wall -Werror -Wstrict-prototypes
126
127 crypt: crypt.o
128- cc -o crypt crypt.o -lcrypt
129- strip crypt
130+ $(CC) $(CFLAGS) -o crypt crypt.o -lcrypt
131+# $(STRIP) crypt
132
133 crypt.o: crypt.c
134- cc ${CCFLAGS} crypt.c
135+ $(CC) $(CFLAGS) -c crypt.c
136
137 clean:
138 rm -f crypt *.o
139--
1401.7.6.4
141
diff --git a/meta-webserver/recipes-httpd/nostromo/files/nhttpd.conf b/meta-webserver/recipes-httpd/nostromo/files/nhttpd.conf
new file mode 100644
index 000000000..6674bb696
--- /dev/null
+++ b/meta-webserver/recipes-httpd/nostromo/files/nhttpd.conf
@@ -0,0 +1,55 @@
1# MAIN [MANDATORY]
2
3servername localhost
4#servername www.nazgul.ch:8080
5serverlisten *
6#serverlisten 81.221.21.250 127.0.0.1 ::1
7serveradmin webmaster@localhost
8serverroot /var/nostromo
9servermimes /var/nostromo/conf/mimes
10docroot /var/nostromo/htdocs
11docindex index.html
12
13# LOGS [OPTIONAL]
14
15logpid /var/run/nostromo/nhttpd.pid
16#logaccess /var/log/nostromo/access_log
17
18# SETUID [RECOMMENDED]
19
20user www-data
21
22# BASIC AUTHENTICATION [OPTIONAL]
23
24#htaccess .htaccess
25#htpasswd /var/nostromo/conf/.htpasswd
26#htpasswd +bsdauth
27#htpasswd +bsdauthnossl
28
29# SSL [OPTIONAL]
30
31#sslport 443
32#sslcert /etc/ssl/server.crt
33#sslcertkey /etc/ssl/server.key
34
35# CUSTOM RESPONSES [OPTIONAL]
36#
37# The custom responses are searched in the corresponding document root.
38
39#custom_401 custom_401.html
40#custom_403 custom_403.html
41#custom_404 custom_404.html
42
43# ALIASES [OPTIONAL]
44
45/icons /var/nostromo/icons
46
47# VIRTUAL HOSTS [OPTIONAL]
48
49#www.rahel.ch /var/nostromo/htdocs/www.rahel.ch
50#www.rahel.ch:8080 /var/nostromo/htdocs/www.rahel.ch
51
52# HOMEDIRS [OPTIONAL]
53
54#homedirs /home
55#homedirs_public public_www
diff --git a/meta-webserver/recipes-httpd/nostromo/files/nostromo b/meta-webserver/recipes-httpd/nostromo/files/nostromo
new file mode 100644
index 000000000..8a2886882
--- /dev/null
+++ b/meta-webserver/recipes-httpd/nostromo/files/nostromo
@@ -0,0 +1,34 @@
1#!/bin/sh
2
3PATH=/sbin:/bin:/usr/sbin:/usr/bin
4DAEMON=nhttpd
5NAME=nhttpd
6DESC="Nostromo Web Server"
7OPTS="-c /etc/nhttpd.conf"
8
9case "$1" in
10 start)
11 echo -n "Starting $DESC: "
12 start-stop-daemon --start -x "$DAEMON" -- $OPTS
13 echo "$NAME."
14 ;;
15 stop)
16 echo -n "Stopping $DESC: "
17 start-stop-daemon --stop -x "$DAEMON"
18 echo "$NAME."
19 ;;
20 restart|force-reload)
21 echo -n "Restarting $DESC: "
22 start-stop-daemon --stop -x "$DAEMON"
23 sleep 1
24 start-stop-daemon --start -x "$DAEMON" -- $OPTS
25 echo "$NAME."
26 ;;
27 *)
28 N=/etc/init.d/$NAME
29 echo "Usage: $N {start|stop|restart|force-reload}" >&2
30 exit 1
31 ;;
32esac
33
34exit 0
diff --git a/meta-webserver/recipes-httpd/nostromo/files/tmpfiles.conf b/meta-webserver/recipes-httpd/nostromo/files/tmpfiles.conf
new file mode 100644
index 000000000..b7a9f4886
--- /dev/null
+++ b/meta-webserver/recipes-httpd/nostromo/files/tmpfiles.conf
@@ -0,0 +1 @@
d /run/nostromo - www-data www-data -
diff --git a/meta-webserver/recipes-httpd/nostromo/files/volatiles b/meta-webserver/recipes-httpd/nostromo/files/volatiles
new file mode 100644
index 000000000..40924960c
--- /dev/null
+++ b/meta-webserver/recipes-httpd/nostromo/files/volatiles
@@ -0,0 +1,2 @@
1d www-data www-data 0775 /var/run/nostromo none
2d www-data www-data 0775 /var/log/nostromo none
diff --git a/meta-webserver/recipes-httpd/nostromo/nostromo_1.9.5.bb b/meta-webserver/recipes-httpd/nostromo/nostromo_1.9.5.bb
new file mode 100644
index 000000000..fe860ec9a
--- /dev/null
+++ b/meta-webserver/recipes-httpd/nostromo/nostromo_1.9.5.bb
@@ -0,0 +1,69 @@
1SUMMARY = "A simple, fast and secure HTTP server"
2HOMEPAGE = "http://www.nazgul.ch/dev_nostromo.html"
3LICENSE = "MIT"
4LIC_FILES_CHKSUM = "file://src/nhttpd/main.c;beginline=2;endline=14;md5=e5ec3fa723b29b7d59d205afd8d36938"
5
6SRC_URI = "http://www.nazgul.ch/dev/${BPN}-${PV}.tar.gz \
7 file://0001-GNUmakefile-add-possibility-to-override-variables.patch \
8 file://nhttpd.conf \
9 file://volatiles \
10 file://tmpfiles.conf \
11 file://nostromo \
12"
13
14SRC_URI[md5sum] = "dc6cfd6b5aae04c370c7f818fa7bde55"
15SRC_URI[sha256sum] = "5f62578285e02449406b46cf06a7888fe3dc4a90bedf58cc18523bad62f6b914"
16
17TARGET_CC_ARCH += "${LDFLAGS}"
18
19DEPENDS = "openssl"
20
21inherit update-rc.d useradd
22
23INITSCRIPT_NAME = "nostromo"
24INITSCRIPT_PARAMS = "defaults 70"
25
26do_compile() {
27 oe_runmake
28}
29
30# we need user/group www-data to exist when we install
31#
32USERADD_PACKAGES = "${PN}"
33USERADD_PARAM_${PN} = "--system -g www-data www-data"
34
35do_install() {
36 install -d ${D}/${sbindir}
37 install -m 0755 src/nhttpd/nhttpd ${D}/${sbindir}/nhttpd
38 install -m 0755 src/tools/crypt ${D}/${sbindir}/crypt
39 install -d ${D}/${mandir}/man8
40 install -m 0444 src/nhttpd/nhttpd.8 ${D}/${mandir}/man8/nhttpd.8
41 install -d ${D}${localstatedir}/nostromo/conf
42 install -d ${D}${localstatedir}/nostromo/htdocs/cgi-bin
43 install -d ${D}${localstatedir}/nostromo/icons
44 install -d ${D}${sysconfdir}/init.d
45 install -m 0644 conf/mimes ${D}${localstatedir}/nostromo/conf/mimes
46 install -m 0644 ${WORKDIR}/nhttpd.conf ${D}${sysconfdir}
47 install -m 0755 ${WORKDIR}/nostromo ${D}${sysconfdir}/init.d
48 install -D -m 0644 ${WORKDIR}/volatiles ${D}${sysconfdir}/default/volatiles/nostromo
49 if ${@base_contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then
50 install -D -m 0644 ${WORKDIR}/tmpfiles.conf ${D}${sysconfdir}/tmpfiles.d/nostromo.conf
51 fi
52 install -m 0644 htdocs/index.html ${D}${localstatedir}/nostromo/htdocs/index.html
53 install -m 0644 htdocs/nostromo.gif ${D}${localstatedir}/nostromo/htdocs/nostromo.gif
54 install -m 0644 icons/dir.gif ${D}${localstatedir}/nostromo/icons/dir.gif
55 install -m 0644 icons/file.gif ${D}${localstatedir}/nostromo/icons/file.gif
56 chown -R www-data:www-data ${D}/${localstatedir}/nostromo
57}
58
59CONFFILES_${PN} += "/var/nostromo/conf/mimes ${sysconfdir}/nhttpd.conf"
60
61pkg_postinst_${PN} () {
62 if [ -z "$D" ]; then
63 if [ -e /sys/fs/cgroup/systemd ]; then
64 systemd-tmpfiles --create ${sysconfdir}/tmpfiles.d/nostromo.conf
65 elif [ -e ${sysconfdir}/init.d/populate-volatile.sh ]; then
66 ${sysconfdir}/init.d/populate-volatile.sh update
67 fi
68 fi
69}
diff --git a/meta-webserver/recipes-httpd/sthttpd/sthttpd/init b/meta-webserver/recipes-httpd/sthttpd/sthttpd/init
new file mode 100644
index 000000000..70f6797a7
--- /dev/null
+++ b/meta-webserver/recipes-httpd/sthttpd/sthttpd/init
@@ -0,0 +1,52 @@
1#!/bin/sh
2
3### BEGIN INIT INFO
4# Provides: thttpd
5# Required-Start: $remote_fs $syslog
6# Required-Stop: $remote_fs $syslog
7# Default-Start: 2 3 4 5
8# Default-Stop: 0 1 6
9# Short-Description: Small http server
10# Description: thttpd is a simple, small, portable, fast, and secure HTTP server.
11### END INIT INFO
12
13
14thttpd=/usr/sbin/thttpd
15test -x "$thttpd" || exit 0
16
17
18case "$1" in
19 start)
20 echo -n "Starting thttpd"
21 start-stop-daemon --start --quiet --exec $thttpd -- -d @@SRVDIR
22 echo "."
23 ;;
24 stop)
25 echo -n "Stopping thttpd"
26 start-stop-daemon --stop --quiet --exec $thttpd
27 echo "."
28 ;;
29 reload|force-reload)
30 start-stop-daemon --stop --quiet --signal 1 --exec $thttpd
31 ;;
32 restart)
33 echo -n "Stopping thttpd"
34 start-stop-daemon --stop --quiet --exec $thttpd -- -d @@SRVDIR
35 echo "."
36 echo -n "Waiting for thttpd to die off"
37 for i in 1 2 3 ;
38 do
39 sleep 1
40 echo -n "."
41 done
42 echo ""
43 echo -n "Starting thttpd"
44 start-stop-daemon --start --quiet --exec $thttpd -- -d @@SRVDIR
45 echo "."
46 ;;
47 *)
48 echo "Usage: /etc/init.d/thttpd {start|stop|reload|restart|force-reload}"
49 exit 1
50esac
51
52exit 0
diff --git a/meta-webserver/recipes-httpd/sthttpd/sthttpd/thttpd.service b/meta-webserver/recipes-httpd/sthttpd/sthttpd/thttpd.service
new file mode 100644
index 000000000..e2dae61fd
--- /dev/null
+++ b/meta-webserver/recipes-httpd/sthttpd/sthttpd/thttpd.service
@@ -0,0 +1,10 @@
1[Unit]
2Description=Tiny/Turbo/Throttling Web Server
3
4[Service]
5Type=forking
6ExecStart=/usr/sbin/thttpd -d @@SRVDIR -c cgi-bin/* -i /var/run/thttpd.pid
7PIDFile=/var/run/thttpd.pid
8
9[Install]
10WantedBy=multi-user.target
diff --git a/meta-webserver/recipes-httpd/sthttpd/sthttpd_2.26.4.bb b/meta-webserver/recipes-httpd/sthttpd/sthttpd_2.26.4.bb
new file mode 100644
index 000000000..0abd13169
--- /dev/null
+++ b/meta-webserver/recipes-httpd/sthttpd/sthttpd_2.26.4.bb
@@ -0,0 +1,40 @@
1SUMMARY = "A simple, small, portable, fast, and secure HTTP server"
2DESCRIPTION = "A simple, small, portable, fast, and secure HTTP server (supported fork of thttpd)."
3HOMEPAGE = "http://opensource.dyc.edu/sthttpd"
4LICENSE = "BSD-2-Clause"
5LIC_FILES_CHKSUM = "file://src/thttpd.c;beginline=1;endline=26;md5=0c5762c2c34dcbe9eb18815516502872"
6
7SRC_URI = "http://opensource.dyc.edu/pub/sthttpd/sthttpd-${PV}.tar.gz \
8 file://thttpd.service \
9 file://init"
10
11SRC_URI[md5sum] = "e645a85a97d3cb883011a35bc2211815"
12SRC_URI[sha256sum] = "78e87979140cbda123c81b4051552242dbbffb5dec1a17e5f95ec4826b1eaddb"
13
14S = "${WORKDIR}/sthttpd-${PV}"
15
16inherit autotools update-rc.d systemd
17
18EXTRA_OEMAKE += "'WEBDIR=${servicedir}/www'"
19
20do_install_append () {
21 install -d ${D}${sysconfdir}/init.d
22 install -c -m 755 ${WORKDIR}/init ${D}${sysconfdir}/init.d/thttpd
23 sed -i -e 's,@@SRVDIR,${servicedir}/www,g' ${D}${sysconfdir}/init.d/thttpd
24 sed -i 's!/usr/sbin/!${sbindir}/!g' ${D}${sysconfdir}/init.d/thttpd
25
26 install -d ${D}${systemd_unitdir}/system
27 install -m 0644 ${WORKDIR}/thttpd.service ${D}${systemd_unitdir}/system
28 sed -i 's!/usr/sbin/!${sbindir}/!g' ${D}${systemd_unitdir}/system/thttpd.service
29 sed -i 's!/var/!${localstatedir}/!g' ${D}${systemd_unitdir}/system/thttpd.service
30 sed -i -e 's,@@SRVDIR,${servicedir}/www,g' ${D}${systemd_unitdir}/system/thttpd.service
31}
32
33INITSCRIPT_NAME = "thttpd"
34INITSCRIPT_PARAMS = "defaults"
35
36SYSTEMD_SERVICE_${PN} = "thttpd.service"
37
38FILES_${PN} += "${servicedir}"
39FILES_${PN}-dbg += "${servicedir}/www/cgi-bin/.debug"
40