Setting Up Navigator

From ISP_RAS
Jump to: navigation, search

Contents

Requirements

In order to setup local copy of Navigator, the following items are required:

  • PHP (both 4.x and 5.x are supported) with the following additional packages:
    • php-mysql
    • php-ctype (usually it is installed with php automatically, but on some systems it is a separate package)
  • MySQL 5.x. Note: MySQL 4.x is not supported.
  • Web server (Navigator was tested on Apache 2.x) with php support
  • On client side, javascript and cookies should be enabled. Cookies are responsible for storing filter values; if they are disabled, these values will be lost every time user changes page.

Setup

bzr branch http://bzr.linuxfoundation.org/lsb/devel/dbadmin
  • Create configuration file on the basis of "dbadmin/config/connection.inc.tmpl" template:
cd dbadmin/config
cp connection.inc.tmpl connection.inc

In the connection.inc file, set database connection parameters for different modes and replace "localhost" with the host where the database is located.

Alert: We strongly recommend to configure your server to make connection.inc file (or even the whole config folder) unaccessible from Web.

Note: The user should have the following privileges fro the LSB database:

  1. "SELECT" privileges on all tables
  2. "INSERT" privileges on "InterfaceComment" table (not required, if you are not planning to add comments for interfaces using Navigator)

In addition, the user should have ALL privileges for the database where temporary tables are created.

  • Copy 'dbadmin' folder to a place visible to your web browser (in a simplest case, it is 'htdocs' directory)
  • Navigator is ready to use - type "<your_host_url>/dbadmin/commons/welcome.php" in any browser. 'Welcome' page should be displayed.

Notes About DB Users

During the database setup process, all necessary privileges to act in the 'browse' mode are given to the 'lsbuser' user from the localhost, and all necessary privileges to act in the 'admin' mode are given to the 'lsbadmin' user from the localhost. This is done by 'dbperms.sql' and 'setupdb.sql' scripts respectively. You can either setup Navigator to act as these users, or use the scripts mentioned to create your own ones.

Administration Mode Restrictions

In the 'admin' mode, users are allowed to modify tables. In addition, some queries can take relatively long time and produce high server loads. Thus, it can be undesirable to allow access to this mode to all users who can use the Navigator. Surely, the simplest way is just not to set up 'admin' mode db access at all. However, this is too rough - you may want just to restrict 'admin' mode access and allow it only for some selected users. One of the possible ways to implement this is based on the fact that all scripts used in the 'admin' mode are located in the 'admin' subfolder of Navigator. As soon as someone clicks the 'Administration' link in the Navigator, he gets redirected to one of these scripts. Thus, the simplest way to restrict access to the 'admin' mode is to protect the 'admin' folder on web server level (e.g., using '.htaccess' file for Apache).

Debugging and Profiling

In order to simplify Navigator debugging and profiling, a special 'Debug' mode can be turned on, in which Navigator will display all queries that he is going to pass to MySQL server, query execution times and other useful information.

To turn on such verbose reporting, set $verbose_queries variable in the beginning of browse/db.inc, admin/db.inc or futures_tracker/db.inc (depending on what functional mode you are going to debug/profile) to 1.

Personal tools