36.17. Configuring the PostgreSQL Database Server Module

Like most other modules, this one has several options that you can set by clicking on the Module Config link in the top-left corner of its main page. Those fields listed under Configurable option relate to its connection to the database and user interface, while those under System configuration define the paths to the PostgresSQL programs and files.

Unless you have installed the database server in a different directory to the default for your operating system, fields in the second section do not generally need to be changed. This can happen if you installed PostgreSQL from the source code instead of using the package supplied with your Linux distribution, or if you have two copies of PostgreSQL installed and are configuring a clone of the module (covered in Chapter 51) to manage the second install.

The names and purposes of all the module configuration fields are listed in Table 36.2.

Table 36.2. Module Configuration Options
Administration loginThis field contains the username that the module logs in to PostgreSQL as in order to perform all its actions. It is normally set by the PostgreSQL Login form on the module's main page, which appears if Webmin cannot log in the first time you use the module. It does not usually need to be changed after that. If you change this field, make sure the new user has full access to all tables and features or some parts of the module will not work. You will probably need to change the Administration password field as well to match the new username.
Administration passwordThe password with which Webmin logs into the database server. Like the Administration login field, the PostgreSQL Login form normally sets this.
UNIX user to connect to database asWhen Same as Administration login is selected, the module will connect to the database as the UNIX user with the same name as the database user in the Administration login field. This is necessary if your server has been configured to only perform ident authentication, which is the case on some Redhat and Debian Linux releases. If root is selected instead, all database connections will be done as the root UNIX user. This is the default, and should be used whenever the server is configured to authenticate clients by a username and password.
Number of rows to display per pageWhen viewing and editing records in a table, the module limits the number of records displayed at a time so that the page does not become too large. To increase or decrease the number appearing on each page, change this field.
Use DBI to connect if availableWhen this field is set to Yes (as it is by default), the module will use the Perl DBI interface to connect to the database serve, as long as the appropriate Perl modules are installed. Only if DBI is not available will it use the psql command to connect, as the output from that command cannot always be reliably parsed. Changing this field to No tells the module to always use the psql command, even if DBI could be used instead. This should only be necessary if there is something wrong with the DBI modules on your system.
Path to psql commandThis field must contain the full path to the psql command, which is used to execute SQL commands if the Perl DBI modules are not installed.
Path to PostgreSQL shared librariesWhen PostgreSQL is installed from the source distribution, the psql program makes use of shared libraries that are installed as well. For Webmin to be able to run them, it must set the LD_LIBRARY_PATH environment variable to include the directory containing those libraries, such as /usr/local/pgsql/lib. Normally, the module's main page will display an error message warning you of a shared library problem if it is not set correctly. Because Webmin assumes that shared libraries are in the lib directory above the directory containing the psql program, this field does not usually need to be set. Most of the time, it is only necessary if your PostgreSQL commands depend upon other libraries in nonstandard directories like /usr/local/lib.
Initial PostgreSQL databaseBecause PostgreSQL always requires clients to specify a database when connecting, the field must contain the name of a database that always exists for Webmin itself to use when connecting. The default template1 database will work fine, unless you decide to delete it.
Command to start PostgreSQLWhen the Start PostgreSQL Server button on the module's main page is clicked, the command in this configuration field is run. It must contain a valid shell command to start the database server as the correct user. On most Linux systems that have a package for the database, it will be set to use a bootup script like /etc/init.d/postgresql start by default. If you have installed PostgreSQL manually, however, you will need to change it to something like su postgres -c "/usr/local/pgsql/bin/postmaster -i -S -D/usr/local/pgsql/var" instead. This command runs the postmaster database server process with the correct parameters as the user postgres.
Command to stop PostgreSQLThis field controls what happens when the Stop PostgreSQL Server button on the main page is clicked. If Kill process is chosen, the module will simply kill the running postmaster server process. If the second option is selected, however, the shell command entered into the adjacent text field will be run. This is default on Linux systems that include a PostgreSQL package that has a shutdown script for stopping the server, such as /etc/init.d/postgresql stop. If you have compiled and installed PostgreSQL yourself, you should choose the Kill process option, as no such shutdown command or script exists.
Command to initialize PostgreSQLThis field specifies the command that the module runs when the Initialize Database button on the main page is clicked. Because this is only shown when the pg_hba.conf file is not found, the command is typically only run once. It must be set to some script or program that can initialize the database for the first time and create the pg_hba.conf file. On Linux distributions that have PostgreSQL packages, it is set by default to run a bootup script like /etc/init.d/postgresql start, which runs the correct initdb initialization command. If the option None is chosen, the Initialize Database button will not be shown even if the database needs initialization. If you have compiled and installed PostgreSQL yourself, this is the safest option, as the install process should set up the database and configuration files for you.
Path to postmaster PID fileThis field must contain the full path to the PID file created by the postmaster server process, such as /usr/local/pgsql/var/postmaster.pid.
Path to host access config fileThis field must be filled in with the full path to the pg_hba.conf file that contains host access restrictions, as explained in Section 36.14 “Restricting Client Access”. If it is not set correctly, the module will assume that PostgreSQL has not yet been initialized and display an error message on the main page.
PostgreSQL host to connect toWhen this field is set to localhost, the module will connect to the PostgreSQL server on the same system to view and manage databases. It is possible to enter a different hostname instead, however, in which case the module will connect to the server on that host. Not all features of the module can be used on a remote server, however. The Allowed Hosts page and the Start and Stop buttons are examples of this.
PostgreSQL port to connect toThis field can be used to have the module connect to a port other than the default when your database server is running on a non-standard port.
Path to pg_dump commandThis field must contain the full path to the pg_dump command, used for backing up a database.
Path to pg_restore commandThis field must contain the full path to the pg_restore command, used for re-loading the contents of a backup into a database.
Default backup repository directoryThis field sets the default value for the backup form's Backup file path field. It can be useful if all your backups are made to the same directory.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.222.83.185