Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 11007 - virtual/httpd
Summary: virtual/httpd
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All Linux
: High enhancement (vote)
Assignee: www-servers Herd (OBSOLETE)
URL:
Whiteboard:
Keywords:
: 3384 41942 119118 121163 121228 125574 127081 130723 140333 157040 (view as bug list)
Depends on: 18266
Blocks: 25578 30573 36173 36175 36177 96154 107512 110980 150596
  Show dependency tree
 
Reported: 2002-11-20 11:37 UTC by phoen][x
Modified: 2007-10-20 14:50 UTC (History)
19 users (show)

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


Attachments
depend.httpd.eclass (depend.httpd.eclass,3.44 KB, text/plain)
2006-07-03 16:07 UTC, Renat Lumpau (RETIRED)
Details
joomla-1.0.10-r1.ebuild (joomla-1.0.10-r1.ebuild,1.21 KB, text/plain)
2006-07-03 16:08 UTC, Renat Lumpau (RETIRED)
Details
virtual/httpd-fastcgi-0.ebuild (httpd-fastcgi-0.ebuild,527 bytes, text/plain)
2007-01-03 18:00 UTC, Renat Lumpau (RETIRED)
Details

Note You need to log in before you can comment on or make changes to this bug.
Description phoen][x 2002-11-20 11:37:13 UTC
Reporting this as promised:

virtual/httpd (or however you want to call it) would be very neat for a lot of
packages. In fact, virtuals like virtual/httpd-php would be useful either.

-phoen][x-
Comment 1 Donny Davies (RETIRED) gentoo-dev 2003-06-17 07:43:23 UTC
yes, its still a good idea ;-)  sooner or later!
Comment 2 Martin Holzer (RETIRED) gentoo-dev 2003-09-03 10:01:46 UTC
*** Bug 3384 has been marked as a duplicate of this bug. ***
Comment 3 Martin Holzer (RETIRED) gentoo-dev 2003-09-03 10:03:09 UTC
i've found in webapp-apache 
DEPEND="${DEPEND} net-www/apache"


how about rename this eclass or split it or update it with virtual/httpd
Comment 4 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2003-09-03 13:19:24 UTC
the webapp-apache eclass was commited the tree by one person but the rest of us never intended to fully use it, the change can be made as a stopgap measure, but in general we are doing the vhost-config and webapp-config tools first, as they will have new eclasses to go with them.
Comment 5 Stuart Herbert (RETIRED) gentoo-dev 2003-09-03 16:32:59 UTC
As the author of webapp-apache :) I'd just like to echo what Robin said.  
webapp-apache is a stop-gap, to allow me to fix bugs with existing packages.  We 
will be replacing it with a different solution very soon. 
 
Best regards, 
Stu 
 
Comment 6 Martin Holzer (RETIRED) gentoo-dev 2003-09-10 04:12:53 UTC
i don't want that is closed as wontfix.

there are many new ebuilds in bugzilla which provide a webserver.
i just want to provide "virtual/httpd" for every package which could run web-apps.
Comment 7 Stuart Herbert (RETIRED) gentoo-dev 2003-10-04 06:47:22 UTC
You're right - we need to go through all the web-server ebuilds and update
them to provide "virtual/httpd".

Stu
Comment 8 Martin Holzer (RETIRED) gentoo-dev 2003-11-02 07:43:02 UTC
how about this one ?
Comment 9 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2003-11-02 11:01:55 UTC
mholzer: we haven't forgotten about this.
webapp-config et al are still work in progress (after my exams)
Comment 10 Thomas Eckert 2003-12-21 09:06:50 UTC
Is it possible to install more than one package providing a virtual?
Background of the question: I feel that it should be possible to install more
than one httpd at a time and if a "virtual/httpd" blocked that it would be a bad
thing.

Anyway: if the "virtual/httpd"-modifications get real I'm willing to do that for
mini_httpd and the pending thttpds I submitted in bugs #36173, #36175, #36177.
Comment 11 Martin Holzer (RETIRED) gentoo-dev 2004-02-18 01:13:12 UTC
*** Bug 41942 has been marked as a duplicate of this bug. ***
Comment 12 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2004-08-14 15:39:58 UTC
virtual/httpd-php has been created.
Comment 13 Renat Lumpau (RETIRED) gentoo-dev 2005-06-29 08:53:56 UTC
reassigning
Comment 14 Thomas Seifert 2005-08-01 14:45:37 UTC
I'm also interested in that.
It would allow to install some apps without installing apache when using an
alternative webserver.
I've had a bug filed for awstats ( #96154 ,
https://bugs.gentoo.org/show_bug.cgi?id=96154 )which I can't install without
installing apache with it.
Is there any chance to get this implemented sooner (and not later ;)) ?
Comment 15 Jakub Moc (RETIRED) gentoo-dev 2006-01-15 13:04:19 UTC
So? People still keep complaining about hard-coded apache dependencies...
Comment 16 Jakub Moc (RETIRED) gentoo-dev 2006-01-15 14:17:35 UTC
*** Bug 119118 has been marked as a duplicate of this bug. ***
Comment 17 Renat Lumpau (RETIRED) gentoo-dev 2006-01-15 14:34:21 UTC
Stuart is taking the lead on this from the web-apps end of things. We'll start pushing for this soon.
Comment 18 Michael Stewart (vericgar) (RETIRED) gentoo-dev 2006-01-15 19:32:21 UTC
We need to have a discussion to figure out what exactly we want from the virtual. What would the packages that provide the virtual be required to provide? Not all HTTP servers are built equal, and most have vastly different configurations. I could see a virtual working for most webapps, but any that need a custom server configuration could get tricky. How many webapps would have to depend on apache directly because they need a .htaccess to work? I'm sure there are many other corner cases like that. Let's flesh this out to see what the virtual will really do.
Comment 19 Renat Lumpau (RETIRED) gentoo-dev 2006-01-15 20:29:00 UTC
(In reply to comment #18)
> We need to have a discussion to figure out what exactly we want from the
> virtual. What would the packages that provide the virtual be required to
> provide? Not all HTTP servers are built equal, and most have vastly different
> configurations. I could see a virtual working for most webapps, but any that
> need a custom server configuration could get tricky. How many webapps would
> have to depend on apache directly because they need a .htaccess to work? I'm
> sure there are many other corner cases like that. Let's flesh this out to see
> what the virtual will really do.

Certainly. I've started to put together a matrix of http servers and proposed virtuals: http://devwiki.gentoo.org/tiki-index.php?page=virtual%2Fhttpd

It will need to be fleshed out, but at least that's a start. We'll keep you and the www-servers herd in the loop.


Comment 20 Jakub Moc (RETIRED) gentoo-dev 2006-01-16 01:52:13 UTC
(In reply to comment #18)
> We need to have a discussion to figure out what exactly we want from the
> virtual. What would the packages that provide the virtual be required to
> provide? Not all HTTP servers are built equal, and most have vastly different
> configurations. 

Well, no need to depend on the new virtuals for packages that require a specific functionality, there you can still use something like 

|| ( net-www/apache www-servers/lighttpd )

or even depend on apache only, if needed.

As for configuration, I don't see that providing configuration for *all* servers  providing the virtuals to be within the scope of this bug (would be indeed impossible), it still users' responsibility mostly.

(In reply to comment #19)
> I've started to put together a matrix of http servers and proposed
> virtuals: http://devwiki.gentoo.org/tiki-index.php?page=virtual%2Fhttpd

Uhm, this is certainly too broad for start. :=) Meanwhile, a really simple "new-style" virtual/httpd including only apache and lighttpd would do the job for quite a couple of webapps in portage, I believe those two web servers are most widely used and tested anyway. You can keep adding others later. 
Comment 21 Jakub Moc (RETIRED) gentoo-dev 2006-02-01 04:52:02 UTC
*** Bug 121163 has been marked as a duplicate of this bug. ***
Comment 22 Florian Rivoal 2006-02-01 05:16:20 UTC
I was the one to issue the duplicate bug above :-/ I guess my search skills in bugzilla need some improvement.

Anyway, I agree that matrix of virtuals proposed on the wiki is probably the way to go. Just to clarify things, the suggested virtual/httpd-<language> (where language=python, perl, ...) would refer to webservers able to power web app written in <language> by other means than cgi or fcgi?

Maybe that's something already clear to everyone, but until not so long ago it was not to me, so I'd also like to point that the present virtual/httpd-php does NOT cause a websever to be there. It guaranties that a cgi capable php is around, but not that there is a web server to make it run. Or so I understand. Is that really what we want?
Comment 23 Jakub Moc (RETIRED) gentoo-dev 2006-02-01 14:29:27 UTC
*** Bug 121228 has been marked as a duplicate of this bug. ***
Comment 24 Stuart Herbert (RETIRED) gentoo-dev 2006-02-04 14:31:05 UTC
Mmm ... let's take a step back, and have another look at the problem?

The need behind virtual/httpd is to allow web-based apps to have something that can be used for (R)DEPEND.  In an ideal world, the dep could be reduced to something as simple as this:

RDEPEND="virtual/httpd virtual/httpd-<language>"

That's not going to work, unfortunately, for a number of reasons.

a) Portage doesn't support optional PROVIDEs.  F.ex, dev-lang/php needs to PROVIDE virtual/httpd-php ONLY if it has been built with USE=apache, USE=apache2, or USE=cgi.  The new virtual packages that are coming w/ Portage 2.1 don't solve this problem either, unless Portage 2.1 also supports USE-based deps.

b) Do packages for web-based apps need to know whether or not they are running under an Apache module (mod_php, mod_perl, mod_ruby) or under a CGI interpreter instead?  PHP packages don't need to know, but trac is an example of an app that does need to know, or at the very least could make use of that information.

c) All of this continues to overlook whatever the hell it is we need to do to support Java-based web apps, running in a servlet/JSP environment like tomcat, or a full-blown J2EE stack like JBoss.

I'm not sure that we can solve these problems using virtual/httpd, even with USE-based deps support.

I think the best we can do is to push the per-language support down into web-based apps (via a set of depend.<language>.eclass), and push each language's particular needs for a compatible webserver down into the ebuilds for that language.  In theory, that would allow us to do away with a virtual/httpd completely.

For example, a PHP-based web app's ebuild could look something like this:

    inherit depend.php
    RDEPEND="dev-lang/php"

    pkg_setup ()
    {
        php_provides_http || die "PHP was not installed for a web server"
    }

where php_provides_http does whatever checks are meaningful, and also outputs a suitibly verbose error message if those checks fail.

This example doesn't address the second problem - is the language setup to run as a CGI or as a webserver module.  That one is tough to solve; on a production box, it's perfectly possible for both cases to be true.  We also don't know *which* webserver is being used - and we need to know, otherwise webapp-config cannot install the files with the correct permissions.

webapp-config only needs to know about the setup for localhost; for all other hosts, the user has to run webapp-config by hand, so for now we can make that a special case that we expect the user to solve.  But how can we find out about which server is looking after localhost, and how the language is configured to run for localhost?

Best regards,
Stu

Comment 25 Jakub Moc (RETIRED) gentoo-dev 2006-03-10 00:54:52 UTC
*** Bug 125574 has been marked as a duplicate of this bug. ***
Comment 26 Jakub Moc (RETIRED) gentoo-dev 2006-03-21 06:30:26 UTC
*** Bug 127081 has been marked as a duplicate of this bug. ***
Comment 27 Jakub Moc (RETIRED) gentoo-dev 2006-04-21 06:11:28 UTC
*** Bug 130723 has been marked as a duplicate of this bug. ***
Comment 28 Renat Lumpau (RETIRED) gentoo-dev 2006-07-03 16:06:55 UTC
I'm attaching depend.httpd.eclass that attempts to provide a solution. Ebuilds can call the use_httpd function to depend on a fastcgi-capable webserver such as lighttpd instead of Apache. 

For example, "use_httpd fastcgi cgi" means that the web application can be run as a plain CGI or FastCGI. If Apache is installed, it will be used. If you don't want Apache and have another webserver installed (eg lighttpd), set USE="fastcgi" and the RDEPEND will be satisfied by lighttpd. If you want an even more basic webserver (eg fnord), emerge it and set USE="cgi". If no relevant USE flags are set, we assume the user knows best and nothing will get pulled in. If you don't want to be bothered by the new USE flags, just emerge Apache and leave it be.

An obvious caveat is that we can't be sure that the available httpd is emerged with the right USE flags. For now, I think it's fine to assume that the user will take care of that.

There are further comments in the attached eclass.

> We need to have a discussion to figure out what exactly we want from the
> virtual. What would the packages that provide the virtual be required to
> provide? Not all HTTP servers are built equal, and most have vastly different
> configurations.

As Jakub said, the ebuild should depend on Apache explicitly if Apache-specific functionality is required.

> As for configuration, I don't see that providing configuration for *all*
> servers  providing the virtuals to be within the scope of this bug (would be
> indeed impossible), it still users' responsibility mostly.

+1

> b) Do packages for web-based apps need to know whether or not they are running
> under an Apache module (mod_php, mod_perl, mod_ruby) or under a CGI
> interpreter instead?  PHP packages don't need to know, but trac is an example
> of an app that does need to know, or at the very least could make use of that
> information.

I think we should leave this up to the user to configure.

> c) All of this continues to overlook whatever the hell it is we need to do to
> support Java-based web apps, running in a servlet/JSP environment like tomcat,
> or a full-blown J2EE stack like JBoss.

True, but I don't think this is a show-stopper. AFAIK, there are no Java webapps in the tree atm. In any event, I have a feeling that Java webapps will be handled outside of webapp-config, probably building on existing projects such as Cargo [ http://cargo.codehaus.org/ ]

Comments? Do people think this is a reasonable way forward?
Comment 29 Renat Lumpau (RETIRED) gentoo-dev 2006-07-03 16:07:35 UTC
Created attachment 90815 [details]
depend.httpd.eclass
Comment 30 Renat Lumpau (RETIRED) gentoo-dev 2006-07-03 16:08:07 UTC
Created attachment 90816 [details]
joomla-1.0.10-r1.ebuild

Sample ebuild using the new eclass.
Comment 31 Renat Lumpau (RETIRED) gentoo-dev 2006-07-03 16:24:46 UTC
CHTEKK pointed out that php does not have a fastcgi USE flag, so the test ebuild is incorrect in that aspect (I swear I saw it last night...) 

The point I was trying to make is that the ebuild can perform cgi- / fastcgi-specific checks if necessary.
Comment 32 Luca Longinotti (RETIRED) gentoo-dev 2006-07-03 16:32:24 UTC
Looks all good to me. :)
Best regards, CHTEKK.
Comment 33 Jakub Moc (RETIRED) gentoo-dev 2006-07-14 03:39:40 UTC
*** Bug 140333 has been marked as a duplicate of this bug. ***
Comment 34 Jakub Moc (RETIRED) gentoo-dev 2006-08-11 04:36:03 UTC
*** Bug 143530 has been marked as a duplicate of this bug. ***
Comment 35 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2006-11-14 03:38:49 UTC
web-apps/www-servers:
can somebody propose this eclass on -dev so that we can get it into the tree finally?
Comment 36 Stuart Herbert (RETIRED) gentoo-dev 2006-11-14 03:47:55 UTC
God no.  Please please _please_ don't do that.  The live tree is not the place to be experimenting with something like this.  Let's not create another webapp-apache!

Create a branch in the webapps overlay on o.g.o, import the ebuilds from Portage, port them to use this eclass, and test them (all packages will need testing with all compatible web servers)  When we've done that, _then_ we'll have a good idea whether or not this is really sustainable.

Tbh, I'd also be much happier about this virtual if all compatible webservers installed themselves to run under a generic 'www' user instead, before we start providing virtual/httpd.

Best regards,
Stu
Comment 37 Michael Stewart (vericgar) (RETIRED) gentoo-dev 2006-11-14 18:37:40 UTC
Finally got around to looking at the eclass myself. It needs to be refactored, as it breaks the cache. You can't conditionally change RDEPEND based on USE flags, as the USE-flags on the cache-generating server will not be the same as the ones on the user's system. You have to put the USE-flag in the RDEPEND directly.
Comment 38 Jakub Moc (RETIRED) gentoo-dev 2006-12-04 03:09:09 UTC
*** Bug 157040 has been marked as a duplicate of this bug. ***
Comment 39 Renat Lumpau (RETIRED) gentoo-dev 2007-01-03 18:00:53 UTC
Created attachment 105342 [details]
virtual/httpd-fastcgi-0.ebuild

Nevermind the eclass then. Why can't we just use new-style virtuals for this? I've attached virtual/httpd-fastcgi, and we could also have virtual/httpd-cgi and virtual/httpd-basic.

Each will pull in Apache by default, but will use whatever webserver (such as lighttpd) that is installed locally if it is sufficiently capable.

Thoughts?
Comment 40 Renat Lumpau (RETIRED) gentoo-dev 2007-01-25 21:14:13 UTC
phreak`` has added the three virtuals to the apache overlay: 

http://overlays.gentoo.org/proj/apache/browser/testing/virtual

The Apache team (CHTEKK, kloeri, phreak``) have signed off on this.
Comment 41 Peter Weller (RETIRED) gentoo-dev 2007-01-26 20:21:15 UTC
This is all OK with me.
Comment 42 Renat Lumpau (RETIRED) gentoo-dev 2007-01-26 21:44:50 UTC
Added virtuals to the webapps overlay: http://overlays.gentoo.org/proj/webapps/browser/experimental/virtual

I also added www-apps/otrs and www-apps/rt that utilize virtual/httpd-fastcgi
Comment 43 Renat Lumpau (RETIRED) gentoo-dev 2007-03-01 01:42:05 UTC
since it's been a month with no objections, i'm planning to add the three virtual to the tree. speak up now
Comment 44 Jakub Moc (RETIRED) gentoo-dev 2007-10-08 12:44:00 UTC
Well, ping! I've switched the whole webapps overlay to use these virtuals, and it's *lot* better than the current situation, so - can we just finally get this in?
Comment 45 Gunnar Wrobel (RETIRED) gentoo-dev 2007-10-20 14:50:41 UTC
Finally in portage. Thanks to Renat for providing these and to Jakub testing and nagging me about it.