Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 238595 - apache 2.2.9-r1 ebuild
Summary: apache 2.2.9-r1 ebuild
Status: RESOLVED FIXED
Alias: None
Product: Gentoo/Alt
Classification: Unclassified
Component: Prefix Support (show other bugs)
Hardware: Sparc Solaris
: High normal (vote)
Assignee: Gentoo non-Linux Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-09-24 18:55 UTC by Quentin Conner
Modified: 2008-11-10 16:00 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
patch for apache-2.2.9-r1.ebuild (ebuild229r1.patch,1.00 KB, patch)
2008-09-24 18:59 UTC, Quentin Conner
Details | Diff
patch for apache-2.eclass (eclass.patch,3.93 KB, patch)
2008-09-24 19:03 UTC, Quentin Conner
Details | Diff
patch file for 2.2.9-r1 apache ebuild. goes in the files directory. (apache-2.2.9-r1-prefix.patch,17.07 KB, patch)
2008-09-24 19:07 UTC, Quentin Conner
Details | Diff
Updated ebuild patch (ebuild229r1.patch,1.78 KB, patch)
2008-09-25 21:36 UTC, Quentin Conner
Details | Diff
updated eclass patch (eclass.patch,5.15 KB, patch)
2008-09-25 21:36 UTC, Quentin Conner
Details | Diff
updated prefix patch for the files directory (apache-2.2.9-r1-prefix.patch,19.37 KB, text/plain)
2008-09-25 21:37 UTC, Quentin Conner
Details
working patch for apache-2.2.9-r1.ebuild (ebuild229r1.patch,2.12 KB, patch)
2008-10-28 19:00 UTC, Quentin Conner
Details | Diff
working patch for apache-2.eclass (eclass.patch,8.35 KB, patch)
2008-10-28 19:00 UTC, Quentin Conner
Details | Diff
eclass patch relative to 20081028 rsync mirror (latest_apache-2_eclass.patch,6.93 KB, patch)
2008-10-28 19:15 UTC, Quentin Conner
Details | Diff
ebuild patch relative to 20081028 rsync mirror (latest_apache-229r1_ebuild.patch,2.13 KB, patch)
2008-10-28 19:15 UTC, Quentin Conner
Details | Diff
eclass patch relative to 20081028 rsync mirror (latest_apache-2_eclass.patch,6.97 KB, patch)
2008-10-29 20:36 UTC, Quentin Conner
Details | Diff
ebuild patch relative to 20081028 rsync mirror (latest_apache-229r1_ebuild.patch,2.00 KB, patch)
2008-10-29 20:37 UTC, Quentin Conner
Details | Diff
ebuild patch relative to 20081028 rsync mirror (latest_apache-229r1_ebuild.patch,2.00 KB, patch)
2008-10-29 21:03 UTC, Quentin Conner
Details | Diff
ebuild patch relative to 20081028 rsync mirror (latest_apache-229r1_ebuild.patch,2.00 KB, patch)
2008-10-29 21:06 UTC, Quentin Conner
Details | Diff
eclass/depend.apache.eclass patch (depend.apache.eclass.patch,842 bytes, patch)
2008-11-06 18:57 UTC, Quentin Conner
Details | Diff
app-admin/apache-tools/apache-tools-2.2.9.ebuild patch (apache-tools-2.2.9.ebuild.patch,793 bytes, patch)
2008-11-06 18:58 UTC, Quentin Conner
Details | Diff
latest apache-2.eclass patch (latest_apache-2_eclass.patch,7.03 KB, patch)
2008-11-06 18:59 UTC, Quentin Conner
Details | Diff
latest apache-2.2.9-r1 ebuild patch (latest_apache-229r1_ebuild.patch,2.37 KB, patch)
2008-11-06 18:59 UTC, Quentin Conner
Details | Diff
apache-2.2.9-r1.ebuild (apache-2.2.9-r1.ebuild,2.72 KB, text/plain)
2008-11-06 19:02 UTC, Quentin Conner
Details
apache-2.eclass (apache-2.eclass,19.50 KB, text/plain)
2008-11-06 19:02 UTC, Quentin Conner
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Quentin Conner 2008-09-24 18:55:00 UTC
Noticed that apache 2 ebuild is hard masked and am trying to patch the 2.2.9-r1 ebuild to work on Solaris (prefix).

Looking for a mentor/collaborator and uploading work-in-progress patches.

ebuild now succeeds but runscript doesn't yet work.  

Reproducible: Always

Steps to Reproduce:
1. ebuild /apps/gpp/usr/portage/www-servers/apache/apache-2.2.9-r1.ebuild clean merge
2. $EPREFIX/etc/init.d/apache2 start
Comment 1 Quentin Conner 2008-09-24 18:59:39 UTC
Created attachment 166295 [details, diff]
patch for  apache-2.2.9-r1.ebuild
Comment 2 Jeremy Olexa (darkside) (RETIRED) archtester gentoo-dev Security 2008-09-24 19:00:47 UTC
We wouldn't really expect the init files to work (nor would it really be possible). Does everything else work?
Comment 3 Quentin Conner 2008-09-24 19:03:31 UTC
Created attachment 166299 [details, diff]
patch for apache-2.eclass
Comment 4 Quentin Conner 2008-09-24 19:07:05 UTC
Created attachment 166301 [details, diff]
patch file for 2.2.9-r1 apache ebuild.  goes in the files directory.
Comment 5 Quentin Conner 2008-09-24 19:25:18 UTC
What is the state of baselayout for the Prefixed portage?  Can you point me in the right direction in this regard?

As for the resulting apache2 binary, it is not yet working.  It reads some configuration, makes it as far as the first fork(), loads libz and then fails right after accessing the Solaris Name Service door.

/apps/gpp/usr/sbin/apache2 -V
Server version: Apache/2.2.9 (Unix)
Server built:   Sep 24 2008 12:57:07
Server's Module Magic Number: 20051115:15
Server loaded:  APR 1.3.2, APR-Util 1.3.2
Compiled using: APR 1.3.2, APR-Util 1.3.2
Architecture:   64-bit
Server MPM:     Prefork
  threaded:     no
    forked:     yes (variable process count)
Server compiled with....
 -D APACHE_MPM_DIR="server/mpm/prefork"
 -D APR_HAS_SENDFILE
 -D APR_HAS_MMAP
 -D APR_HAVE_IPV6 (IPv4-mapped addresses enabled)
 -D APR_USE_FCNTL_SERIALIZE
 -D APR_USE_PTHREAD_SERIALIZE
 -D SINGLE_LISTEN_UNSERIALIZED_ACCEPT
 -D APR_HAS_OTHER_CHILD
 -D AP_HAVE_RELIABLE_PIPED_LOGS
 -D DYNAMIC_MODULE_LIMIT=128
 -D HTTPD_ROOT="/apps/gpp/usr"
 -D SUEXEC_BIN="/usr/sbin/suexec"
 -D DEFAULT_PIDLOG="/apps/gpp/var/run/httpd.pid"
 -D DEFAULT_SCOREBOARD="logs/apache_runtime_status"
 -D DEFAULT_LOCKFILE="/apps/gpp/var/run/accept.lock"
 -D DEFAULT_ERRORLOG="logs/error_log"
 -D AP_TYPES_CONFIG_FILE="/apps/gpp/etc/apache2/mime.types"
 -D SERVER_CONFIG_FILE="/apps/gpp/etc/apache2/httpd.conf"
Comment 6 Jeremy Olexa (darkside) (RETIRED) archtester gentoo-dev Security 2008-09-24 19:40:34 UTC
(In reply to comment #5)
> What is the state of baselayout for the Prefixed portage?  Can you point me in
> the right direction in this regard?

bug 196294
Comment 7 Quentin Conner 2008-09-25 21:36:21 UTC
Created attachment 166421 [details, diff]
Updated ebuild patch
Comment 8 Quentin Conner 2008-09-25 21:36:49 UTC
Created attachment 166422 [details, diff]
updated eclass patch
Comment 9 Quentin Conner 2008-09-25 21:37:38 UTC
Created attachment 166423 [details]
updated prefix patch for the files directory
Comment 10 Quentin Conner 2008-09-25 21:41:19 UTC
The install is cleaner now.  Fixed a autoconf bug present in the 2.2.9-r1 gentoo prefix patch.

Apache server binary still does not start.  Will look into bind() code next.

  (125)Address already in use: make_sock: could not bind to address [::]:80

Comment 11 Jeremy Olexa (darkside) (RETIRED) archtester gentoo-dev Security 2008-10-02 14:02:27 UTC
I made the appropriate changes to the apache-2.eclass file. However, it is important to know that we want to remain as similar as possible to the original. As such, we shouldn't be adding einfo's or ebeep's etc. I think you might want to look at lines 258-267 as well.
Comment 12 Jeremy Olexa (darkside) (RETIRED) archtester gentoo-dev Security 2008-10-02 14:03:52 UTC
(In reply to comment #10)
> The install is cleaner now.  Fixed a autoconf bug present in the 2.2.9-r1
> gentoo prefix patch.
> 
> Apache server binary still does not start.  Will look into bind() code next.
> 
>   (125)Address already in use: make_sock: could not bind to address [::]:80
> 

Can you bind to an unpriveleged port, eg 8080?
Comment 13 Quentin Conner 2008-10-02 21:14:06 UTC
It turns out that manually building this same apache package but to a different prefix does not exhibit the behavior.

When built with the ebuild prefix, at startup apache mistakenly trys to listen twice on the same TCP port.  This is due to finding two Modules's worth of configuration directives for the Listener configuration node in the ap_walk_config_sub() function when calling apr_hash_get().  

    ml = apr_hash_get(ap_config_hash, dir, APR_HASH_KEY_STRING);

Above, ml returns a linked list with two entries (two modules).  Both modules are the Listen so a duplication seems to be happening.

If I run "apache -X -L" to list the available configuration directive, the Listen module is listed twice.  Many other modules are also listed twice.

I suspect the configuration routines at startup are picking up
modules from another installation of apache (perhaps the one that comes bundled with Solaris).
Comment 14 Quentin Conner 2008-10-27 21:22:04 UTC
At startup, the apache binary contains multiple copies of mod_http and other (normally dynamically loaded) modules. 

Found that the autoconf-generated configure script will erroneously assign duplicate module names to BUILTIN_LIBS, MODULE_CLEANDIRS and MODULE_DIRS environment variables as seen in config.log.

This results in the module names going into modules.c more than once and thus they are listed multiple times at link time.
Comment 15 Quentin Conner 2008-10-28 18:58:22 UTC
It turned out the ebuild unpack step was causing the confusion for autoconf/configure.  Maybe the previous prefix patch predated the apache-2.eclass?

I will upload new ebuild and eclass patches for review.  I addressed suexec prefix paths as requested.

I'll be doing my testing on sparc64-solaris and x64-solaris architectures including testing Subversion 1.5.2 dav_svn and authz_svn modules.
Comment 16 Quentin Conner 2008-10-28 19:00:26 UTC
Created attachment 170138 [details, diff]
working patch for apache-2.2.9-r1.ebuild
Comment 17 Quentin Conner 2008-10-28 19:00:56 UTC
Created attachment 170140 [details, diff]
working patch for apache-2.eclass
Comment 18 Quentin Conner 2008-10-28 19:15:13 UTC
Created attachment 170141 [details, diff]
eclass patch relative to 20081028 rsync mirror
Comment 19 Quentin Conner 2008-10-28 19:15:37 UTC
Created attachment 170143 [details, diff]
ebuild patch relative to 20081028 rsync mirror
Comment 20 Jeremy Olexa (darkside) (RETIRED) archtester gentoo-dev Security 2008-10-29 14:00:33 UTC
(In reply to comment #17)
> Created an attachment (id=170140) [edit]
> working patch for apache-2.eclass
> 

Why do you suggest to do stuff like:

-		MY_CONF="${MY_CONF} --with-ssl="${EPREFIX}/usr" --enable-ssl=${mod_type}"
+		MY_CONF="${MY_CONF} --with-ssl=${EROOT}usr --enable-ssl=${mod_type}"

EPREFIX is proper here and EROOT is not. I already made changes to the apache-2 eclass to with regards to your last patch (see comment #11).
Comment 21 Quentin Conner 2008-10-29 20:35:44 UTC
Good point on EPREFIX vs. EROOT.  I missed that rule initially and appreciate the guidance.

I will update the patch attachments now based on 10.28 rsync mirror of portage.

Sniff testing on AMD64 and SPARC Solaris 10 looks good.  I did not text suexec.

Comment 22 Quentin Conner 2008-10-29 20:36:30 UTC
Created attachment 170253 [details, diff]
eclass patch relative to 20081028 rsync mirror
Comment 23 Quentin Conner 2008-10-29 20:37:01 UTC
Created attachment 170254 [details, diff]
ebuild patch relative to 20081028 rsync mirror
Comment 24 Quentin Conner 2008-10-29 21:03:18 UTC
Created attachment 170259 [details, diff]
ebuild patch relative to 20081028 rsync mirror
Comment 25 Quentin Conner 2008-10-29 21:06:34 UTC
Created attachment 170266 [details, diff]
ebuild patch relative to 20081028 rsync mirror
Comment 26 Jeremy Olexa (darkside) (RETIRED) archtester gentoo-dev Security 2008-10-31 15:39:19 UTC
(In reply to comment #22)
> Created an attachment (id=170253) [edit]
> eclass patch relative to 20081028 rsync mirror
> 

Still not perfect. Can I ask you to do two things:

point 1:
%% echo $EPREFIX
/home/jolexa/portage/linux-64

EPREFIX does not contain a trailing "/" so fix things like:
+       elog " SUEXEC_SAFEPATH: Default PATH for suexec (default: ${EPREFIX}usr/local/bin:${EPREFIX}usr/bin:${EPREFIX}bin)"

point 2:
You should quote ${EPREFIX} - Technically, you can have a space in it.
So,
+       --sysconfdir=${EPREFIX}etc/apache2 \
is wrong because of point 1 above and it should be "${EPREFIX}/etc/apache2" - notice the quotes.

Lastly, I suggest that you make the eclass changes and then recompile apache ;) You would have caught point 1 yourself.

thx
Comment 27 Quentin Conner 2008-11-06 18:56:48 UTC
Did you grab one of the obsoleted patch attachments?  The ebuilds succeed with attachments 166423 and 170253.

In any case I updated the eclass with EPREFIX quoted.  A Good Idea.

I am adding a patch for the depend.apache.eclass file.

I will upload ebuild, eclasses and fresh "latest" patches based on today's RSYNC.
Comment 28 Quentin Conner 2008-11-06 18:57:42 UTC
Created attachment 170931 [details, diff]
eclass/depend.apache.eclass patch
Comment 29 Quentin Conner 2008-11-06 18:58:27 UTC
Created attachment 170932 [details, diff]
app-admin/apache-tools/apache-tools-2.2.9.ebuild patch
Comment 30 Quentin Conner 2008-11-06 18:59:02 UTC
Created attachment 170934 [details, diff]
latest apache-2.eclass patch
Comment 31 Quentin Conner 2008-11-06 18:59:50 UTC
Created attachment 170935 [details, diff]
latest apache-2.2.9-r1 ebuild patch
Comment 32 Jeremy Olexa (darkside) (RETIRED) archtester gentoo-dev Security 2008-11-06 19:02:07 UTC
(In reply to comment #30)
> Created an attachment (id=170934) [edit]
> latest apache-2.eclass patch
> 

Good, nothing stands out at me right now. I will scrutinize more and test soon here. =)
Comment 33 Quentin Conner 2008-11-06 19:02:11 UTC
Created attachment 170937 [details]
apache-2.2.9-r1.ebuild
Comment 34 Quentin Conner 2008-11-06 19:02:24 UTC
Created attachment 170938 [details]
apache-2.eclass
Comment 35 Jeremy Olexa (darkside) (RETIRED) archtester gentoo-dev Security 2008-11-08 00:31:31 UTC
Alrighty, committed to the tree. I will lift the mask next week after I can test it. Thanks for your hard work and timely responses.
Comment 36 Jeremy Olexa (darkside) (RETIRED) archtester gentoo-dev Security 2008-11-10 15:55:48 UTC
Of course...The day after I commit this, we have apache 2.2.10 in the tree.

This is not good, in apache-2.eclass because it doesn't apply to 2.2.10 =/

apache-2_src_unpack() {
    unpack ${A}
    cd "${S}"

    pushd "${GENTOO_PATCHDIR}"
        epatch "${FILESDIR}"/${PN}-2.2.9-r1-prefix.patch
        eprefixify \
            conf/httpd.conf \
<snip>
Comment 37 Jeremy Olexa (darkside) (RETIRED) archtester gentoo-dev Security 2008-11-10 16:00:50 UTC
Additionally, 2.2.9-r1 compiles for me just fine. So, I will mask 2.2.10 and unmask 2.2.9. Please, if you desire, post a solution in a new bug for 2.2.10. Thanks.