Move your configuration files

De TNG_Wiki
Sauter à la navigation Sauter à la recherche

TNG Config Path

TNG 7.0.0 added a Config Path in the Setup >> General Settings >> Paths and Folders
that allows you to move the following configuration files from the TNG install folder into a folder that cannot be accessed from the Web. The folder must be accessible to PHP programs, but, again, not to web browsers.

  1. config.php - General Settings
  2. importconfig.php - Import Settings
  3. logconfig.php - Log Settings
  4. mapconfig.php - Map Settings
  5. pedconfig.php - Chart Settings
  6. templateconfig.php - Template Settings (added by TNG 8.1)
  7. mmconfig.php - Mod Manager Configuration (added by TNG 10.0.3
  8. customconfig.php

Only the the files just above should be considered TNG configuration files. The first six are managed by the six configuration forms on the TNG Admin>>Setup screen. The Mod Manager configuration file is managed by the Mod Manager options tab. The customconfig.php file must be updated by a mod or by hand; there is not native TNG program for editing it.

TNG version: 12.0.0

Starting with TNG v12, the templateconfig.php file is automatically uploaded into the new Templates (tng_templates) table in the TNG database. That is, the file still exists, but it is not updated when you change the template settings at Admin >> Setup >> Template Settings.

Other files with xxxconfig.php names pertain to customization for specific TNG charts and should remain in the TNG root folder.

TNG version: 7.0

TNG 7.0.0 allows you to specify a Config Path that is saved in subroot.php (which remains in the TNG install folder) that points to where your configuration files are stored.

The reason you may want to move your TNG configuration files is that some of them contain parameters that would grant access to the capabilities on your site.

How to Move Config Files

If you decide to move your TNG configuration files, you should

  1. Decide where the new configuration folder will be (see examples below).
  2. Create that new configuration folder.
  3. In TNG, go to Admin >> Setup >> General Settings >> Paths and Folders
  4. Enter the full path to your new configuration folder into the "Config Path" field, and save the form.
    • Your config path should be very similar to the "Root Path" that is specified immediately above "Config Path". See examples below.
    • Once you have changed your "Config Path", TNG will not work until you have moved your configuration files to the new folder.
  5. Use your hosting provider's control panel or FTP to move your configuration files to the new folder. (In general, you should move the files rather than copy them to avoid confusion when you see the files in your main TNG folder.
    • In your Control Panel, select your File Manager utility, select the config files listed above (in the main TNG folder), and copy them into the new folder
    • Using FTP, Download the configuration files to an otherwise-empty folder on your PC, and upload them to the new folder on your server, and then remove them from your main TNG folder.
  6. Run some TNG programs to make sure that TNG still uses the settings you expect.
  7. Make sure to save the pathname to your new config file folder in your TNG documentation.
  8. Assuming that you have a copy of your entire TNG site on your PC, copy the configuration files from the Config Path folder of that copy of TNG.
    If you have a web server on your PC, and a working TNG folder on your PC, certain files should not be the same on your PC-based test environment and your server:
    • config.php, which includes system parameters that connect to your database, and define the name, web address, and file system location of your website.
    • subroot.php, which holds the underlying file system path to your configuration files.

Examples

Generic Shared Hosting

Here is how to put your configuration files in the safe area above your shared site's document root in three easy steps:

  1. Use cPanel or an FTP program to create the config folder outside of your web server root folder.
    • On essentially all hosted websites, you file space starts one level above your web root (which is likely to be a folder named "public_html", or maybe "www". Folders at the root of your file space are not accessible via web browsers, although they can be accessed as files (rather than web pages) from your web site. A common example of this is a folder named "log" or "logfiles" that contains your web sites access logs.
  2. Use TNG Admin > Setup > General Settings > Paths and Folders to point the Config Path to your new folder
    for example, Config Path: /home/mysite/config/
  3. Move the TNG configuration files shown above into the new folder.
  4. Save a copy of your subroot.php file in case you need to recover the Config Path

ICDSoft Example

If you are hosted on ICDSoft for example, the config files could be moved to your /private folder which is not web accessible and can only be accessed through the ICDSoft Control Panel File Manager or through your FTP client.

You could create sub folders under /private to allow for having two or more test systems where you can then add a gedcom folder, for example the following was provided by Ron Krzmarzick

Private Folder Structure

ICDSoft uses www for their web site root and private for files not accessible from the web browser. So under

  • private, you can create
    • www to match your production site
    • tng12 to match the tng12 subdomain
    • test to match a test subdomain
  • www - the web folder structure
    • www is your production
    • tng12 for a tng12 subdomain
    • test for a test subdomain
TNG version: 14.0

TNG v14 added the capability to check a Store in Config path option for the backups and gedcom folders. You may consider dropping the config folder name from your Config Path definition which on ICDSoft is /home/account/private/tng12/ in the above example so that the backups and gedcom folders can be subfolders of you private domain/subdomain config path or test subdomains and not subfolders of your config folder

Localhost Example

Localhost example.png Note that you can simulate or test putting the folders outside of web browser accessibility on your local WampServer setup by creating the config folder as a subfolder to the wamp folder.

backup your config path

If you decide to use the Config Path, make sure you make a backup copy of your subroot.php file after updating it.

You should document the value of your Config Path for recovery purposes by opening the subroot.php file and copying the value of the

$tngconfig[subroot] = "/home/account/private/www/config/";

as shown above for an ICDSoft hosted site and save it in your TNG customization instructions file, so you know what value you need to specify in order to recover the subroot.php.


TNG version: 14.0

TNG v14 added the capability to check a Store in Config path option for the backups and gedcom folders. You may consider dropping the config folder name from your Config Path definition which on ICDSoft is /home/account/private/tng12/ so that the backups and gedcom folders become subfolders of you private domain/subdomain config path or test subdomains and not subfolders of your config folder structure

$tngconfig[subroot] = "/home/account/private/www/";

or

$tngconfig[subroot] = "/home/account/private/tng14beta/";

Related Links

The following provide additional security measures:

Controlling Site Access

Protecting Resources

Checking your site for Malware