Move your configuration files
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.
- config.php - General Settings
- importconfig.php - Import Settings
- logconfig.php - Log Settings
- mapconfig.php - Map Settings
- pedconfig.php - Chart Settings
- templateconfig.php - Template Settings (added by TNG 8.1)
- mmconfig.php - Mod Manager Configuration (added by TNG 10.0.3
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
- Decide where the new configuration folder will be (see examples below).
- Create that new configuration folder.
- In TNG, go to Admin >> Setup >> General Settings >> Paths and Folders
- 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.
- 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.
- Run some TNG programs to make sure that TNG still uses the settings you expect.
- Make sure to save the pathname to your new config file folder in your TNG documentation.
- 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.
Here is how to put your configuration files in the safe area above your shared site's document root in three easy steps:
- 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.
- 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/
- Move the TNG configuration files shown above into the new folder.
- Save a copy of your subroot.php file in case you need to recover the Config Path
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
ICDSoft uses www for their web site root and private for files not accessible from the web browser. So under
|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.
The following provide additional security measures:
Controlling Site Access
- Permissions Explained
- Database User
- Move your configuration files
- Move your backup files
- Move your gedcom files
- Overlaid Subroot how to recover from subroot.php overlay
- Prevent Directory Listing
- Protecting access log