Move your configuration files

From TNG_Wiki
Jump to: navigation, search

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 more protected area of your web site:

  • config.php
  • customconfig.php
  • importconfig.php
  • logconfig.php
  • mapconfig.php
  • pedconfig.php
  • templateconfig.php - added by TNG 8.1
  • mmconfig.php - added by TNG 10.0.3

Only the above 7 files should be considered TNG configuration files. The first six are managed by the TNG Admin > Setup screen. The Mod Manager option file is managed by the Mod Manager options tab.

TNG version: 12.0.0
Starting with TNG v12, the templateconfig.php file has been replaced by the Templates (tng_templates) table in the TNG database.

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 the 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 >> Settings >> General Settings >> Paths and Folders
  4. Enter the full path to the configuration folder into the "Config Path" field.
    Your config path should be very similar to the "Root Path" that is specified immediately above "Config Path". See examples below.
  5. In your Control Panel, File Manager, select the config files listed above in the main TNG folder into the new folder
  6. Use the Move Selected button to move the selected TNG config files to your Config Path location
    You should move the files and not copy them to avoid confusion
  7. Run some TNG programs to make sure that TNG still uses the settings you expect.
  8. Make sure to save the pathname to your new config file folder in your TNG documentation.
  9. 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.
    Note that if you copy your web site from your host to your PC or in the other direction, 2 files should not be copied:
  • config.php
  • subroot.php

since they contain information specific to that web server environment, those two files should be created on your host or local computer webser so that your site will function correctly. If you copied those two files accidentally, you will need to edit them manually to recover your site.

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 FileZilla to create the config folder above the site's document root (public_html).
  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

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/yourdomain/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.

Related Links

The following provide additional security measures:

Controlling Site Access

Protecting Resources

Checking your site for Malware