[rt-users] installing Apache::Test impossible as root

Phil R Lawrence prlawrence at Lehigh.EDU
Thu Sep 4 09:23:58 EDT 2003


I had written:
> I can't get Apache::Test to install.  It says "no test server 
> configured", but I can lynx localhost, and get:
>            Hey, it worked !
>            The SSL/TLS-aware Apache webserver was
>            successfully installed on this website.
> 
> I tried passing the httpd location like so:
> # HTTPD=/usr/local/apache/1.3.28/ssl/bin/ perl -MCPAN
>    -e'install Apache::Test'

I had no luck with this line of thinking, so I ended up doing this:
# export PATH="/usr/local/apache/1.3.28/ssl/bin:$PATH"

That worked.

Now a permissions problem comes up.  I found this thread at:
  http://www.mail-archive.com/modperl@apache.org/msg35872.html

<email>
installing Apache::Test via CPAN impossible as root

    * From: Udo Rader
    * Subject: installing Apache::Test via CPAN impossible as root
    * Date: Tue, 26 Aug 2003 12:58:20 +0000 

hi all,

I'm trying to setup Apache::Test with our apaches and have run into major 
troubles.

CPAN refuses to install the mod without force, because all tests completely 
fail. t/logs/error_log then contained error messages like these:

-----error_log------
[...]
[Tue Aug 26 14:23:47 2003] [error] [client 127.0.0.1] (13)Permission denied: 
access to /index.html failed because search permissions are missing on a 
component of the path 
[...]
-----error_log------

never saw such an apache error message ... ? search permissions are 
missing ? what kind of stuff is that?

But a google search quickly pointed me to the source of the problem:
In a default linux & perl installation Apache::Test is very unlikely
to be installable by root (http://dbforums.com/t859484.html).

I tried to make && make test the package as a "normal" user and I succeded.
Depending on my security settings this is however just luck:

If the above posting on dbforums is correct, then the problem is because
the unpacking and building is done by user root whereas all files below t/
are chowned to the actual apache test user.

Now this works fine as long as the _apache test user_ is allowed to access
root's .cpan build area at all, and I doubt that on most systems a normal
user (such as the apache test user) will be allowed to access anything
within ~root and thus "make test" will fail.

Are there arguments against running those tests as root?

for the record:
get this for apache 1.3.28 and mp1.28 as well as with apache 2.0.47 and 
mp1.99_09.

udo
</email>

This was the conclusion of the thread, found at:
  http://www.mail-archive.com/modperl@apache.org/msg35880.html
<email>
Re: installing Apache::Test via CPAN impossible as root

    * From: Stas Bekman
    * Subject: Re: installing Apache::Test via CPAN impossible as root
    * Date: Tue, 26 Aug 2003 18:43:19 +0000 

<snip/>

Thanks Nathan,

We have discussed this idea at the dev list, and will probably resort to it if no better solution is found. I didn't mention it on purpose in hope to get some new, better ideas.

The problem with copy and cleanup to a temp dir is that some project may have a pretty big t/ directory (mp2's one is almost 2MB and growing), so copying is going to be quite slow. Another problem is the cleanup, which may not always work very well.

Moreover, let's say that you run under 'root'. Most likely File::Temp/File::Spec::tmpdir will return /root/tmp as the temp dir, so it solves nothing. What we really want is an equivalent of /tmp.

What we could do is prompt root for two inputs: a username of a real user (e.g. 'stas' on my machine) and a dir where 'stas' can write to (e.g. /home/stas/tmp) and then copy the files there and use that username to run the test with.

In my original reply the best advise so far to avoid this problem is to configure your .cpan dir to be under /tmp in which case running tests as root is not a problem. However /tmp is often setup to be cleaned up on reboot, so you may want to configure only 'build_dir' to be on that filesystem, e.g.:

#~/.cpan/CPAN/MyConfig.pm
#------------------------
$CPAN::Config = {
 'cpan_home' => q[/root/.cpan],
 'build_dir' => q[/tmp/.cpan/build],
  ...
};


__________________________________________________________________
Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com
</email>





More information about the rt-users mailing list