autopsy-flatpak/docs/doxygen-user/installPostgres.dox
2015-12-09 12:13:08 -05:00

105 lines
5.5 KiB
Plaintext
Executable File

/*! \page install_postgresql Install and Configure PostgreSQL
To install PostgreSQL, perform the following steps:
1. Download a 64-bit PostgreSQL version 9.4.1 installer from http://www.enterprisedb.com/products-services-training/pgdownload#windows Choose the one that says _Win X86-64_.
2. Run _postgresql-9.4.4-1-windows-x64.exe_
3. You may accept defaults for all items except for the password as you work through the wizard. Do not lose the password you enter in. This is the PostgreSQL administrator login password.
4. You do not need to launch the StackBuilder nor acquire any more software from it. Uncheck the option to use StackBuilder and press _Finish_.
5. Create a regular user account to use while running Autopsy. You can do this with either of two methods, graphically, or command line. We cover graphically first.
- Graphically:
- Using the PostgreSQL administrator login and the pgAdmin III tool, create a regular user account to use while running Autopsy.
- Right click on <i>"Login Roles"</i> and select <i>"New Login Role..."</i> as shown below:
<br><br>
\image html pgAdmin.PNG
<br><br>
- Enter the user name you would like to use in the <i>"Role name"</i> field.
<br><br>
\image html newLoginRole.PNG
<br><br>
- Enter the password on the <i>"Definition"</i> tab.
<br><br>
\image html newPassword.PNG
<br><br>
- Check <i>"Can create databases"</i> on the <i>"Role Privileges"</i> tab.
<br><br>
\image html newRights.PNG
<br><br>
- Click <i>"OK"</i>.
<br><br>
- Command line:
<br>
Use the _psql_ tool. To start _psql_, press _Start_, type _psql_, and press _Enter_ a few times until it prompts you for a password. Type in the password you gave it when installing PostgreSQL. You should see a prompt that looks like the screenshot below.
<br><br>
\image html postgresqlinstall1.PNG
<br><br>
If you want your user account name to be <i>"Autopsy"</i> and your password to be <i>"myPassword"</i>, use the following command to create a new user, noting that the password is enclosed in single quotes, __not backticks nor double quotes__. Also note that it is important to type this command in from the keyboard directly, as copying and pasting can sometimes yield different characters for single quotes that can confuse _psql_.
<br><br>
The command is:
<br>
> CREATE &nbsp;&nbsp; USER &nbsp;&nbsp; Autopsy &nbsp;&nbsp; WITH &nbsp;&nbsp; PASSWORD &nbsp;&nbsp; 'myPassword' &nbsp;&nbsp; CREATEDB;
<br>
When you see the _CREATE ROLE_ output as shown in the screenshot below, the new user has been created. You can close the _psql_ window now.
<br>
<br>
\image html postgresqlinstall2.PNG
<br>
6. Edit <i>C:\\Program Files\\PostgreSQL\\9.4\\data\\pg_hba.conf</i> to add an entry to allow external computers to connect via the network.
<br><br>
First, find your machine's IPv4 address and Subnet Mask (Press _Start_, type _cmd_, type _ipconfig_ and parse the results. The IP address is shown in yellow below.
<br>
\image html postgresqlinstall3.PNG
<br>
The following is an example rule that allows all clients on the 10.10.192.x subnet to connect using md5 authentication.
<br>
> host&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;all&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;all&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;10.10.192.0/24&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;md5
<br>
__Subnet Mask Rules of thumb:__
- If your Subnet Mask is 255.255.0.0, your rule should look like this: A.B.0.0/16, where A is the first octet in your IP address and B is the second octet.
<br>
- If your Subnet Mask is 255.255.255.0, your rule should look like this: A.B.C.0/24, where A is the first octet in your IP address, B is the second octet, and C is the third octet.
<br><br>
Add the line highlighted in yellow below, formatted with spaces between the entries, adjusting the IP address to an appropriate value as described above.
<br><br>
\image html postgresqlinstall4.PNG
<br>
<br><br>
If you intend to use PostgreSQL from machines on a different subnet, you need an entry in the _pg_hba.conf_ file for each subnet.
<br><br>
7. Uncomment the following entires in the configuration file located at <i>C:\\Program Files\\PostgreSQL\\9.4\\data\\postgresql.conf</i> by removing the leading "#", and change their values <i>"off"</i> as shown below.
<br>
> fsync = off<br>
> synchronous_commit = off<br>
> full_page_writes = off<br>
<br>
Pictorially, change the following, from this:
<br><br>
\image html postgresqlinstall5.PNG
<br><br>
To this:
<br><br>
\image html postgresqlinstall6.PNG
<br><br>
Note the removal of the leading number symbol-this uncomments that entry.
<br><br>
8. Still in <i id="max_connections">"C:\Program Files\PostgreSQL\9.4\data\postgresql.conf"</i>, find the entry named _max_connections_ and set it to the number of suggested connections for your configuration. A rule of thumb is add 100 connections for each Automated Ingest Node and 100 connections for each Reviewer node you plan to have in the network. More information is available at 5.1.1. See the screenshot below.
<br><br>
\image html maxConnections.PNG
<br><br>
9. Press _Start_, type _services.msc_, and press _Enter_. Select _postgresql-x64-9.4 PostgreSQL Server 9.4_ in the services list and click the link that says _Stop the service_ then click the link that says _Start the service_ as shown in the screenshot below.
<br><br>
\image html postgresqlinstall7.PNG
<br><br>
PostgreSQL should now be up and running. You can verify by using either the _pgAdmin_ tool or the _psql_ tool to connect to the database server from another machine on the network .
<br><br><br>
*/