[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: httpd virtual package



Anatoly A. Kazantsev wrote:
> P.S: I'm not on the list, please keep me CCed

Will do.

> I'm trying to install owncloud with lighttpd on stable release

Noting that Stable is Jessie 8 at this time.

> Depends: apache2 | httpd, fonts-font-awesome, fonts-liberation,

Either apache2 or httpd will be needed to satisfy the Depends
relationship.  If neither is installed then apt will pull in apache2
since it is listed first.

> It says the package is depends on apache2 or httpd. So as I think it should
> allow me to install it without installing apache2 package if some installed
> package provides httpd (such as lighttpd or nginx).

Yes.  If you already have either lighttpd or nginx installed then
httpd will be povided for already.  However the entire dependency tree
must be analyzed to understand what is happening.

> $ sudo aptitude install owncloud
> Reading package lists...
> Building dependency tree...
> Reading state information...
> Reading extended state information...
> Initializing package states...
> Reading task descriptions...
> Building tag database...
> The following NEW packages will be installed:
>   apache2{a} apache2-bin{a} apache2-data{a} apache2-utils{a} 
>   fonts-font-awesome{a} fonts-liberation{a} fonts-linuxlibertine{a} 
> ...
> 
> it wants to install apache web-server

I debootstrapped a Jessie chroot in order to test your case.

  debootstrap jessie jessie-oc-test http://httpredir.debian.org/debian
  chroot ./jessie-oc-test su -

The first test confirms your problem.  It wants to install apache2.
It can be explicitly avoided with a minus at the end.  This works.  It
is a little unsatisfying needing to manually force it this way but it
does allow installing owncloud on Jessie without installing apache2.

  apt-get install owncloud apache2-

But this is less than optimal since it wants to install php5-cgi in
this case.

Could it be a recommends in one of the packages?

  apt-get install --no-install-recommends owncloud
  ...still wants apache2...

It isn't a recommends.  It must be one of the 112 packages in the
dependency chain.  When dependency chains are that large it is often a
problem for the dependency resolver to do a good job of things.
Something depends upon something else in an alternation which depends
upon another list of alternate things.  The problem space is just too
big and arbitrary for apt to know about it.

In order to look at them all I generated a list of all of the packages
that it wants to install.

  apt-get install --no-install-recommends -s owncloud | awk '/^Inst/{print$2}' > /tmp/pkglist

I really only care about packages that mention apache2 anywhere in the
headers.  Reduce to that set.

  for i in $(cat /tmp/pkglist); do apt-cache show $i | grep -q apache2 && echo $i;done
  apache2-bin
  apache2-utils
  apache2-data
  apache2
  libapache2-mod-php5
  php5
  owncloud

Aha!  The chain must be through libapache2-mod-php5.  owncloud depends
upon php5, which depends upon libapache2-mod-php5 | php5-fpm (along
with other OR things).  Let's test that theory and install php5-fpm
first.  Along with nginx.

  apt-get install --no-install-recommends nginx php5-fpm

Then try owncloud.

  apt-get install owncloud

Aha!  That works.  It does not want to install apache2 in this case.

And knowing this I then try it all over again with php5-fpm specified.

  apt-get install php5-fpm nginx owncloud

Yes!  That does not want to install apache2.  The dependency chain
pulling in apache2 was through php5 which wanted an interpreter.

  $ apt-cache show php5 | grep Depends
  Depends: libapache2-mod-php5 (>= 5.6.7+dfsg-1~) | libapache2-mod-php5filter (>= 5.6.7+dfsg-1~) | php5-cgi (>= 5.6.7+dfsg-1~) | php5-fpm (>= 5.6.7+dfsg-1~), php5-common (>= 5.6.7+dfsg-1~)

Supplying the php5 interpreter through php5-fpm satisfied that
dependency and avoided it selecting libapache2-mod-php5 which
must hard depend upon apache2.

> I checked it on current testing with installed lighttpd - it works
> as expected, no apache2 packages

I looked in Testing and the dependency chain looks the same there.
But perhaps on that system you already had installed a php5
interpreter?  If so that would have avoided the libapache2-mod-php5
path and make it appear to work okay.  (Which is why we like to debug
in pristine installation root such as through debootstrapped chroots.)

The summary is this:

  apt-get install php5-fpm nginx owncloud

You will still need to configure either nginx or lighttpd to handle
PHP through the fpm or other.  There isn't any automatic configuration
for it.  But it will be a superior solution to libapache2-mod-php5
which is easy and automated but not as efficient.

Hope that helped!

Bob


Reply to: