Webserver ports

Bradley Giesbrecht brad at pixilla.com
Thu Feb 12 07:29:56 PST 2009


On Feb 12, 2009, at 2:29 AM, Ryan Schmidt wrote:

> 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

I thought /opt/local/apache2 was strange compared to where the  
majority of other ports park stuff.

After dependancy management I think the big advantages of an excellent  
software manager (port) is the logical and consistent layout and nice  
config files to get you started.

I could use some guidance regarding logging.

/var/log is outside prefix but I don't see Apple removing it. The  
postfix port appears to log to /var/log/mail unless I somehow mucked  
the install which is possible.

Though /var/log is outside /opt/local is this an acceptable target for  
logs?

Oh, and what if changes need to be made to /etc/sysctl.conf?
I don't know that macosx 10.5 reads /etc/sysctl.conf anymore but the  
idea is still there.
Oh, after looking I guess it does.

What if you need to change kern.maxfilesperproc?

It wasn't my intention but it looks like I strayed from the subject:)


//Brad


More information about the macports-dev mailing list