Difference between revisions of "Env settings.php"

From ARK
Jump to: navigation, search
 
(21 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 
__TOC__
 
__TOC__
  
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.  
+
This file contains settings for the specific server environment. This is to separate the settings relating to the server environment from the settings that relate directly to the instance of ARK itself. In order to make life easier for admins, three standard types of server environments are included in the default file. Currently ARK is provided with default setups for Windows, Mac, or Linux servers.
  
==Server Specific Information==
+
The [[env_settings.php]] file is configured in a standard ARK to be included from within the standard [[settings.php]] file and should not need to be included by name into any page.
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:'''
+
The directives in this file relate mostly to paths, some attention needs to be paid to ensuring that these paths exist and are readable by your webserver. Some paths also need to be writeable.
*'''$doc_root''' - The document root of the your virtual host
+
 
*'''$pear_path''' - The path to your PEAR installation
+
As a rule, you should first switch to the correct type of server environment and then verify the paths for that specific environment. If you are using a Windows server, you ONLY edit the settings for windows.
*'''$ark_server_path''' - The full server path to your ARK directory
+
 
*'''$ark_dir''' - Your ARK directory
+
'''YOU MUST UPDATE THE SERVER SPECIFIC INFORMATION BEFORE YOUR ARK INSTALLATION WILL FUNCTION'''
*'''$ark_db''' - Your ARK database
+
 
*'''$sql_server''' - The MySQL server
+
==Directives==
*'''$sql_user''' - The MySQL user who will make db calls
+
 
*'''$sql_pwd''' - The MySQL user password
+
===Server Type===
*'''$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
+
====$server====
*'''$registered_files_host''' - ***
+
The type of server being used. Once selected, the directives for that server type need to be verified.
*'''$default_upload_dir''' -  The top directory of the file directory, can only search below this folder for uploading files
+
*'''Permitted options:''' = linux|mac|windows
*'''$phMagickDir''' - phMagick directory, if using for Image Conversion
+
 
*'''$ark_maptemp_dir''' - Path to temporary map directory (on server)
+
===General Paths===
*'''$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_dir====
*'''$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)
+
This is the ARK directory as it will appear in URLs, relative to the domain. This therefore begins with a forward slash, indicating that it is relative to the highest level in this domain. Where ARK is installed in a subdirectory, this information is added here.
 +
 
 +
Because this refers to a web 'folder' it is followed by a trailing slash.
 +
 
 +
This path should look identical in all types of server, but is included in this server specific section as a convenient way to keep paths grouped together.
  
===MS4W===
+
In Linux and Mac systems that use forward slashes within their filesystem paths (Windows uses backslashes) this variable can be used within other paths in this file to reduce repetition, although for clarity, the default setups write out the paths longhand.
  
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:
+
Example:
  
 +
Linux | Windows | Mac
 +
<pre>
 +
$ark_dir = '/ark/';
 +
Resolves to:
 +
http://www.example.com/ark/
 +
</pre>
 
<pre>
 
<pre>
// BASIC DIRECTORIES
+
$ark_dir = '/my_subfolder/ark/';
        // The document root of this virtual host (as set up in your apache conf)
+
Resolves to:
        $doc_root = 'C:\ms4w\Apache\htdocs';
+
http://www.example.com/my_subfolder/ark/
        // The path to the PEAR installation (windows has ; first)
+
</pre>
        $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
+
====$ark_server_path====
        // Where the files are stored after they are registered (/ after last folder)
+
The full path to the directory containing ARK within the server's filesystem. This resolves the ARK directory back to the filesystem root. In many cases (not all), this is the $doc_root plus the folder containing the ARK installation, therefore subsititution may be used to reduce repetition. In the case of doubt, it doesn't hurt to write this path out longhand to ensure that it points to the right directory.
        $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
+
Examples:
        // Path to temp directory (server)
+
 
        $ark_maptemp_dir = 'C:/ms4w/Apache/htdocs'.$ark_dir.'mapserver/tmp';
+
Linux
        // Path to temp directory (web)
+
<pre>
        $ark_web_maptemp_dir = 'mapserver/tmp/';
+
$pear_path = '/srv/www/htdocs/ark';
        // Path to OpenLayers on local server
+
</pre>
        $openlayers_path = 'mapserver/openlayers_2.10/OpenLayers.js';
+
Mac
        // You can also use OpenLayers directly if you are working online
+
<pre>
        //$openlayers_path = 'http://openlayers.org/api/OpenLayers.js';
+
$pear_path = '/Applications/MAMP/htdocs/ark';
        // if you are using mapserver via the ark_wxs_server.php script then you will need to specify your mapfiles */
+
</pre>
        $ark_wms_map = 'C:/ms4w/Apache/htdocs/ark/mapserver/mapfiles/ark.map';
+
Windows
        // Path to WFS mapfile (server)
+
<pre>
        $ark_wfs_map = 'C:/ms4w/Apache/htdocs/ark/mapserver/mapfiles/ark.map';  
+
$pear_path = 'C:\ms4w\Apache\htdocs\ark';
 
</pre>
 
</pre>
  
===Mac===
+
====$pear_path====
 +
 
 +
The path to your PEAR installation. This is a fully resolved path to the directory that contains the PEAR files. The system will automatically append this path to PHP's include paths at runtime.
 +
 
 +
In versions of ARK =< v1.1 these paths began with a colon or semi colon. This is now not required, and will cause the system to fail to load PEAR properly.
 +
 
 +
Default setup points to the PEAR that ships as a library in ARK.
 +
 
 +
Examples:
  
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:
+
Linux
+
<pre>
 +
$pear_path = '/srv/www/htdocs/ark/lib/php/pear';
 +
</pre>
 +
Mac
 
<pre>
 
<pre>
// BASIC DIRECTORIES
+
$pear_path = '/Applications/MAMP/htdocs/ark/lib/php/pear';
        // The document root of this virtual host (as set up in your apache conf)
+
</pre>
        $doc_root = '/Applications/MAMP/htdocs';
+
Windows
        // The path to the PEAR installation (unix has : first)
+
<pre>
        $pear_path = ':/Applications/MAMP/htdocs/ark/pear';
+
$pear_path = 'C:\ms4w\Apache\htdocs\ark\lib\php\pear';
        // The server path to the ark directory
+
</pre>
        $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
+
In order to reduce repetition, the $ark_server_path variable can be substituted for the beginning of this path in cases that the PEAR resides within the docroot (such as the default setups).
        // 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
+
Examples:
        // Path to temp directory (server)
+
 
        $ark_maptemp_dir = '/Applications/MAMP/htdocs/'.$ark_dir.'mapserver/tmp';
+
Linux
        // Path to temp directory (web)
+
<pre>
        $ark_web_maptemp_dir = 'mapserver/tmp/';
+
$pear_path = $ark_server_path.'/lib/php/pear';
        // 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';
 
 
</pre>
 
</pre>
  
===Linux===
+
===File Paths===
When using a linux system, users will need to use the following env_settings.php configuration:
+
 
 +
====$registered_files_dir====
 +
The directory where ARK stores files after they are processed. This location is relative to the filesystem and must be readable and writeable by the webserver.
 +
 
 +
By default, ARK ships with a "data" folder which contains a "files" folder. In most cases it is convenient to use this structure. Ensure that permissions are set correctly.
  
 +
Examples:
 +
 +
Linux
 
<pre>
 
<pre>
// BASIC DIRECTORIES
+
$registered_files_dir = '/srv/www/htdocs/ark/data/files';
        // The document root of this virtual host (as set up in your apache conf)
+
</pre>
        $doc_root = '/srv/www/htdocs/ark/';
+
Mac
        // The path to the PEAR installation (unix has : first)
+
<pre>
        $pear_path = ':/srv/www/htdocs/ark/pear';
+
$registered_files_dir = '/Applications/MAMP/htdocs/ark/data/files';
        // The server path to the ark directory
+
</pre>
        $ark_server_path = '/srv/www/htdocs/ark';
+
Windows
        // The folder name of THIS instance of Ark (relative to the document root of the host in which it is hosted)
+
<pre>
        $ark_dir = '/ark/';
+
$registered_files_dir = 'C:\ms4w\Apache\htdocs\ark\data\files';
       
+
</pre>
        //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
+
As above, the $ark_server_path can be used as shorthand for part of this path.
        // 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
+
Examples:
        // Path to temp directory (server)
+
 
        $ark_maptemp_dir = '/srv/www/htdocs/'.$ark_dir.'mapserver/tmp';
+
Linux
        // Path to temp directory (web)
+
<pre>
        $ark_web_maptemp_dir = 'mapserver/tmp/';
+
$registered_files_dir = $ark_server_path.'/data/files';
        // 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';
 
 
</pre>
 
</pre>
  
==Example Configuration==
+
====$registered_files_host====
The env_settings.php file will look different depending on your server setup. An example of each is shown below.
+
The folder where files can be found by the webserver. This is relative to the domain (host). This should be the same on all server types.
 +
 
 +
Example:
 +
 
 +
Linux | Windows | Mac
 +
<pre>
 +
$ark_dir = '/ark/data/files/';
 +
Resolves to:
 +
http://www.example.com/ark/data/files/
 +
</pre>
 
<pre>
 
<pre>
// --  SERVER SPECIFIC STUFF -- //
+
$ark_dir = '/my_subfolder/ark/data/files/';
// Setup the server being used. At the moment this is set to ms4w (windows), mac and linux
+
Resolves to:
// it is possible to add more different servers if need be just copy the information from the relevant case.
+
http://www.example.com/my_subfolder/ark/data/files/
$server = "ms4w";
+
</pre>
  
switch($server){
+
====$default_upload_dir====
    case "ms4w":
+
This is the directory which acts as the 'base' for the file uploading interface. This will appear to be the 'top level' for the file browser. This must be relative to the filesystem.
        // 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
+
Examples:
        // 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
+
Linux
        // Path to temp directory (server)
+
<pre>
        $ark_maptemp_dir = 'C:/ms4w/Apache/htdocs'.$ark_dir.'mapserver/tmp';
+
$default_upload_dir = '/home/uploads';
        // Path to temp directory (web)
+
</pre>
        $ark_web_maptemp_dir = 'mapserver/tmp/';
+
Mac
        // Path to OpenLayers on local server
+
<pre>
        $openlayers_path = 'mapserver/openlayers_2.10/OpenLayers.js';
+
$default_upload_dir = '/home/uploads';
        // You can also use OpenLayers directly if you are working online
+
</pre>
        //$openlayers_path = 'http://openlayers.org/api/OpenLayers.js';
+
Windows
        // if you are using mapserver via the ark_wxs_server.php script then you will need to specify your mapfiles */
+
<pre>
        $ark_wms_map = 'C:/ms4w/Apache/htdocs/ark_v1/mapserver/mapfiles/ark.map';
+
$default_upload_dir = 'C:\ms4w\Apache\htdocs\ark\data\uploads';
        // Path to WFS mapfile (server)
+
</pre>
        $ark_wfs_map = 'C:/ms4w/Apache/htdocs/ark_v1/mapserver/mapfiles/ark.map';     
 
    break;
 
  
    case "mac":
+
====$export_dir====
        // 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
+
The directory where CSV and files are saved when created for export. This directory must be relative to the filesystem, must be readable and writeable by the web server.
        // 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
+
Examples:
        // 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":
+
Linux
        // BASIC DIRECTORIES
+
<pre>
        // The document root of this virtual host (as set up in your apache conf)
+
$export_dir = '/srv/www/htdocs/ark/data/tmp';
        $doc_root = '/srv/www/htdocs/ark/';
+
</pre>
        // The path to the PEAR installation (unix has : first)
+
Mac
        $pear_path = ':/srv/www/htdocs/ark/pear';
+
<pre>
        // The server path to the ark directory
+
$export_dir = '/Applications/MAMP/htdocs/ark/data/tmp';
        $ark_server_path = '/srv/www/htdocs/ark';
+
</pre>
        // The folder name of THIS instance of Ark (relative to the document root of the host in which it is hosted)
+
Windows
        $ark_dir = '/ark/';
+
<pre>
       
+
$export_dir = 'C:\ms4w\Apache\htdocs\ark\data\tmp';
        //DATABASE CONNECTION
+
</pre>
        // 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
+
====$phMagickDir====
        // 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
+
This points to the phMagick.php file to be used if required. ARK ships with the phMagick library (ark/lib/php/phMagick/).
        // Path to temp directory (server)
+
 
        $ark_maptemp_dir = '/srv/www/htdocs/'.$ark_dir.'mapserver/tmp';
+
You will need to have GD and ImageMagick installed as modules on your PHP for this library to work. If in doubt look at your phpinfo() to see if both modules are loaded. Also run preflight checks.
        // Path to temp directory (web)
+
 
        $ark_web_maptemp_dir = 'mapserver/tmp/';
+
By default, ARK ships with this line commented out. If you intend to use phMagick (and you have checked that you have GD and ImageMagick), uncomment this directive.
        // Path to OpenLayers on local server
+
 
        $openlayers_path = 'mapserver/openlayers_2.10/OpenLayers.js';
+
Despite the name, this must point to the file, not the directory.
        // You can also use OpenLayers directly if you are working online
+
 
        //$openlayers_path = 'http://openlayers.org/api/OpenLayers.js';
+
Examples:
        // 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';
+
Linux
        // Path to WFS mapfile (server)
+
<pre>
        $ark_wfs_map = '/srv/www/htdocs/ark/mapserver/mapfiles/ark.map';
+
$phMagickDir = $ark_server_path.'/lib/php/phmagick/phmagick.php';
    break;
+
</pre>
}
+
Mac
 +
<pre>
 +
$phMagickDir = $ark_server_path.'/lib/php/phmagick/phmagick.php';
 +
</pre>
 +
Windows
 +
<pre>
 +
$phMagickDir = $ark_server_path.'\lib\php\phmagick\phmagick.php';
 
</pre>
 
</pre>
 +
 +
===Mapping Paths===
 +
====$ark_maptemp_dir====
 +
 +
Path to the directory mapserver uses to store temporary data. Relative to server filesystem.
 +
 +
====$ark_web_maptemp_dir====
 +
 +
Path to the same temporary directory relative to the domain.
 +
 +
====$openlayers_path====
 +
 +
Path to OpenLayers. This is relative to the web and so can be either specified as a local location relative to this domain, or as a fully resolved path to a remote location.
 +
 +
By default, the local version is selected, in order to use a remote location comment this out and comment in the remote location.
 +
 +
====$ark_wms_map====
 +
 +
If you are using Mapserver via the ark_wxs_server.php, you will need to specify the location of the WMS map file. This is related to the server filesystem.
 +
 +
====$ark_wfs_map====
 +
 +
If you are using Mapserver via the ark_wxs_server.php, you will need to specify the location of the WFS map file. This is related to the server filesystem.
 +
 +
===Filesystem===
 +
 +
These directives should not need editing.
 +
 +
====$fs_path_sep====
 +
 +
This indicates how paths are separated in path lists. Windows systems us a semicolon and *nix systems use a colon.
 +
 +
====$fs_slash====
 +
 +
This indicates how folders within a path are separated. Windows systems use a backslash and *nix systems use a forward slash.
 +
 +
===Database Settings===
 +
 +
*'''$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
 +
 +
==DELETED Directives==
 +
 +
====$doc_root====
 +
 +
As of v1.1 this is no longer required, please remove from your files to prevent confusion. This is now completely superseded by $ark_server_path.
 +
 +
==Example Setups==
 +
 +
Example setups are provided in the [[env_settings.php]] file that ships in the packaged code.
  
 
[[category:Administrator]]
 
[[category:Administrator]]

Latest revision as of 13:11, 6 December 2012

This file contains settings for the specific server environment. This is to separate the settings relating to the server environment from the settings that relate directly to the instance of ARK itself. In order to make life easier for admins, three standard types of server environments are included in the default file. Currently ARK is provided with default setups for Windows, Mac, or Linux servers.

The env_settings.php file is configured in a standard ARK to be included from within the standard settings.php file and should not need to be included by name into any page.

The directives in this file relate mostly to paths, some attention needs to be paid to ensuring that these paths exist and are readable by your webserver. Some paths also need to be writeable.

As a rule, you should first switch to the correct type of server environment and then verify the paths for that specific environment. If you are using a Windows server, you ONLY edit the settings for windows.

YOU MUST UPDATE THE SERVER SPECIFIC INFORMATION BEFORE YOUR ARK INSTALLATION WILL FUNCTION

Directives

Server Type

$server

The type of server being used. Once selected, the directives for that server type need to be verified.

  • Permitted options: = linux|mac|windows

General Paths

$ark_dir

This is the ARK directory as it will appear in URLs, relative to the domain. This therefore begins with a forward slash, indicating that it is relative to the highest level in this domain. Where ARK is installed in a subdirectory, this information is added here.

Because this refers to a web 'folder' it is followed by a trailing slash.

This path should look identical in all types of server, but is included in this server specific section as a convenient way to keep paths grouped together.

In Linux and Mac systems that use forward slashes within their filesystem paths (Windows uses backslashes) this variable can be used within other paths in this file to reduce repetition, although for clarity, the default setups write out the paths longhand.

Example:

Linux | Windows | Mac

$ark_dir = '/ark/';
Resolves to:
http://www.example.com/ark/
$ark_dir = '/my_subfolder/ark/';
Resolves to:
http://www.example.com/my_subfolder/ark/

$ark_server_path

The full path to the directory containing ARK within the server's filesystem. This resolves the ARK directory back to the filesystem root. In many cases (not all), this is the $doc_root plus the folder containing the ARK installation, therefore subsititution may be used to reduce repetition. In the case of doubt, it doesn't hurt to write this path out longhand to ensure that it points to the right directory.

Examples:

Linux

$pear_path = '/srv/www/htdocs/ark';

Mac

$pear_path = '/Applications/MAMP/htdocs/ark';

Windows

$pear_path = 'C:\ms4w\Apache\htdocs\ark';

$pear_path

The path to your PEAR installation. This is a fully resolved path to the directory that contains the PEAR files. The system will automatically append this path to PHP's include paths at runtime.

In versions of ARK =< v1.1 these paths began with a colon or semi colon. This is now not required, and will cause the system to fail to load PEAR properly.

Default setup points to the PEAR that ships as a library in ARK.

Examples:

Linux

$pear_path = '/srv/www/htdocs/ark/lib/php/pear';

Mac

$pear_path = '/Applications/MAMP/htdocs/ark/lib/php/pear';

Windows

$pear_path = 'C:\ms4w\Apache\htdocs\ark\lib\php\pear';

In order to reduce repetition, the $ark_server_path variable can be substituted for the beginning of this path in cases that the PEAR resides within the docroot (such as the default setups).

Examples:

Linux

$pear_path = $ark_server_path.'/lib/php/pear';

File Paths

$registered_files_dir

The directory where ARK stores files after they are processed. This location is relative to the filesystem and must be readable and writeable by the webserver.

By default, ARK ships with a "data" folder which contains a "files" folder. In most cases it is convenient to use this structure. Ensure that permissions are set correctly.

Examples:

Linux

$registered_files_dir = '/srv/www/htdocs/ark/data/files';

Mac

$registered_files_dir = '/Applications/MAMP/htdocs/ark/data/files';

Windows

$registered_files_dir = 'C:\ms4w\Apache\htdocs\ark\data\files';

As above, the $ark_server_path can be used as shorthand for part of this path.

Examples:

Linux

$registered_files_dir = $ark_server_path.'/data/files';

$registered_files_host

The folder where files can be found by the webserver. This is relative to the domain (host). This should be the same on all server types.

Example:

Linux | Windows | Mac

$ark_dir = '/ark/data/files/';
Resolves to:
http://www.example.com/ark/data/files/
$ark_dir = '/my_subfolder/ark/data/files/';
Resolves to:
http://www.example.com/my_subfolder/ark/data/files/

$default_upload_dir

This is the directory which acts as the 'base' for the file uploading interface. This will appear to be the 'top level' for the file browser. This must be relative to the filesystem.

Examples:

Linux

$default_upload_dir = '/home/uploads';

Mac

$default_upload_dir = '/home/uploads';

Windows

$default_upload_dir = 'C:\ms4w\Apache\htdocs\ark\data\uploads';

$export_dir

The directory where CSV and files are saved when created for export. This directory must be relative to the filesystem, must be readable and writeable by the web server.

Examples:

Linux

$export_dir = '/srv/www/htdocs/ark/data/tmp';

Mac

$export_dir = '/Applications/MAMP/htdocs/ark/data/tmp';

Windows

$export_dir = 'C:\ms4w\Apache\htdocs\ark\data\tmp';

$phMagickDir

This points to the phMagick.php file to be used if required. ARK ships with the phMagick library (ark/lib/php/phMagick/).

You will need to have GD and ImageMagick installed as modules on your PHP for this library to work. If in doubt look at your phpinfo() to see if both modules are loaded. Also run preflight checks.

By default, ARK ships with this line commented out. If you intend to use phMagick (and you have checked that you have GD and ImageMagick), uncomment this directive.

Despite the name, this must point to the file, not the directory.

Examples:

Linux

$phMagickDir = $ark_server_path.'/lib/php/phmagick/phmagick.php';

Mac

$phMagickDir = $ark_server_path.'/lib/php/phmagick/phmagick.php';

Windows

$phMagickDir = $ark_server_path.'\lib\php\phmagick\phmagick.php';

Mapping Paths

$ark_maptemp_dir

Path to the directory mapserver uses to store temporary data. Relative to server filesystem.

$ark_web_maptemp_dir

Path to the same temporary directory relative to the domain.

$openlayers_path

Path to OpenLayers. This is relative to the web and so can be either specified as a local location relative to this domain, or as a fully resolved path to a remote location.

By default, the local version is selected, in order to use a remote location comment this out and comment in the remote location.

$ark_wms_map

If you are using Mapserver via the ark_wxs_server.php, you will need to specify the location of the WMS map file. This is related to the server filesystem.

$ark_wfs_map

If you are using Mapserver via the ark_wxs_server.php, you will need to specify the location of the WFS map file. This is related to the server filesystem.

Filesystem

These directives should not need editing.

$fs_path_sep

This indicates how paths are separated in path lists. Windows systems us a semicolon and *nix systems use a colon.

$fs_slash

This indicates how folders within a path are separated. Windows systems use a backslash and *nix systems use a forward slash.

Database Settings

  • $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

DELETED Directives

$doc_root

As of v1.1 this is no longer required, please remove from your files to prevent confusion. This is now completely superseded by $ark_server_path.

Example Setups

Example setups are provided in the env_settings.php file that ships in the packaged code.