| 1 | <?xml version="1.0" encoding="iso-8859-1"?> |
|---|
| 2 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
|---|
| 3 | <html xmlns="http://www.w3.org/1999/xhtml"> |
|---|
| 4 | <head> |
|---|
| 5 | <meta http-equiv="content-type" content="text/html;charset=iso-8859-1" /> |
|---|
| 6 | <title>Box Backup server configuration</title> |
|---|
| 7 | <link rel="stylesheet" href="bbstyles.css" type="text/css" /> |
|---|
| 8 | </head> |
|---|
| 9 | <body> |
|---|
| 10 | <div align="center"> |
|---|
| 11 | <div id="header"> |
|---|
| 12 | <div id="logo"> |
|---|
| 13 | <img src="images/bblogo.png" alt="logo" height="65" width="331" border="0" vspace="5" align="middle" /> <img src="images/stepahead.png" alt="a step ahead in data security" width="182" height="11" hspace="10" vspace="20" border="0" align="middle" /></div> |
|---|
| 14 | </div> |
|---|
| 15 | <div id="page"> |
|---|
| 16 | |
|---|
| 17 | <h1>Box Backup server configuration</h1> |
|---|
| 18 | |
|---|
| 19 | <h2>Log files</h2> |
|---|
| 20 | |
|---|
| 21 | <p>You may wish to see what's going on with the server. Edit /etc/syslog.conf, and add</p> |
|---|
| 22 | |
|---|
| 23 | <pre> |
|---|
| 24 | local6.info /var/log/box |
|---|
| 25 | local5.info /var/log/raidfile |
|---|
| 26 | </pre> |
|---|
| 27 | |
|---|
| 28 | <p>Note separators must be tabs, otherwise it ignores you.</p> |
|---|
| 29 | |
|---|
| 30 | <pre> |
|---|
| 31 | touch /var/log/box |
|---|
| 32 | touch /var/log/raidfile |
|---|
| 33 | </pre> |
|---|
| 34 | |
|---|
| 35 | <p>And then get them rotated, by adding in /etc/newsyslog.conf</p> |
|---|
| 36 | |
|---|
| 37 | <pre> |
|---|
| 38 | /var/log/box 644 7 2000 * Z |
|---|
| 39 | /var/log/raidfile 644 7 2000 * Z |
|---|
| 40 | </pre> |
|---|
| 41 | |
|---|
| 42 | <p>Then restart syslogd.</p> |
|---|
| 43 | |
|---|
| 44 | <h2>RAID setup</h2> |
|---|
| 45 | |
|---|
| 46 | <p>The server does RAID in userland for that extra bit of reliability. You need to |
|---|
| 47 | set this up separately from the server. To create <tt>/etc/box/raidfile.conf</tt>,</p> |
|---|
| 48 | |
|---|
| 49 | <pre> |
|---|
| 50 | /usr/local/bin/raidfile-config /etc/box 2048 /raid/0.0 /raid/0.1 /raid/0.2 |
|---|
| 51 | </pre> |
|---|
| 52 | |
|---|
| 53 | <p>But adjust it for your system. 2048 is the block size. Under BSD with FFS, set this to |
|---|
| 54 | your filing system's fragment size (most likely an 8th of the block size), otherwise the block size of |
|---|
| 55 | the filing system, for maximum efficiency.</p> |
|---|
| 56 | |
|---|
| 57 | <p>The three directories are the locations of the roots of the raid file directories. |
|---|
| 58 | These are probably the mount points of three big partitions on three <b>separate physical discs</b>. |
|---|
| 59 | If you don't have this, see below on how to disable userland RAID.</p> |
|---|
| 60 | |
|---|
| 61 | <p>Edit <tt>/etc/box/raidfile.conf</tt> if you have another set of three discs you want |
|---|
| 62 | to use -- just add another section for each set.</p> |
|---|
| 63 | |
|---|
| 64 | <h3>Disabling userland RAID</h3> |
|---|
| 65 | |
|---|
| 66 | <p>If you only have one disc, or a hardware RAID array, you probably won't want to use userland |
|---|
| 67 | RAID.</p> |
|---|
| 68 | |
|---|
| 69 | <p>In this case, follow the above instructions, but only specify one directory for the |
|---|
| 70 | <tt>raidfile-config</tt> script. This will generate a raidfile.conf which disables userland |
|---|
| 71 | RAID, and stores files in the single directory you specify.</p> |
|---|
| 72 | |
|---|
| 73 | <p><b>NOTE</b> Running the server in non-RAID mode has not been tested as extensively as |
|---|
| 74 | in RAID file mode.</p> |
|---|
| 75 | |
|---|
| 76 | |
|---|
| 77 | <h2>Server basic setup</h2> |
|---|
| 78 | |
|---|
| 79 | <p>Create a user to run the server under:</p> |
|---|
| 80 | |
|---|
| 81 | <pre> |
|---|
| 82 | useradd _bbstored |
|---|
| 83 | </pre> |
|---|
| 84 | |
|---|
| 85 | <p>Create <tt>/etc/box/bbstored.conf</tt> with:</p> |
|---|
| 86 | |
|---|
| 87 | <pre> |
|---|
| 88 | /usr/local/bin/bbstored-config /etc/box <b>hostname</b> _bbstored |
|---|
| 89 | </pre> |
|---|
| 90 | |
|---|
| 91 | <p>(See <a href="openssl.html">OpenSSL notes</a> if you get an OpenSSL error)</p> |
|---|
| 92 | |
|---|
| 93 | <p>(set hostname to the address the clients |
|---|
| 94 | will use to contact this server) <b>Are you using a NAT device or firewall?</b> See the note below.</p> |
|---|
| 95 | |
|---|
| 96 | <p><b>Read the output</b> for details of what to do next. There is an example at the end of this page, |
|---|
| 97 | but do follow the instructions output when you run the script yourself.</p> |
|---|
| 98 | |
|---|
| 99 | <p>Make sure the user can write to the raid file directories! For more precise control, |
|---|
| 100 | create a <tt>backup</tt> directory within each of the raid root directories, and change |
|---|
| 101 | their permissions accordingly.</p> |
|---|
| 102 | |
|---|
| 103 | <p>If there are other users on this server, you will probably want to stop other users |
|---|
| 104 | reading the certificates.</p> |
|---|
| 105 | |
|---|
| 106 | <pre> |
|---|
| 107 | chown -R _bbstored /etc/box/bbstored |
|---|
| 108 | chmod -R go-rwx /etc/box/bbstored |
|---|
| 109 | </pre> |
|---|
| 110 | |
|---|
| 111 | <h2>Configuration for hosts behind a NAT device or firewall</h2> |
|---|
| 112 | |
|---|
| 113 | <p>The hostname specified is used for 1) the name in the server's certificate and 2) the |
|---|
| 114 | address the server will listen on.</p> |
|---|
| 115 | |
|---|
| 116 | <p>If the IP address of the machine isn't the same as the IP address it appears to have to |
|---|
| 117 | the outside world (because the NAT device or firewall translates it), then this will fail. |
|---|
| 118 | The server will look up the hostname, and then fail to bind to that address since it is not a local |
|---|
| 119 | address.</p> |
|---|
| 120 | |
|---|
| 121 | <p>To get around this, you have two options. Either specify the local IP address with the |
|---|
| 122 | <tt>bbstored-config</tt> command (the name in the certificate won't match the real address, but |
|---|
| 123 | this is not a problem at the moment), or specify the real address, but edit the <tt>bbstored.conf</tt> |
|---|
| 124 | file and correct the <tt>ListenAddresses</tt> directive later to reflect the local address.</p> |
|---|
| 125 | |
|---|
| 126 | <h2>Get certified</h2> |
|---|
| 127 | |
|---|
| 128 | <p>As per the instructions in the <a href="accounts.html">certificates and accounts management</a> page, |
|---|
| 129 | sign your certificate and install it as directed.</p> |
|---|
| 130 | |
|---|
| 131 | <h2>Start the server</h2> |
|---|
| 132 | |
|---|
| 133 | <pre> |
|---|
| 134 | /usr/local/bin/bbstored |
|---|
| 135 | </pre> |
|---|
| 136 | |
|---|
| 137 | <p>Add this to your system startup scripts.</p> |
|---|
| 138 | |
|---|
| 139 | <p>Please read the <a href="trouble.html">Troubleshooting</a> page if you have problems.</p> |
|---|
| 140 | |
|---|
| 141 | <p>If you configured the server so the configuration file is somewhere other than <tt>/etc/box/bbstored.conf</tt>, |
|---|
| 142 | run the server as, for example,<p> |
|---|
| 143 | |
|---|
| 144 | <pre> |
|---|
| 145 | /usr/local/bin/bbstored /some/other/config/dir/bbstored.conf |
|---|
| 146 | </pre> |
|---|
| 147 | |
|---|
| 148 | <h2>root not required</h2> |
|---|
| 149 | |
|---|
| 150 | <p>The backup server is configured to be run as root, but changes user to the user |
|---|
| 151 | you specify as soon as it can -- this is simply for convenience when starting the daemon |
|---|
| 152 | in system start up scripts. However, you can <a href="nonroot.html">run without root</a> |
|---|
| 153 | entirely by making a small change to the configuration file.</p> |
|---|
| 154 | |
|---|
| 155 | |
|---|
| 156 | <h2>Example configuration output</h2> |
|---|
| 157 | |
|---|
| 158 | <p>This is an example of output from the bbstored-config script. <b>Important:</b> |
|---|
| 159 | Follow the instructions output by your script, not the ones here -- they may be different |
|---|
| 160 | for your system.</p> |
|---|
| 161 | |
|---|
| 162 | <pre> |
|---|
| 163 | # /usr/local/bin/bbstored-config /etc/box server.example.com _bbstored |
|---|
| 164 | Checking permissions on /raid/0.0/backup |
|---|
| 165 | Checking permissions on /raid/0.1/backup |
|---|
| 166 | Checking permissions on /raid/0.2/backup |
|---|
| 167 | |
|---|
| 168 | Setup bbstored config utility. |
|---|
| 169 | |
|---|
| 170 | Configuration: |
|---|
| 171 | Writing configuration file: /etc/box/bbstored.conf |
|---|
| 172 | Writing empty accounts file: /etc/box/bbstored/accounts.txt |
|---|
| 173 | Server hostname: server.example.com |
|---|
| 174 | RaidFile config: /etc/box/raidfile.conf |
|---|
| 175 | |
|---|
| 176 | Creating /etc/box/bbstored |
|---|
| 177 | Creating blank accounts file |
|---|
| 178 | Generating private key... |
|---|
| 179 | [OpenSSL output omitted] |
|---|
| 180 | |
|---|
| 181 | Writing configuration file /etc/box/bbstored.conf |
|---|
| 182 | |
|---|
| 183 | =================================================================== |
|---|
| 184 | |
|---|
| 185 | bbstored basic configuration complete. |
|---|
| 186 | |
|---|
| 187 | What you need to do now... |
|---|
| 188 | |
|---|
| 189 | 1) Sign /etc/box/bbstored/server.example.com-csr.pem |
|---|
| 190 | using the bbstored-certs utility. |
|---|
| 191 | |
|---|
| 192 | 2) Install the server certificate and root CA certificate as |
|---|
| 193 | /etc/box/bbstored/server.example.com-cert.pem |
|---|
| 194 | /etc/box/bbstored/clientCA.pem |
|---|
| 195 | |
|---|
| 196 | 3) You may wish to read the configuration file |
|---|
| 197 | /etc/box/bbstored.conf |
|---|
| 198 | and adjust as appropraite. |
|---|
| 199 | |
|---|
| 200 | 4) Create accounts with bbstoreaccounts |
|---|
| 201 | |
|---|
| 202 | 5) Start the backup store daemon with the command |
|---|
| 203 | /usr/local/bin/bbstored |
|---|
| 204 | in /etc/rc.local, or your local equivalent. |
|---|
| 205 | |
|---|
| 206 | =================================================================== |
|---|
| 207 | </pre> |
|---|
| 208 | |
|---|
| 209 | <p> </p> |
|---|
| 210 | <p>© Ben Summers, 2003, 2004</p> |
|---|
| 211 | <p> </p> |
|---|
| 212 | </div> |
|---|
| 213 | </div> |
|---|
| 214 | </body> |
|---|
| 215 | </html> |
|---|