Skip to contentSkip to conversation

meta-webserver improvements

PATCH In review Paul Eggleton 2 participants 8 messages Oct 7, 2012 – Oct 9, 2012

lore
Share & tools
lore
#0 lore raw

cover meta-webserver improvements

Fixes for some bugs in the apache2 & modphp recipes, along with phpmyadmin which I used to discover and fix them.

The following changes since commit 68f05443333afa527e3b24e4caae6115dfb6b6b6:

opencv: bump PR due libav update (2012-10-05 11:27:25 +0200)

are available in the git repository at:

git://git.openembedded.org/meta-openembedded-contrib paule/meta-webserver-fixes
http://cgit.openembedded.org/cgit.cgi/meta-openembedded-contrib/log/?h=paule/meta-webserver-fixes

Paul Eggleton (3):
apache2: fix configuration
modphp: fix default php.ini & add PACKAGECONFIG
phpmyadmin: add new recipe

 .../recipes-httpd/apache2/apache2_2.4.2.bb         |   10 +++--
 meta-webserver/recipes-httpd/apache2/files/init    |    6 +--
 meta-webserver/recipes-php/modphp/modphp5.inc      |   34 ++++++++--------
 meta-webserver/recipes-php/modphp/modphp_5.3.14.bb |    2 +-
 .../recipes-php/phpmyadmin/phpmyadmin/apache.conf  |   42 ++++++++++++++++++++
 .../recipes-php/phpmyadmin/phpmyadmin_3.5.2.2.bb   |   30 ++++++++++++++
 6 files changed, 100 insertions(+), 24 deletions(-)
 create mode 100644 meta-webserver/recipes-php/phpmyadmin/phpmyadmin/apache.conf
 create mode 100644 meta-webserver/recipes-php/phpmyadmin/phpmyadmin_3.5.2.2.bb
Signature · 1 line
1.7.9.5
#1 lore raw

PATCH 1/3 apache2: fix configuration

* Include conf files in /etc/apache2/modules.d and conf.d
* Add -D PHP5 to options so that PHP is enabled if installed
* Fix "reload" action in initscript

---
 .../recipes-httpd/apache2/apache2_2.4.2.bb         |   10 +++++++---
 meta-webserver/recipes-httpd/apache2/files/init    |    6 +++---
 2 files changed, 10 insertions(+), 6 deletions(-)
meta-webserver/recipes-httpd/apache2/apache2_2.4.2.bb +7 -3
index 15c4d02..0eb5327 100644
@@ -6,7 +6,7 @@ DEPENDS = "libtool-native apache2-native openssl expat pcre apr apr-util"
 RDEPENDS_${PN} += "openssl libgcc"
 SECTION = "net"
 LICENSE = "Apache-2.0"
-PR = "r0"
+PR = "r1"
 
 SRC_URI = "http://www.apache.org/dist/httpd/httpd-${PV}.tar.bz2 \
            file://server-makefile.patch \
@@ -68,8 +68,12 @@ do_install_append() {
 	# Expat should be found in the staging area via DEPENDS...
 	rm -f ${D}/${libdir}/libexpat.*
 
-	# Ensure configuration file pulls in modules.d
-	printf "\nInclude ${sysconfdir}/${PN}/modules.d/*\n\n" >> ${D}/${sysconfdir}/${PN}/httpd.conf
+	install -d ${D}${sysconfdir}/${PN}/conf.d
+	install -d ${D}${sysconfdir}/${PN}/modules.d
+
+	# Ensure configuration file pulls in conf.d and modules.d
+	printf "\nIncludeOptional ${sysconfdir}/${PN}/conf.d/*.conf" >> ${D}/${sysconfdir}/${PN}/httpd.conf
+	printf "\nIncludeOptional ${sysconfdir}/${PN}/modules.d/*.conf\n\n" >> ${D}/${sysconfdir}/${PN}/httpd.conf
 }
 
 SYSROOT_PREPROCESS_FUNCS += "apache_sysroot_preprocess"
meta-webserver/recipes-httpd/apache2/files/init +3 -3
index 85af742..346dc0d 100755
@@ -9,12 +9,12 @@
 #  implementing the current HTTP standards.
 ### END INIT INFO
 
-ARGS="-D SSL -k start"
+ARGS="-D SSL -D PHP5 -k start"
 NAME=apache2
 PATH=/bin:/usr/bin:/sbin:/usr/sbin
 DAEMON=/usr/sbin/httpd
 SUEXEC=/usr/lib/apache/suexec
-PIDFILE=/var/run/$NAME.pid
+PIDFILE=/var/apache2/logs/httpd.pid
 CONF=/etc/apache2/httpd.conf
 APACHECTL=/usr/sbin/apachectl 
 
@@ -40,7 +40,7 @@ case "$1" in
 
   reload)
     echo -n "Reloading $NAME configuration"
-    $APACHECTL reload
+    kill -HUP `cat $PIDFILE`
     ;;
 
   reload-modules)
Signature · 1 line
1.7.9.5
#6 lore raw

PATCH 2/3 modphp: fix default php.ini & add PACKAGECONFIG

In reply to Paul Eggleton

* Add "mysql" PACKAGECONFIG option
* Add "pgsql" PACKAGECONFIG option (untested)
* Use the correct template php.ini filename so that we actually get some content in the default file

---
 meta-webserver/recipes-php/modphp/modphp5.inc      |   34 ++++++++++----------
 meta-webserver/recipes-php/modphp/modphp_5.3.14.bb |    2 +-
 2 files changed, 18 insertions(+), 18 deletions(-)
meta-webserver/recipes-php/modphp/modphp5.inc +17 -17
index 82b5ce1..344eb31 100644
@@ -20,27 +20,27 @@ CFLAGS += " -g -DPTYS_ARE_GETPT -DPTYS_ARE_SEARCHED -I${STAGING_INCDIR}/apache2"
 EXTRA_OECONF = "--with-apxs2=${STAGING_BINDIR_CROSS}/apxs \
                 --enable-maintainer-zts \
                 --without-mysql \
-		--enable-force-cgi-redirect \
-		--disable-cgi \
-		--disable-cli \
-		--disable-pdo \
-		--without-pear \
-		--without-iconv \
-		--disable-ipv6 \
-		--disable-xml \
-		--disable-xmlreader \
-		--disable-xmlwriter \
-		--disable-simplexml \
-		--disable-libxml \
-		--disable-dom \
+                --enable-force-cgi-redirect \
+                --disable-cgi \
+                --disable-cli \
+                --disable-pdo \
+                --without-pear \
+                --without-iconv \
+                --disable-ipv6 \
+                --disable-xml \
+                --disable-xmlreader \
+                --disable-xmlwriter \
+                --disable-simplexml \
+                --disable-libxml \
+                --disable-dom \
                 --disable-rpath \
                 --libdir=${libdir}/php5 \
                 --with-zlib --with-zlib-dir=${STAGING_DIR_TARGET}${exec_prefix} \
                 --with-config-file-path=${sysconfdir}/php/apache2-php5"
 
-# to get postgres support, add it to the DEPENDS above
-# and uncomment this line.  similar for mysql
-#EXTRA_OECONF += " --with-pgsql=${STAGING_DIR_HOST}${layout_exec_prefix}"
+PACKAGECONFIG ??= ""
+PACKAGECONFIG[mysql] = "--with-mysqli=${STAGING_BINDIR_CROSS}/mysql_config,--without-mysqli,mysql5"
+PACKAGECONFIG[pgsql] = "--with-pgsql=${STAGING_DIR_TARGET}${exec_prefix},--without-pgsql,mysql5"
 
 acpaths = ""
 
@@ -60,7 +60,7 @@ do_install  () {
 	install -d ${D}${sysconfdir}/php/apache2-php5
 	install -m 755  libs/libphp5.so ${D}${libdir}/apache2/modules
 	install -m 644  ${WORKDIR}/70_mod_php5.conf ${D}${sysconfdir}/apache2/modules.d
-	cat ${S}/php.ini-dist | \
+	cat ${S}/php.ini-production | \
 		sed -e 's,extension_dir = \"\./\",extension_dir = \"/usr/lib/extensions\",' \
 		> ${D}${sysconfdir}/php/apache2-php5/php.ini
 
meta-webserver/recipes-php/modphp/modphp_5.3.14.bb +1 -1
index b6a5126..707f5f9 100644
@@ -1,5 +1,5 @@
 include modphp5.inc
-PR = "r0"
+PR = "r1"
 
 SRC_URI[md5sum] = "7caac4f71e2f21426c11ac153e538392"
 SRC_URI[sha256sum] = "c8075b6e83c5db0d26cc8426a7456856421089a76c963813b1fcac3ced041cb3"
Signature · 1 line
1.7.9.5
#7 lore raw

PATCH 3/3 phpmyadmin: add new recipe

In reply to Paul Eggleton

Add new recipe for phpMyAdmin 3.5.2.2, borrowing the apache.conf file from Debian (with the addition of "Require all granted" to enable access).

---
 .../recipes-php/phpmyadmin/phpmyadmin/apache.conf  |   42 ++++++++++++++++++++
 .../recipes-php/phpmyadmin/phpmyadmin_3.5.2.2.bb   |   30 ++++++++++++++
 2 files changed, 72 insertions(+)
 create mode 100644 meta-webserver/recipes-php/phpmyadmin/phpmyadmin/apache.conf
 create mode 100644 meta-webserver/recipes-php/phpmyadmin/phpmyadmin_3.5.2.2.bb
meta-webserver/recipes-php/phpmyadmin/phpmyadmin/apache.conf new file +42 -0
new file mode 100644
index 0000000..94cbd86
@@ -0,0 +1,42 @@
+# phpMyAdmin default Apache configuration
+
+Alias /phpmyadmin /usr/share/phpmyadmin
+
+<Directory /usr/share/phpmyadmin>
+	Options FollowSymLinks
+	DirectoryIndex index.php
+	Require all granted
+
+	<IfModule mod_php5.c>
+		AddType application/x-httpd-php .php
+
+		php_flag magic_quotes_gpc Off
+		php_flag track_vars On
+		php_flag register_globals Off
+		php_admin_flag allow_url_fopen Off
+		php_value include_path .
+		php_admin_value upload_tmp_dir /var/lib/phpmyadmin/tmp
+		php_admin_value open_basedir /usr/share/phpmyadmin/:/etc/phpmyadmin/:/var/lib/phpmyadmin/
+	</IfModule>
+</Directory>
+
+# Authorize for setup
+<Directory /usr/share/phpmyadmin/setup>
+    <IfModule mod_authn_file.c>
+    AuthType Basic
+    AuthName "phpMyAdmin Setup"
+    AuthUserFile /etc/phpmyadmin/htpasswd.setup
+    </IfModule>
+    Require valid-user
+</Directory>
+
+# Disallow web access to directories that don't need it
+<Directory /usr/share/phpmyadmin/libraries>
+    Order Deny,Allow
+    Deny from All
+</Directory>
+<Directory /usr/share/phpmyadmin/setup/lib>
+    Order Deny,Allow
+    Deny from All
+</Directory>
+
meta-webserver/recipes-php/phpmyadmin/phpmyadmin_3.5.2.2.bb new file +30 -0
new file mode 100644
index 0000000..e3a581c
@@ -0,0 +1,30 @@
+SUMMARY = "Web-based MySQL administration interface"
+HOMEPAGE = "http://www.phpmyadmin.net"
+# Main code is GPLv2, libraries/tcpdf is under LGPLv3, js/jquery is under MIT
+LICENSE = "GPLv2 & LGPLv3 & MIT"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=eb723b61539feef013de476e68b5c50a \
+                    file://libraries/tcpdf/LICENSE.TXT;md5=5c87b66a5358ebcc495b03e0afcd342c"
+
+PR = "r0"
+
+SRC_URI = "${SOURCEFORGE_MIRROR}/phpmyadmin/phpMyAdmin/${PV}/phpMyAdmin-${PV}-all-languages.tar.xz \
+           file://apache.conf"
+
+SRC_URI[md5sum] = "3f8993fe0f2fee1a022768278c6a270b"
+SRC_URI[sha256sum] = "d02de081c522d3026f4a8418538f7ff05adf280afa404851a5f7f4ef895b4a7d"
+
+S = "${WORKDIR}/phpMyAdmin-${PV}-all-languages"
+
+inherit allarch
+
+do_install() {
+	install -d ${D}${datadir}/${PN}
+	cp -a * ${D}${datadir}/${PN}
+
+	install -d ${D}${sysconfdir}/apache2/conf.d
+	install -m 0644 ${WORKDIR}/apache.conf ${D}${sysconfdir}/apache2/conf.d/phpmyadmin.conf
+}
+
+FILES_${PN} = "${datadir}/${PN} \
+               ${sysconfdir}/apache2/conf.d"
+
Signature · 1 line
1.7.9.5
#2 lore raw

Re: [meta-webserver][PATCH 1/3] apache2: fix configuration

In reply to Paul Eggleton

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Op 07-10-12 13:13, Paul Eggleton schreef:

Quoted 5 lines

* Include conf files in /etc/apache2/modules.d and conf.d * Add -D PHP5 to options so that PHP is enabled if installed * Fix "reload" action in initscript

This is more likely related to your previous patch, but:

| /bin/sh:
/OE/tentacle/build/tmp-angstrom_next-eglibc/work/armv7a-vfp-neon-angstrom-linux-gnueabi/apr-1.4.6-r1/apr-1.4.6/arm-angstrom-linux-gnueabi-libtool:
No such file or directory
| make[3]: *** [unixd.lo] Error 127
| make[3]: Leaving directory `/OE/tentacle/build/tmp-angstrom_next-eglibc/work/armv7a-vfp-neon-angstrom-linux-gnueabi/apache2-2.4.2-r1/httpd-2.4.2/os/unix' | make[2]: *** [all-recursive] Error 1
| make[2]: Leaving directory `/OE/tentacle/build/tmp-angstrom_next-eglibc/work/armv7a-vfp-neon-angstrom-linux-gnueabi/apache2-2.4.2-r1/httpd-2.4.2/os/unix' | make[1]: *** [all-recursive] Error 1
| make[1]: Leaving directory `/OE/tentacle/build/tmp-angstrom_next-eglibc/work/armv7a-vfp-neon-angstrom-linux-gnueabi/apache2-2.4.2-r1/httpd-2.4.2/os'

| make: *** [all-recursive] Error 1
| ERROR: oe_runmake failed
| ERROR: Function failed: do_compile (see

/OE/tentacle/build/tmp-angstrom_next-eglibc/work/armv7a-vfp-neon-angstrom-linux-gnueabi/apache2-2.4.2-r1/temp/log.do_compile.591 for further information)
ERROR: Task 6 (/OE/tentacle/sources/meta-openembedded/meta-webserver/recipes-httpd/apache2/apache2_2.4.2.bb,
do_compile) failed with exit code '1'

regards,

Koen

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (Darwin)
Comment: GPGTools - http://gpgtools.org

iD8DBQFQdBdPMkyGM64RGpERArmdAJ9DLRsJRcukSsV2bZlHNnovkpSSEACeOerO 6XGE5EYT0PCe3bRmWTwW8KU=
=TfsA
-----END PGP SIGNATURE-----

#3 lore raw

Re: [meta-webserver][PATCH 1/3] apache2: fix configuration

Quoted 35 lines · On Tuesday 09 October 2012 14:23:43 Koen Kooi wrote:

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Op 07-10-12 13:13, Paul Eggleton schreef:

Quoted 5 lines

* Include conf files in /etc/apache2/modules.d and conf.d * Add -D PHP5 to options so that PHP is enabled if installed * Fix "reload" action in initscript

This is more likely related to your previous patch, but:
| /bin/sh:
/OE/tentacle/build/tmp-angstrom_next-eglibc/work/armv7a-vfp-neon-angstrom-li nux-gnueabi/apr-1.4.6-r1/apr-1.4.6/arm-angstrom-linux-gnueabi-libtool: No such file or directory

| make[3]: *** [unixd.lo] Error 127
| make[3]: Leaving directory

`/OE/tentacle/build/tmp-angstrom_next-eglibc/work/armv7a-vfp-neon-angstrom-l inux-gnueabi/apache2-2.4.2-r1/httpd-2.4.2/os/unix'
| make[2]: *** [all-recursive] Error 1
| make[2]: Leaving directory

`/OE/tentacle/build/tmp-angstrom_next-eglibc/work/armv7a-vfp-neon-angstrom-l inux-gnueabi/apache2-2.4.2-r1/httpd-2.4.2/os/unix'
| make[1]: *** [all-recursive] Error 1
| make[1]: Leaving directory

`/OE/tentacle/build/tmp-angstrom_next-eglibc/work/armv7a-vfp-neon-angstrom-l inux-gnueabi/apache2-2.4.2-r1/httpd-2.4.2/os'

| make: *** [all-recursive] Error 1
| ERROR: oe_runmake failed
| ERROR: Function failed: do_compile (see
Quoted 6 lines

/OE/tentacle/build/tmp-angstrom_next-eglibc/work/armv7a-vfp-neon-angstrom-li nux-gnueabi/apache2-2.4.2-r1/temp/log.do_compile.591 for further information)
ERROR: Task 6 (/OE/tentacle/sources/meta-openembedded/meta-webserver/recipes-httpd/apache2 /apache2_2.4.2.bb, do_compile) failed with exit code '1'

I'm guessing you are using rm_work? Obviously it's not supposed to be referring to anything in the WORKDIR for another recipe, but it would at least explain why I did not see that failure here.

Cheers,
Paul

Signature · 2 lines
Paul Eggleton
Intel Open Source Technology Centre
#4 lore raw

Re: [meta-webserver][PATCH 1/3] apache2: fix configuration

Op 9 okt. 2012, om 14:30 heeft Paul Eggleton <[email protected]> het volgende geschreven:

Quoted 43 lines · On Tuesday 09 October 2012 14:23:43 Koen Kooi wrote:
Quoted 35 lines

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Op 07-10-12 13:13, Paul Eggleton schreef:

Quoted 5 lines

* Include conf files in /etc/apache2/modules.d and conf.d * Add -D PHP5 to options so that PHP is enabled if installed * Fix "reload" action in initscript

This is more likely related to your previous patch, but:
| /bin/sh:
/OE/tentacle/build/tmp-angstrom_next-eglibc/work/armv7a-vfp-neon-angstrom-li nux-gnueabi/apr-1.4.6-r1/apr-1.4.6/arm-angstrom-linux-gnueabi-libtool: No such file or directory

| make[3]: *** [unixd.lo] Error 127
| make[3]: Leaving directory

`/OE/tentacle/build/tmp-angstrom_next-eglibc/work/armv7a-vfp-neon-angstrom-l inux-gnueabi/apache2-2.4.2-r1/httpd-2.4.2/os/unix'
| make[2]: *** [all-recursive] Error 1
| make[2]: Leaving directory

`/OE/tentacle/build/tmp-angstrom_next-eglibc/work/armv7a-vfp-neon-angstrom-l inux-gnueabi/apache2-2.4.2-r1/httpd-2.4.2/os/unix'
| make[1]: *** [all-recursive] Error 1
| make[1]: Leaving directory

`/OE/tentacle/build/tmp-angstrom_next-eglibc/work/armv7a-vfp-neon-angstrom-l inux-gnueabi/apache2-2.4.2-r1/httpd-2.4.2/os'

| make: *** [all-recursive] Error 1
| ERROR: oe_runmake failed
| ERROR: Function failed: do_compile (see
Quoted 6 lines

/OE/tentacle/build/tmp-angstrom_next-eglibc/work/armv7a-vfp-neon-angstrom-li nux-gnueabi/apache2-2.4.2-r1/temp/log.do_compile.591 for further information)
ERROR: Task 6 (/OE/tentacle/sources/meta-openembedded/meta-webserver/recipes-httpd/apache2 /apache2_2.4.2.bb, do_compile) failed with exit code '1'

Quoted 3 lines

I'm guessing you are using rm_work? Obviously it's not supposed to be referring to anything in the WORKDIR for another recipe, but it would at least explain why I did not see that failure here.

I am indeed using rm_work.

#5 lore raw

Re: [meta-webserver][PATCH 1/3] apache2: fix configuration

Quoted 1 line · On Tuesday 09 October 2012 14:35:25 Koen Kooi wrote:

I am indeed using rm_work.

OK, I'll take a look at it. I am also aware of a bad rpath QA failure in modphp which I am looking into as well.

Cheers,
Paul

Signature · 2 lines
Paul Eggleton
Intel Open Source Technology Centre