Webserver ports

Ryan Schmidt ryandesign at macports.org
Thu Feb 12 02:29:41 PST 2009


I think our web server ports are a bit of a mess. We have apache,  
apache2, apache20 and lighttpd, that I know of. They each have their  
default htdocs and cgi-bin directories in different places:

apache: ${prefix}/var/www/data/data (weird), ${prefix}/var/www/cgi-bin
apache +apache_layout: ${prefix}/apache/htdocs, ${prefix}/apache/cgi-bin
apache2: ${prefix}/apache2/htdocs, ${prefix}/apache2/cgi-bin
apache20: ${prefix}/apache20/htdocs, ${prefix}/apache20/cgi-bin
lighttpd: /srv/www/htdocs (very weird), no cgi-bin directory defined

Or perhaps you want to use Apple's web server:
/Library/WebServer/Documents, /Library/WebServer/CGI-Executables

So what if you want to write a port that needs to install HTML and/or  
CGI files that need to be served by a web server but you don't care  
which one? You have to write variants for each of the above  
possibilities, then the user has to remember to select the right  
variant, and if you ever want to try a different web server, you have  
to reinstall all your web app ports.

We have several ports that install into either subdirectories of or  
directly into ${prefix}/www, such as bugzilla, viewcvs, awstats,  
gallery, htdig, mediawiki, phpbb, phpmyadmin, squirrelmail and  
wordpress.

I propose:

* All web server ports should come with config files set to serve  
files from the document root ${prefix}/www/htdocs and CGIs from $ 
{prefix}/www/cgi-bin
* There should be a meta port called "webserver" which has variants  
for each of the four web servers mentioned above, defaulting to the  
most popular, apache2
* There should be a portgroup called "webapp" which sets up common  
webapp tasks, like having no configure or build phases, depending on  
port:webserver, and offering a variant "apple_webserver" to change  
the install location from a MacPorts web server to the Apple one  
(what do you think about this variant idea?)
* All web app ports can be changed to use the "webapp" portgroup and  
can remove any variants they have for fiddling with install location  
or web server dependencies

Also:

* The "webserver" port can install a pretty MacPorts default  
index.html page, like the default "It works!" page Apache provides,  
but tailored to MacPorts




More information about the macports-dev mailing list