merging vpopmail support branch
[freeside.git] / httemplate / docs / config.html
1 <head>
2   <title>Configuration files</title>
3 </head>
4 <body>
5   <h1>Configuration files</h1>
6 <ul>
7   <li>Create the <b>/usr/local/etc/freeside</b> directory to hold your configuration.
8   <li>Setting up <a href="http://www.apache.org/docs/misc/FAQ.html#user-authentication">Apache user authetication</a> is mandatory.
9   <li>Create the <b>/usr/local/etc/freeside/mapsecrets</b> file, which maps Apache users to a secrets file which contains a DBI data source, username and password.  Every
10 line in <b>/usr/local/etc/freeside/mapsecrets</b> should contain a username and
11 filename, separated by whitespace.  Note that these are not local usernames -
12 they are passed from Apache.  <a href="http://www.apache.org/docs/misc/FAQ.html#user-authentication">
13 Apache user authetication</a> is mandatory.  For example, if you had the Apache users admin,
14 john, and sam,  
15 you mapsecrets file might look like:
16 <pre>
17 admin secretfile
18 john secretfile
19 sam secretfile
20 </pre>
21   <li>Next, the filename(s) referenced in <b>/usr/local/etc/freeside/mapsecrets</b> file should be created in the <b>/usr/local/etc/freeside/</b> directory.  Each file contains three lines: <a href="http://search.cpan.org/doc/TIMB/DBI-1.15/DBI.pm">DBI data source</a> (for example,
22   <tt>DBI:mysql:freeside</tt> or <tt>DBI:Pg:host=localhost;dbname=freeside</tt>), database username, and database password.
23   These files should not be world readable.  See the <a href="http://search.cpan.org/doc/TIMB/DBI-1.15/DBI.pm">DBI manpage</a> and the <a href="http://search.cpan.org/search?mode=module&query=DBD">manpage for your DBD</a> for the exact syntax of a DBI data source.  In a normal installation such as the example above, a single file <b>/usr/local/etc/freeside/secretfile</b> would be created - for example:
24 <pre>
25 DBI:Pg:host=localhost;dbname=freeside
26 dbusername
27 dbpassword
28 </pre>
29 </ul>
30 All further configuration files and directories are located in
31 <tt>/usr/local/etc/freeside/conf.<i>datasource</i></tt>, for example, 
32 <tt>/usr/local/etc/freeside/conf.DBI:Pg:host=localhost;dbname=freeside</tt> (remember to backslash-escape the ; character when creating directories in the shell: <tt>mkdir&nbsp;/usr/local/etc/freeside/conf.DBI:Pg:host=localhost\;dbname=freeside</tt>).
33 <ul>
34   <li><a name="address">address</a> - This configuration file is no longer used.  See <a href="#invoice_template">invoice_template</a> instead.
35   <li><a name="apacheroot">apacheroot</a> - The directory containing Apache virtual hosts
36   <li><a name="apachemachine">apachemachine</a> - A machine with the apacheroot directory and user home directories.  The existance of this file enables setup of virtual host directories, and, in conjunction with the `home' configuration file, symlinks into user home directories.
37   <li><a name="apachemachines">apachemachines</a> - Your Apache machines, one per line.  This enables export of `/etc/apache/vhosts.conf', which can be included in your Apache configuration via the <a href="http://www.apache.org/docs/mod/core.html#include">Include</a> directive.
38   <li><a name="autocapnames">autocapnames</a> - The presence of this file will cause Freeside to use Javascript in /htdocs/edit/cust_main.cgi to automatically capitalize the first and last names of customers.
39   <li><a name="bindprimary">bindprimary</a> - Your BIND primary nameserver.  This enables export of /var/named/named.conf and zone files into /var/named
40   <li><a name="bindsecondaries">bindsecondaries</a> - Your BIND secondary nameservers, one per line.  This enables export of /var/named/named.conf
41   <li><a name="bsdshellmachines">bsdshellmachines</a> - Your BSD flavored shell (and mail) machines, one per line.  This enables export of `/etc/passwd' and `/etc/master.passwd'.
42   <li><a name="countrydefault">countrydefault</a> - Default two-letter country code (if not supplied, the default is `US')
43   <li><a name="cybercash2">cybercash2</a> - <a href="http://www.cybercash.com/cybercash/services/cashreg214.html">CyberCash v2</a> support, four lines: paymentserverhost, paymentserverport, paymentserversecret, and transaction type (`mauthonly' or `mauthcapture').  CCLib.pm is required.
44   <li>cybercash3.2 - <a href="http://www.cybercash.com/cybercash/services/technology.html">CyberCash v3.2</a> support.  Two lines: the full path and name of your merchant_conf file, and the transaction type (`mauthonly' or `mauthcapture').  CCMckLib3_2.pm, CCMckDirectLib3_2.pm and CCMckErrno3_2 are required.
45   <li><a name="deletecustomers">deletecustomers</a> - The existance of this file will enable customer deletions.  Be very careful!  Deleting a customer will remove all traces that this customer ever existed!  It should probably only be used when auditing a legacy database.  Normally, you cancel all of a customers' packages if they cancel service.
46   <li><a name="domain">domain</a> - Your domain name.
47   <li><a name="editreferrals">editreferrals</a> - The existance of this file will allow you to change the referral of existing customers.
48   <li><a name="erpcdmachines">erpcdmachines</a> - Your ERPCD authenticaion machines, one per line.  This enables export of `/usr/annex/acp_passwd' and `/usr/annex/acp_dialup'.
49   <li><a name="hidecancelledpackages">hidecancelledpackages</a> - The existance of this file will prevent cancelled packages from showing up in listings (though they will still be in the database)
50   <li><a name="hidecancelledcustomers">hidecancelledcustomers</a> - The existance of this file will prevent customers with only cancelled packages from showing up in listings (though they will still be in the database)
51   <li><a name="home">home</a> - For new users, prefixed to usrename to create a directory name.  Should have a leading but not a trailing slash.
52   <li><a name="icradiusmachines">icradiusmachines</a> - Your <a href="ftp://ftp.cheapnet.net/pub/icradius">ICRADIUS</a> machines, one per line.  The existance of this file (even if empty) turns on radcheck table creation (in the freeside database - the radcheck table needs to be created manually).  Machines listed in this file will have the radcheck table exported to them.  Each line of this file should contain four items, separted by whitespace: machine name, MySQL database name, MySQL username, and MySQL password.  For example: "<CODE>radius.isp.tld&nbsp;radius_db&nbsp;radius_user&nbsp;passw0rd</CODE>".  Note that to use ICRADIUS export you need to be using MySQL.
53   <li><a name="icradius_mysqldest">icradius_mysqldest</a> - Destination directory for the MySQL databases, on the ICRADIUS machines.  Defaults to "/usr/local/var/".
54   <li><a name="icradius_mysqlsource">icradius_mysqlsource</a> - Source directory for for the MySQL radcheck table files, on the Freeside machine.  Defaults to "/usr/local/var/freeside".
55   <li><a name="icradius_secrets">icradius_secrets</a> - Optionally specifies a MySQL database for ICRADIUS export, if you're not running MySQL for your Freeside database.  The database should be on the Freeside machine and store data in the <a href="#icradius_mysqlsource">icradius_mysqlsource</a> directory.  Three lines: DBI data source, username and password.  This file should not be world readable.
56   <li><a name="invoice_from">invoice_from</a> - Return address on email invoices.
57   <li><a name="invoice_template">invoice_template</a> - Required template file for invoices.  See the <a href="billing.html">section on billing</a> for details.
58   <li><a name="lpr">lpr</a> - Print command for paper invoices, for example `lpr -h'.
59   <li><a name="maildisablecatchall">maildisablecatchall</a> - The existance of this file will disable the requirement that each virtual domain have a catch-all mailbox.
60   <li><a name="money_char">money_char</a> - Currency symbol - defaults to `$'.
61   <li><a name="mxmachines">mxmachines</a> - MX entries for new domains, weight and machine, one per line, with trailing `.'
62   <li><a name="nsmachines">nsmachines</a> - NS nameservers for new domains, one per line, with trailing `.'
63   <li><a name="nismachines">nismachines</a> - Your NIS master (not slave master) machines, one per line.  This enables export of `/etc/global/passwd' and `/etc/global/shadow'.
64   <li><a name="passwordmin">passwordmin</a> - Minimum password length (default 6);
65   <li><a name="qmailmachines">qmailmachines</a> - Your qmail machines, one per line.  This enables export of `/var/qmail/control/virtualdomains', `/var/qmail/control/recipientmap', and `/var/qmail/control/rcpthosts'.  The existance of this file (even if empty) also turns on user `.qmail-extension' file maintenance in conjunction with `shellmachine'.
66   <li><a name="radiusmachines">radiusmachines</a> - Your RADIUS authentication machines, one per line.  This enables export of `/etc/raddb/users'.
67   <li><a name="referraldefault">referraldefault</a> - Default referral, specified by refnum.
68   <li><a name="registries">registries</a> - Directory which contains domain registry information.  Each registry is a directory.
69     <ul>
70       <li>registries/internic - Currently the only supported registry
71         <ul>
72           <li>registries/internic/from - Email address from which InterNIC domain registrations are sent.
73           <li>regestries/internic/nameservers - The nameservers for InterNIC domain registrations, one per line.  Each line contains an IP address and hostname, separated by whitespace.
74           <li>registries/internic/tech_contact - Technical contact NIC handle for domain registrations.
75           <li>registries/internic/template - Template for InterNIC domain registrations with special markup.  A suitable copy of the InterNIC domain template v4.0 is in `fs-x.y.z/etc/domain-template.txt'.
76           <li>registries/internic/to - Email address to which InterNIC domain registrations are sent.
77         </ul>
78     </ul>
79   <li><a name="sendmailconfigpath">sendmailconfigpath</a> - Sendmail configuration file path - defaults to `/etc'.  Many newer distributions use `/etc/mail'.
80   <li><a name="sendmailmachines">sendmailmachines</a> - Your sendmail machines, one per line.  This enables export of `/etc/virtusertable' and `/etc/sendmail.cw'.
81   <li><a name="sendmailrestart">sendmailrestart</a> - If defined, the command which is run on sendmail machines after files are copied.
82   <li><a name="session-start">session-start</a> - If defined, the command which is executed on the Freeside machine when a session begins.  The contents of the file are treated as a double-quoted perl string, with the following variables available: <code>$ip</code>, <code>$nasip</code> and <code>$nasfqdn</code>, which are the IP address of the starting session, and the IP address and fully-qualified domain name of the NAS this session is on.
83   <li><a name="session-stop">session-stop</a> - If defined, the command which is executed on the Freeside machine when a session ends.  The contents of the file are treated as a double-quoted perl string, with the following variables available: <code>$ip</code>, <code>$nasip</code> and <code>$nasfqdn</code>, which are the IP address of the starting session, and the IP address and fully-qualified domain name of the NAS this session is on.
84   <li><a name="shellmachine">shellmachine</a> - A single machine with user home directories mounted.  This enables home directory creation, renaming and archiving/deletion.  In conjunction with `qmailmachines', it also enables `.qmail-extension' file maintenance.
85   <li>shellmachine-useradd - The command(s) to run on shellmachine when an account is created.  If this file does not exist, <code>useradd -d $dir -m -s $shell -u $uid $username</code> is the default.  If the file exists but is empty, <code>cp -pr /etc/skel $dir; chown -R $uid.$gid $dir</code> is the default instead.  Otherwise the contents of the file are treated as a double-quoted perl string, with the following variables available: <code>$username</code>, <code>$uid</code>, <code>$gid</code>, <code>$dir</code>, and <code>$shell</code>.
86   <li>shellmachine-userdel - The command(s) to run on shellmachine when an account is deleted.  If this file does not exist, <code>userdel $username</code> is the default.  If the file exists but is empty, <code>rm -rf $dir</code> is the default instead.  Otherwise the contents of the file are treated as a double-quoted perl string, with the following variables available: <code>$username</code> and <code>$dir</code>.
87   <li>shellmachine-usermod - The command(s) to run on shellmachine when an account is modified.  If this file does not exist or is empty, <code>[ -d $old_dir ] &amp;&amp; mv $old_dir $new_dir || ( chmod u+t $old_dir; mkdir $new_dir; cd $old_dir; find . -depth -print | cpio -pdm $new_dir; chmod u-t $new_dir; chown -R $uid.$gid $new_dir; rm -rf $old_dir )</code> is the default.  Otherwise the contents of the file are treated as a double-quoted perl string, with the following variables available: <code>$old_dir</code>, <code>$new_dir</code>, <code>$uid</code> and <code>$gid</code>.
88   <li><a name="shellmachines">shellmachines</a> - Your Linux and System V flavored shell (and mail) machines, one per line.  This enables export of `/etc/passwd' and `/etc/shadow' files.
89   <li><a name="shells">shells</a> - Legal shells (think /etc/shells).  You probably want to `cut -d: -f7 /etc/passwd | sort | uniq' initially so that importing doesn't fail with `Illegal shell' errors, then remove any special entries afterwords.  A blank line specifies that an empty shell is permitted.
90   <li><a name="showpasswords">showpasswords</a> - The existance of this file will allow unencrypted user passwords to be displayed.
91   <li><a name="smtpmachine">smtpmachine</a> - SMTP relay for Freeside's outgoing mail.
92   <li><a name="soadefaultttl">soadefaultttl</a> - SOA default TTL for new domains.
93   <li><a name="soaemail">soaemail</a> - SOA email for new domains, in BIND form (`.' instead of `@'), with trailing `.'
94   <li><a name="soaexpire">soaexpire</a> - SOA expire for new domains
95   <li><a name="soamachine">soamachine</a> - SOA machine for new domains, with trailing `.'
96   <li><a name="soarefresh">soarefresh</a> - SOA refresh for new domains
97   <li><a name="soaretry">soaretry</a> - SOA retry for new domains
98   <li><a name="statedefault">statedefault</a> - Default state or province (if not supplied, the default is `CA')
99   <li><a name="textradiusprepend">textradiusprepend</a> - The contents of this file will be prepended to the first line of a user's RADIUS entry in text exports.  If necessary, usually `Auth-Type = Local, '.
100   <li><a name="usernamemin">usernamemin</a> - Minimum username length (default 2);
101   <li><a name="usernamemax">usernamemax</a> - Maximum username length (default is the size of the SQL column, probably specified when fs-setup was run)
102   <li><a name="usernamemax">username-letter</a> - The existance of this file will turn on the requirement that usernames contain at least one letter.
103   <li><a name="usernamemax">username-letterfirst</a> - The existance of this file will turn on the requirement that usernames start with a letter.
104    <li><a name="username_policy">username_policy</a> - This file controls the mechanism for preventing duplicate usernames in passwd/radius files exported from svc_accts.  This should be one of 'prepend domsvc' 'append domsvc' or 'append domain'
105    <li><a name="vpopmailmachines">vpopmailmachines</a> - Your vpopmail pop toasters, one per line.  Each line is of the form "machinename vpopdir vpopuid vpopgid".  Eg: poptoaster.domain.tld /home/vpopmail 508 508 Note: vpopuid and vpopgid are values taken from the vpopmail machine's /etc/passwd
106
107 </ul>
108 </body>
109