Skip to contentSkip to conversation

does specifying "--with-mpm=prefork" for apache2 require ugly manual hacking?

DISCUSSION Robert P. J. Day 2 participants 2 messages Mar 7, 2017

lore
Share & tools
lore
#0 lore raw

just ran across the following situation in that an OE build
(actually, wind river linux, but that should make no difference) has a bbappend file, "apache2_2.4.16.bbappend", that appears to be going to a great deal of trouble to simply specify "--with-mpm=prefork":

EXTRA_OECONF += " --with-mpm=prefork "

do_install_append() {
		# Make a backup of the original httpd.conf file
    cp ${D}/${sysconfdir}/${BPN}/httpd.conf ${D}/${sysconfdir}/${BPN}/httpd.conf.orig

    # Remove the two offending lines (to be replaced with the correct ones), as well as uncommenting the mpm include directive.
    sed -r 's_^IncludeOptional\s+/etc/apache2/conf.d/\*.conf__' < ${D}/${sysconfdir}/${BPN}/httpd.conf.orig | sed -r 's_^IncludeOptional\s+/etc/apache2/modules.d/\*.conf__' | sed -r 's_^#Include\s+etc/apache2/extra/httpd-mpm.conf_Include etc/apache2/extra/httpd-mpm.conf_' | sed -r 's_^Listen 80$_Listen 80\n#Temporary use by minion\nListen 8081_' > ${D}/${sysconfdir}/${BPN}/httpd.conf

    # Replacing the two lines removed previously with the correct ones. Loading the modules first, then configure them.
    printf "\nIncludeOptional ${sysconfdir}/${BPN}/modules.d/*.load" >> ${D}/${sysconfdir}/${BPN}/httpd.conf
    printf "\nIncludeOptional ${sysconfdir}/${BPN}/conf.d/*.conf" >> ${D}/${sysconfdir}/${BPN}/httpd.conf
}

i'm unclear on what is happening above, but it seems that asking for
a simple configuration like that should be available with something as basic as adding an option, or selecting PACKAGECONFIG.

am i missing something? is all of the above really necessary to do
something that looks fairly straightforward?

rday

Signature · 7 lines
========================================================================
Robert P. J. Day                                 Ottawa, Ontario, CANADA
                        http://crashcourse.ca

Twitter:                                       http://twitter.com/rpjday
LinkedIn:                               http://ca.linkedin.com/in/rpjday
========================================================================
#1 lore raw

Since they call out the specific version of 2.4.16, I assume this is based on the jethro branch. I suppose the multiprocessing module could probably be a PACKAGECONFIG option[1]. There are several competing multiprocessing modules that can be configured statically or as shared for dynamic loading (event[1] vs worker[2] vs prefork[3]).

As far as the do_install_append goes, the installed configuration files for apache get built up as part of the build from a set of templates in ./docs/conf/. The uncommenting of the mpm line might be part of a PACAKGECONFIG, but the other lines appear to be specific to their use case rather than generally applicable to using the prefork module: for example, they are setting the port to 8081 from port 80 (You can also specify the port at configure time with --port=PORT).

-Derek

[1] - https://httpd.apache.org/docs/2.4/mpm.html
[2] - https://httpd.apache.org/docs/2.4/mod/event.html
[3] - https://httpd.apache.org/docs/2.4/mod/worker.html
[4] - https://httpd.apache.org/docs/2.4/mod/prefork.html

Quoted 56 lines · Robert P. J. Day

just ran across the following situation in that an OE build
(actually, wind river linux, but that should make no difference) has a bbappend file, "apache2_2.4.16.bbappend", that appears to be going to a great deal of trouble to simply specify "--with-mpm=prefork":

EXTRA_OECONF += " --with-mpm=prefork "

do_install_append() {
# Make a backup of the original httpd.conf file
cp ${D}/${sysconfdir}/${BPN}/httpd.conf ${D}/${sysconfdir}/${BPN}/
httpd.conf.orig

# Remove the two offending lines (to be replaced with the correct
ones), as well as uncommenting the mpm include directive.

    sed -r 's_^IncludeOptional\s+/etc/apache2/conf.d/\*.conf__' <

${D}/${sysconfdir}/${BPN}/httpd.conf.orig | sed -r 's_^IncludeOptional\s+/etc/apache2/modules.d/\*.conf__' | sed -r 's_^#Include\s+etc/apache2/extra/httpd-mpm.conf_Include etc/apache2/extra/httpd-mpm.conf_' | sed -r 's_^Listen 80$_Listen 80\n#Temporary use by minion\nListen 8081_' > ${D}/${sysconfdir}/${BPN}/ httpd.conf

# Replacing the two lines removed previously with the correct ones.
Loading the modules first, then configure them.

    printf "\nIncludeOptional ${sysconfdir}/${BPN}/modules.d/*.load" >>
${D}/${sysconfdir}/${BPN}/httpd.conf
    printf "\nIncludeOptional ${sysconfdir}/${BPN}/conf.d/*.conf" >>

${D}/${sysconfdir}/${BPN}/httpd.conf
}

i'm unclear on what is happening above, but it seems that asking for
a simple configuration like that should be available with something as basic as adding an option, or selecting PACKAGECONFIG.

am i missing something? is all of the above really necessary to do
something that looks fairly straightforward?

rday

--

========================================================================
Robert P. J. Day Ottawa, Ontario, CANADA
http://crashcourse.ca

Twitter:                                       http://twitter.com/rpjday
LinkedIn:                               http://ca.linkedin.com/in/rpjday

========================================================================

--
_______________________________________________
Openembedded-devel mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-devel