add option to change the restart command in apache exports
[freeside.git] / FS / FS / part_export / apache.pm
1 package FS::part_export::apache;
2
3 use vars qw(@ISA %info);
4 use Tie::IxHash;
5 use FS::part_export::null;
6
7 @ISA = qw(FS::part_export::null);
8
9 tie my %options, 'Tie::IxHash',
10   'user'       => { label=>'Remote username', default=>'root' },
11   'httpd_conf' => { label=>'httpd.conf snippet location',
12                     default=>'/etc/apache/httpd-freeside.conf', },
13   'restart'    => { label=>'Apache restart command',
14                     default=>'apachectl graceful',
15                   },
16   'template'   => {
17     label   => 'Template',
18     type    => 'textarea',
19     default => <<'END',
20 <VirtualHost $domain> #generic
21 #<VirtualHost ip.addr> #preferred, http://httpd.apache.org/docs/dns-caveats.html
22 DocumentRoot /var/www/$zone
23 ServerName $zone
24 ServerAlias *.$zone
25 #BandWidthModule On
26 #LargeFileLimit 4096 12288
27 </VirtualHost>
28
29 END
30   },
31 ;
32
33 %info = (
34   'svc'     => 'svc_www',
35   'desc'    => 'Export an Apache httpd.conf file snippet.',
36   'options' => \%options,
37   'notes'   => <<'END'
38 Batch export of an httpd.conf snippet from a template.  Typically used with
39 something like <code>Include /etc/apache/httpd-freeside.conf</code> in
40 httpd.conf.  <a href="http://search.cpan.org/dist/File-Rsync">File::Rsync</a>
41 must be installed.  Run bin/apache.export to export the files.
42 END
43 );
44
45 1;
46