VirtualHost handling in apache2 Port

Rodney Rehm / Medialize.de rodney.rehm at medialize.de
Thu Mar 25 12:31:26 PDT 2010


Hi,

Am 25.03.2010 um 18:38 schrieb Scott Haneda:

> On Mar 25, 2010, at 8:44 AM, Rodney Rehm / Medialize.de wrote:
> 
>> It would be nice if `port install phpmyadmin +apache2vhost` would
>> 1) add a dependency to apache2
> 
> It depends on php, which depends on apache, which I believe is an indirect dependency isn't it?

Not necessarily. There are php5 variants that do not depend on apache2.
But I haven't actually thought about the impact php5+no_web could have on phpmyadmin.

>> 2) create a vhost for phpmyadmin using a (pre-configured) domain scheme (e.g. "${portname}.dev" or "${portname}.localhost")
> 
> I do this manually now, but having it already set up for me would be nice.  Paths and such may become complicated to deal with.  Apache2 has a trac note to work on the layout of it, I would suggest that at the time that ticket gets some work, that this discussion be branched or brought into the main discussion.  It seems an appropriate time and place for it to happen.

This whole thing doesn't have to be done by tomorrow. I just wanted to kick the idea so it might _eventually_:)

>> 3) register "${portname}.dev" for localhost in /etc/hosts
> 
> Count me out of this suggestion.  You could include a note, will a command of echo "hostname 1.2.3.4 >> /etc/hosts" but that is about as far as I would ever want that to go.

I counted on resistance regarding this step. I wasn't sure if I should propose this at all.
I could live with an info like the "StartupItem has been created, to go have some fun do port load ..".

>> The apache2 port would have to be extended by a vhosts variant, that would create ${prefix}/apache2/vhosts and patch httpd.conf to use vhosts and include them from ${prefix}/apache2/vhosts/*.conf - then all other Ports would have a central space for putting their virtual hosts. If you're concerned about security, you can have the ports create their vhosts disabled by default (*.conf.disabled).
> 
> This is exactly where I stuff things now. I enable the .conf include in httpd.conf to the vhosts directory.  Anything I drop in there that ends in .conf becomes something I can work with.

Our gentoo servers (actually portage) have been doing this for years, I just inherited their concept. And it has made my vhost mess a lot easier to manage.

> I probably would lean on leaving them out of the directory and keeping them in with the other "samples" and also follow that convention.  Meaning, the name of the file would be *.conf.sample

I can live with that just fine.

>> Is this something worth considering to you, or should I go play in my own backyard again?
> 
> I like the idea of having the conf files included. At the same time, phpmyadmin has become so dead simple to install, I often wonder if we are not adding confusion by even having a port for it.  As it is now, installation outside of ports is as simple as download, unpack, move to a http accessible location, edit and rename conf file to add a secret hash, load the url.

I just took phpmyadmin as an example.
What about automated updates? I don't check and update secondary stuff like PMA or PGA. 
If I want to setup a new dev-machine, i want to install MacPorts and let one simple shell script do the rest.
I added lots of small libraries to my local Portfile repository. That way I keep multiple machines on the same updated level without doing anything manually. That's the way software management is supposed to work (for me).

> Those that want it connected to a certain host, like for me, I use http://phpma, seems like since /etc/hosts needs editing, or adding with `dscl`, it seems a bit too outside of the areas MacPorts generally is specified to work in.

I hear you.

> 
> Again, I would probably try to get involved at about the time this ticket starts to see momentum:
> http://trac.macports.org/ticket/21315

Fine with me.

Best Regards,
Rod


More information about the macports-dev mailing list