Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 55803 - apache update should not overwrite / replace /var/www/localhost/htdocs files if existing
Summary: apache update should not overwrite / replace /var/www/localhost/htdocs files ...
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Server (show other bugs)
Hardware: All All
: High normal (vote)
Assignee: Apache Team - Bugzilla Reports
: 67622 (view as bug list)
Depends on:
Reported: 2004-07-01 09:07 UTC by Tobias Sager
Modified: 2005-04-23 20:07 UTC (History)
0 users

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

apache-disabledocs.patch (apache-disabledocs.patch,1.69 KB, patch)
2004-10-25 07:02 UTC, Tobias Sager
Details | Diff
apache-disabledocs-nouse.patch (apache-disabledocs-nouse.patch,843 bytes, patch)
2004-12-24 04:04 UTC, Tobias Sager
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Tobias Sager 2004-07-01 09:07:11 UTC
Every time when updating apache2, it puts the default apache sample files in /var/www/localhost/htdocs.

This should not happen if there exist files in that directory.
Comment 1 Chuck Short (RETIRED) gentoo-dev 2004-07-01 20:36:56 UTC
Add the directory to your config_protect in your /etc/make.conf
Comment 2 Tobias Sager 2004-09-18 08:06:48 UTC
I now realize that my question was unclear (even to me)..

What I am looking for is a way to tell portage to not write any files to a certain directory (/var/www/localhost/htdocs in this example).
CONFIG_PROTECT only protects from _over_writing, but not from writing new files.
Does anybody know a way how to do that or should I file a new portage-feature-request?
Comment 3 Jason Stubbs (RETIRED) gentoo-dev 2004-10-15 00:17:17 UTC
*** Bug 67622 has been marked as a duplicate of this bug. ***
Comment 4 Jason Stubbs (RETIRED) gentoo-dev 2004-10-15 00:17:47 UTC
Would a local USE flag be possible for this?
Comment 5 Tobias Sager 2004-10-22 00:47:36 UTC
This solves the problem and works for me:

use nohtdocs && einfo "Disabling install of htdocs." && sed -i 's/install-htdocs\ //'
use noicons && einfo "Disabling install of icons." && sed -i 's/install-icons\ //'
use noerror && einfo "Disabling install of error messages." && sed -i 's/install-error\ //'
use nocgi && einfo "Disabling install of cgi-scripts." && sed -i 's/install-cgi\ //'
Comment 6 Michael Tindal (RETIRED) gentoo-dev 2004-10-22 01:56:15 UTC
Except no* USE flags are frowned upon.  This is a better solution, and solves the problem without requiring adding more USE flags:

    if [ ! -d /var/www/localhost/ ]; then
        ... install localhost stuff ...

Other Apache Herd people, comments?
Comment 7 Michael Tindal (RETIRED) gentoo-dev 2004-10-22 01:57:33 UTC
Also, we could define local USE flags like apache-htdocs, apache-icons, etc, although i think overcomplicates the situation some.
Comment 8 Tobias Sager 2004-10-22 03:58:51 UTC
The check for the existing directory would be what the Makefile itself would do.
It wouldn't write any of the provided docs/icons/errormessages if those dirs already exist. 

I just would prefer my solution because I then could install the error docs and icons, but not the cgi or htdocs..
Comment 9 Tobias Sager 2004-10-25 07:02:36 UTC
Created attachment 42560 [details, diff]

What about something like the attached patch?
Please comment and correct.
Comment 10 Tobias Sager 2004-11-10 01:14:51 UTC
I would apprechiate any feedback or proposed solution.
Comment 11 Tobias Sager 2004-12-24 04:04:54 UTC
Created attachment 46776 [details, diff]

Alternative patch. Will disable install of documents if datadirs exist.
No possibility to override with use flags.

Does nobody see the need for this functionality?? It's quite important for me.
Comment 12 Chuck Short (RETIRED) gentoo-dev 2004-12-24 05:48:39 UTC
No, I dont like the idea of adding more useflags
Comment 13 Tobias Sager 2004-12-25 06:03:30 UTC
Chuck, have a look at the second patch. I am not pleading for more useflags.

I just want to make clear that I really think this is a major flaw during
an upgrade of apache. It should not write into my htdocs directory!
Comment 14 Stuart Herbert (RETIRED) gentoo-dev 2004-12-27 12:16:52 UTC
When we refresh the Apache packages on 8th Jan, we'll be introducing some changes which (fingers crossed) will fix this one.

Best regards,
Comment 15 Benedikt Böhm (RETIRED) gentoo-dev 2005-01-28 09:56:22 UTC
gentoo-webroot-default is in portage and used by currently hard-masked apache 1.3.33-r1 and 2.0.52-r3

please unmask and test

Comment 16 Tobias Sager 2005-01-30 04:38:04 UTC
Ok. Tried it.
It solves this bug here, that's correct. Some issues with the new layout/ebuilds:
- gentoo-apache-2.0.52-r3.tar.bz2 has wrong MD5 sum
- the new apache starts ok, but segfaults if a client connects
  ([Sun Jan 30 11:53:07 2005] [notice] child pid 19402 exit signal Segmentation fault (11))

Should I file separate bugs for these?
Comment 17 Benedikt Böhm (RETIRED) gentoo-dev 2005-01-30 05:02:22 UTC
the gentoo-webroot tarballs change without revision bumps as long as they are hard masked, so you need to refetch this tarball

please open a seperate bug for the children segfaulting
Comment 18 Elfyn McBratney (beu) (RETIRED) gentoo-dev 2005-04-23 20:07:27 UTC
No response, closing.