Bug 140380 - [patch] www/apache22: Add support for inclusion of profile_* directive
Summary: [patch] www/apache22: Add support for inclusion of profile_* directive
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: freebsd-apache (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-11-08 03:30 UTC by Jarrod Sayers
Modified: 2009-12-10 08:20 UTC (History)
0 users

See Also:


Attachments
www-apache22-apache22_profile_directives.diff (2.13 KB, patch)
2009-11-08 03:30 UTC, Jarrod Sayers
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jarrod Sayers 2009-11-08 03:30:01 UTC
The www/apache22 port has support for multiple profiles which are controlled from
a single rc.d script.  However, in some instances multiple profiles share a common
base configuration or only differ by a few directives.  This patch adds support
for a new rc.conf flag, apache22_profile_directives, which when set adds an
additional directive to the command line specifying the name of the profile itself.

Consider the following example:

apache22_enable="YES"
apache22_profiles="httpd mail"
apache22_httpd_configfile="/usr/local/etc/apache22/httpd.manhattan.conf"
apache22_mail_configfile="/usr/local/etc/apache22/httpd.mail.conf"

The two configuration files only differ in a few places that define the Listen
address and ServerName, plus a Directory directive or two.  Due to the small
number of differences, these files could be collapsed in to one which
simplifies global level changes.

Consider the following modified example:

<IfDefine profile_httpd>
  Listen manhattan.downtools.com.au:80
  ServerName manhattan.downtools.com.au
  DocumentRoot /home/htdocs/default/data
</IfDefine>
<IfDefine profile_mail>
  Listen mail.downtools.com.au:443
  ServerName mail.downtools.com.au
  DocumentRoot /home/htdocs/mail/data
</IfDefine>

...

<IfDefine profile_mail>
  <Directory /usr/local/www/roundcube>
    ...
    SSLRequireSSL
  </Directory>
</IfDefine>

By collapsing the minor differences, both profiles can still be controlled
individually via the rc.d script as a -Dprofile_${profile} flag will be added
to the command line for each.  This results in a slightly simplified rc.conf
configuration and less duplication.

apache22_enable="YES"
apache22_profiles="httpd mail"
apache22_profile_directives="YES"
apache22_httpd_configfile="/usr/local/etc/apache22/httpd.manhattan.conf"
apache22_mail_configfile="${apache22_httpd_configfile}"
Comment 1 Edwin Groothuis freebsd_committer freebsd_triage 2009-11-08 03:30:13 UTC
Responsible Changed
From-To: freebsd-ports-bugs->apache

Over to maintainer (via the GNATS Auto Assign Tool)
Comment 2 pgollucci 2009-12-10 08:00:20 UTC
You don't need this patch.

The follow works --

# httpd
apache22_enable="YES"
apache22_profiles="www ssl"
apache22_http_accept_enable="YES"

apache22_www_flags="-DPYTHON -DMP2 -DSVN -DPHP5"
apache22_www_configfile="/usr/local/etc/apache22/httpd.conf"

apache22_ssl_flags="-DSSL -DSVN -DPYTHON"
apache22_ssl_configfile="/usr/local/etc/apache22/httpd.conf"

-- 
------------------------------------------------------------------------
Philip M. Gollucci (pgollucci@ridecharge.com)
p: 703.549.2050x206, did: 703.579.6947
Senior System Admin - RideCharge, Inc.  http://ridecharge.com
1024D/DB9B8C1C B90B FBC3 A3A1 C71A 8E70  3F8C 75B8 8FFB DB9B 8C1C

Work like you don't need the money,
love like you'll never get hurt,
and dance like nobody's watching.
Comment 3 Philip M. Gollucci freebsd_committer freebsd_triage 2009-12-10 08:00:35 UTC
State Changed
From-To: open->closed

invalid