Env settings.php
This small file contains only settings relating to the specific server environment. This is specifically for the ends of multiple sever environments. There are various settings and paths that need to be configured first. Currently ARK is set up to be used on either Mapserver for Windows (ms4w), Mac, or Linux servers. The env_settings.php must be included in the settings.php, and the server setup defined as below.
Server Specific Information
You will need to edit the following depending on your specific server information. Edit the information under the type of server you are using.
YOU MUST UPDATE THE SERVER SPECIFIC INFORMATION BEFORE YOUR ARK INSTALLATION WILL FUNCTION. AS A FIRST STEP UPDATE:
- $server - The server setup being used. This needs to be set the relevant configuration listed below.
- $doc_root - The document root of the your virtual host
- $pear_path - The path to your PEAR installation
- $ark_server_path - The full server path to your ARK directory
- $ark_dir - Your ARK directory
- $ark_db - Your ARK database
- $sql_server - The MySQL server
- $sql_user - The MySQL user who will make db calls
- $sql_pwd - The MySQL user password
- $export_dir - The export directory where CSV and files are stored when exported
- $registered_files_dir - The directory where files are stored after they are registered
- $registered_files_host - ***
- $default_upload_dir - The top directory of the file directory, can only search below this folder for uploading files
- $phMagickDir - phMagick directory, if using for Image Conversion
- $ark_maptemp_dir - Path to temporary map directory (on server)
- $ark_web_maptemp_dir - Path to temporary map directory (on web)
- $openlayers_path - Path to OpenLayers on local server, or alternatively pointed to OpenLayers API
- $ark_wms_map - If you are using Mapserver via the ark_wxs_server.php, you will need to specify the location of the relevant map files (WMS and WFS)
- $ark_wfs_map - If you are using Mapserver via the ark_wxs_server.php, you will need to specify the location of the relevant map files (WMS and WFS)
MS4W
A ms4w (mapserver for windows) is appropriate for projects holding the ARK database on a Windows system (eg. a laptop, a Windows shuttle). The env_settings.php for an ms4w installation of ARK should look like this:
// BASIC DIRECTORIES // The document root of this virtual host (as set up in your apache conf) $doc_root = 'C:\ms4w\Apache\htdocs'; // The path to the PEAR installation (windows has ; first) $pear_path = ";C:\ms4w\Apache\htdocs\ark\pear"; // The server path to the ark directory $ark_server_path = 'C:\ms4w\Apache\htdocs\ark'; // The folder name of THIS instance of Ark (relative to the document root of the host in which it is hosted) $ark_dir = '/ark/'; // DATABASE CONNECTION // The mysql db name of this instance of ark $ark_db = 'ark'; // The mysqlserver $sql_server = 'localhost'; // The mysql user who will make all the db calls $sql_user = 'sqlusr'; // The mysql user's password $sql_pwd = 'pwd'; // EXPORT DIRECTORY $export_dir = $ark_dir.'data/tmp/'; // FILE DIRECTORIES // Where the files are stored after they are registered (/ after last folder) $registered_files_dir = $doc_root.$ark_dir .'data/files/'; // Where the files are stored after they are registered (/ after last folder) // Browser option: deffault is $ark_dir . 'data/files/ // If the registered files directory is outside the main server directory then you need to setup an alias in httdp.conf $registered_files_host = $ark_dir . 'data/files/'; // Top directory of the file browser - can only search relative to this directory. $default_upload_dir = 'C:/ms4w/Apache/htdocs/ark/data/uploads'; // -- IMAGE CONVERSION- ph magick directory-- // $phMagickDir = 'php/tools/phmagick/phmagick.php'; // MAPPING DIRECTORIES // Path to temp directory (server) $ark_maptemp_dir = 'C:/ms4w/Apache/htdocs'.$ark_dir.'mapserver/tmp'; // Path to temp directory (web) $ark_web_maptemp_dir = 'mapserver/tmp/'; // Path to OpenLayers on local server $openlayers_path = 'mapserver/openlayers_2.10/OpenLayers.js'; // You can also use OpenLayers directly if you are working online //$openlayers_path = 'http://openlayers.org/api/OpenLayers.js'; // if you are using mapserver via the ark_wxs_server.php script then you will need to specify your mapfiles */ $ark_wms_map = 'C:/ms4w/Apache/htdocs/ark/mapserver/mapfiles/ark.map'; // Path to WFS mapfile (server) $ark_wfs_map = 'C:/ms4w/Apache/htdocs/ark/mapserver/mapfiles/ark.map';
Mac
A Mac setup will differ from the above. For projects holding the ARK database on a Mac system, the env_settings.php should look like this:
// BASIC DIRECTORIES // The document root of this virtual host (as set up in your apache conf) $doc_root = '/Applications/MAMP/htdocs'; // The path to the PEAR installation (unix has : first) $pear_path = ':/Applications/MAMP/htdocs/ark/pear'; // The server path to the ark directory $ark_server_path = '/Applications/MAMP/htdocs/ark'; // The folder name of THIS instance of Ark (relative to the document root of the host in which it is hosted) $ark_dir = '/ark/'; // DATABASE CONNECTION // The mysql db name of this instance of ark $ark_db = 'ark'; // The mysqlserver $sql_server = 'localhost'; // The mysql user who will make all the db calls $sql_user = 'sqluser'; // The mysql user's password $sql_pwd = 'sqlpassword'; // EXPORT DIRECTORY $export_dir = $ark_dir.'data/tmp/'; // FILE DIRECTORIES // Where the files are stored after they are registered (/ after last folder) $registered_files_dir = $doc_root.$ark_dir .'data/files/'; // Where the files are stored after they are registered (/ after last folder) // Browser option: deffault is $ark_dir . 'data/files/ // If the registered files directory is outside the main server directory then you need to setup an alias in httdp.conf $registered_files_host = $ark_dir . 'data/files/'; // Top directory of the file browser - can only search relative to this directory. $default_upload_dir = '/Applications/MAMP/htdocs/ark/data/uploads/'; // -- IMAGE CONVERSION- ph magick directory-- // $phMagickDir = 'php/tools/phmagick/phmagick.php'; // MAPPING DIRECTORIES // Path to temp directory (server) $ark_maptemp_dir = '/Applications/MAMP/htdocs/'.$ark_dir.'mapserver/tmp'; // Path to temp directory (web) $ark_web_maptemp_dir = 'mapserver/tmp/'; // Path to OpenLayers on local server $openlayers_path = 'mapserver/openlayers_2.10/OpenLayers.js'; // You can also use OpenLayers directly if you are working online //$openlayers_path = 'http://openlayers.org/api/OpenLayers.js'; // if you are using mapserver via the ark_wxs_server.php script then you will need to specify your mapfiles */ $ark_wms_map = '/Applications/MAMP/htdocs/ark/mapserver/mapfiles/ark.map'; // Path to WFS mapfile (server) $ark_wfs_map = '/Applications/MAMP/htdocs/ark/mapserver/mapfiles/ark.map';
Linux
When using a linux system, users will need to use the following env_settings.php configuration:
// BASIC DIRECTORIES // The document root of this virtual host (as set up in your apache conf) $doc_root = '/srv/www/htdocs/ark/'; // The path to the PEAR installation (unix has : first) $pear_path = ':/srv/www/htdocs/ark/pear'; // The server path to the ark directory $ark_server_path = '/srv/www/htdocs/ark'; // The folder name of THIS instance of Ark (relative to the document root of the host in which it is hosted) $ark_dir = '/ark/'; //DATABASE CONNECTION // The mysql db name of this instance of ark $ark_db = 'ark'; // The mysqlserver $sql_server = 'localhost'; // The mysql user who will make all the db calls $sql_user = 'sqluser'; // The mysql user's password $sql_pwd = 'sqlpassword'; // EXPORT DIRECTORY $export_dir = $ark_dir.'data/tmp/'; // FILE DIRECTORIES // Where the files are stored after they are registered (/ after last folder) $registered_files_dir = $doc_root.$ark_dir .'data/files/'; // Where the files are stored after they are registered (/ after last folder) // Browser option: deffault is $ark_dir . 'data/files/ // If the registered files directory is outside the main server directory then you need to setup an alias in httdp.conf $registered_files_host = $ark_dir . 'data/files/'; // Top directory of the file browser - can only search relative to this directory. $default_upload_dir = '/srv/www/htdocs/ark/data/uploads'; // -- IMAGE CONVERSION- ph magick directory-- // $phMagickDir = 'php/tools/phmagick/phmagick.php'; // MAPPING DIRECTORIES // Path to temp directory (server) $ark_maptemp_dir = '/srv/www/htdocs/'.$ark_dir.'mapserver/tmp'; // Path to temp directory (web) $ark_web_maptemp_dir = 'mapserver/tmp/'; // Path to OpenLayers on local server $openlayers_path = 'mapserver/openlayers_2.10/OpenLayers.js'; // You can also use OpenLayers directly if you are working online //$openlayers_path = 'http://openlayers.org/api/OpenLayers.js'; // if you are using mapserver via the ark_wxs_server.php script then you will need to specify your mapfiles */ $ark_wms_map = '/srv/www/htdocs/ark/mapserver/mapfiles/ark.map'; // Path to WFS mapfile (server) $ark_wfs_map = '/srv/www/htdocs/ark/mapserver/mapfiles/ark.map';
Example Configuration
All together, the env_settings.php file will look different depending on your server setup. A full example of each is shown below.
// -- SERVER SPECIFIC STUFF -- // // Setup the server being used. At the moment this is set to ms4w (windows), mac and linux // it is possible to add more different servers if need be just copy the information from the relevant case. $server = "ms4w"; switch($server){ case "ms4w": // BASIC DIRECTORIES // The document root of this virtual host (as set up in your apache conf) $doc_root = 'C:\ms4w\Apache\htdocs'; // The path to the PEAR installation (windows has ; first) $pear_path = ";C:\ms4w\Apache\htdocs\ark_v1\pear"; // The server path to the ark directory $ark_server_path = 'C:\ms4w\Apache\htdocs\ark_v1'; // The folder name of THIS instance of Ark (relative to the document root of the host in which it is hosted) $ark_dir = '/ark_v1/'; // DATABASE CONNECTION // The mysql db name of this instance of ark $ark_db = 'ark_v1'; // The mysqlserver $sql_server = 'localhost'; // The mysql user who will make all the db calls $sql_user = 'sql_php_user'; // The mysql user's password $sql_pwd = 'AtR410AD'; // EXPORT DIRECTORY $export_dir = $ark_dir.'data/tmp/'; // FILE DIRECTORIES // Where the files are stored after they are registered (/ after last folder) $registered_files_dir = $doc_root.$ark_dir .'data/files/'; // Where the files are stored after they are registered (/ after last folder) // Browser option: deffault is $ark_dir . 'data/files/ // If the registered files directory is outside the main server directory then you need to setup an alias in httdp.conf $registered_files_host = $ark_dir . 'data/files/'; // Top directory of the file browser - can only search relative to this directory. $default_upload_dir = 'C:/ms4w/Apache/htdocs/ark_v1/data/uploads'; // -- IMAGE CONVERSION- ph magick directory-- // $phMagickDir = 'php/tools/phmagick/phmagick.php'; // MAPPING DIRECTORIES // Path to temp directory (server) $ark_maptemp_dir = 'C:/ms4w/Apache/htdocs'.$ark_dir.'mapserver/tmp'; // Path to temp directory (web) $ark_web_maptemp_dir = 'mapserver/tmp/'; // Path to OpenLayers on local server $openlayers_path = 'mapserver/openlayers_2.10/OpenLayers.js'; // You can also use OpenLayers directly if you are working online //$openlayers_path = 'http://openlayers.org/api/OpenLayers.js'; // if you are using mapserver via the ark_wxs_server.php script then you will need to specify your mapfiles */ $ark_wms_map = 'C:/ms4w/Apache/htdocs/ark_v1/mapserver/mapfiles/ark.map'; // Path to WFS mapfile (server) $ark_wfs_map = 'C:/ms4w/Apache/htdocs/ark_v1/mapserver/mapfiles/ark.map'; break; case "mac": // BASIC DIRECTORIES // The document root of this virtual host (as set up in your apache conf) $doc_root = '/Applications/MAMP/htdocs'; // The path to the PEAR installation (unix has : first) $pear_path = ':/Applications/MAMP/htdocs/ark/pear'; // The server path to the ark directory $ark_server_path = '/Applications/MAMP/htdocs/ark'; // The folder name of THIS instance of Ark (relative to the document root of the host in which it is hosted) $ark_dir = '/ark/'; // DATABASE CONNECTION // The mysql db name of this instance of ark $ark_db = 'ark'; // The mysqlserver $sql_server = 'localhost'; // The mysql user who will make all the db calls $sql_user = 'sqluser'; // The mysql user's password $sql_pwd = 'sqlpassword'; // EXPORT DIRECTORY $export_dir = $ark_dir.'data/tmp/'; // FILE DIRECTORIES // Where the files are stored after they are registered (/ after last folder) $registered_files_dir = $doc_root.$ark_dir .'data/files/'; // Where the files are stored after they are registered (/ after last folder) // Browser option: deffault is $ark_dir . 'data/files/ // If the registered files directory is outside the main server directory then you need to setup an alias in httdp.conf $registered_files_host = $ark_dir . 'data/files/'; // Top directory of the file browser - can only search relative to this directory. $default_upload_dir = '/Applications/MAMP/htdocs/ark/data/uploads/'; // -- IMAGE CONVERSION- ph magick directory-- // $phMagickDir = 'php/tools/phmagick/phmagick.php'; // MAPPING DIRECTORIES // Path to temp directory (server) $ark_maptemp_dir = '/Applications/MAMP/htdocs/'.$ark_dir.'mapserver/tmp'; // Path to temp directory (web) $ark_web_maptemp_dir = 'mapserver/tmp/'; // Path to OpenLayers on local server $openlayers_path = 'mapserver/openlayers_2.10/OpenLayers.js'; // You can also use OpenLayers directly if you are working online //$openlayers_path = 'http://openlayers.org/api/OpenLayers.js'; // if you are using mapserver via the ark_wxs_server.php script then you will need to specify your mapfiles */ $ark_wms_map = '/Applications/MAMP/htdocs/ark/mapserver/mapfiles/ark.map'; // Path to WFS mapfile (server) $ark_wfs_map = '/Applications/MAMP/htdocs/ark/mapserver/mapfiles/ark.map'; break; case "linux": // BASIC DIRECTORIES // The document root of this virtual host (as set up in your apache conf) $doc_root = '/srv/www/htdocs/ark/'; // The path to the PEAR installation (unix has : first) $pear_path = ':/srv/www/htdocs/ark/pear'; // The server path to the ark directory $ark_server_path = '/srv/www/htdocs/ark'; // The folder name of THIS instance of Ark (relative to the document root of the host in which it is hosted) $ark_dir = '/ark/'; //DATABASE CONNECTION // The mysql db name of this instance of ark $ark_db = 'ark'; // The mysqlserver $sql_server = 'localhost'; // The mysql user who will make all the db calls $sql_user = 'sqluser'; // The mysql user's password $sql_pwd = 'sqlpassword'; // EXPORT DIRECTORY $export_dir = $ark_dir.'data/tmp/'; // FILE DIRECTORIES // Where the files are stored after they are registered (/ after last folder) $registered_files_dir = $doc_root.$ark_dir .'data/files/'; // Where the files are stored after they are registered (/ after last folder) // Browser option: deffault is $ark_dir . 'data/files/ // If the registered files directory is outside the main server directory then you need to setup an alias in httdp.conf $registered_files_host = $ark_dir . 'data/files/'; // Top directory of the file browser - can only search relative to this directory. $default_upload_dir = '/srv/www/htdocs/ark/data/uploads'; // -- IMAGE CONVERSION- ph magick directory-- // $phMagickDir = 'php/tools/phmagick/phmagick.php'; // MAPPING DIRECTORIES // Path to temp directory (server) $ark_maptemp_dir = '/srv/www/htdocs/'.$ark_dir.'mapserver/tmp'; // Path to temp directory (web) $ark_web_maptemp_dir = 'mapserver/tmp/'; // Path to OpenLayers on local server $openlayers_path = 'mapserver/openlayers_2.10/OpenLayers.js'; // You can also use OpenLayers directly if you are working online //$openlayers_path = 'http://openlayers.org/api/OpenLayers.js'; // if you are using mapserver via the ark_wxs_server.php script then you will need to specify your mapfiles */ $ark_wms_map = '/srv/www/htdocs/ark/mapserver/mapfiles/ark.map'; // Path to WFS mapfile (server) $ark_wfs_map = '/srv/www/htdocs/ark/mapserver/mapfiles/ark.map'; break; }