Site Configuration

From EIRMA Wiki

Jump to: navigation, search
Quick Links

Overview and Tutorial


Pre-Installation

  • Site Configuration

Installation

Post-Installation


Administration


Moderation


Design


Advanced


Other

Contents


Compatibility

The supported version of LDM is compatible with versions 3.7 and 3.8 of vBulletin and requires the same PHP and MySQL versions as vBulletin. All features work correctly on Windows and Linux servers.

PHP versions greater than 4.4.0 and 5.1.0 are required for search highlighting to work correctly with languages that use UTF8-based character sets.

Versions of LDM up to 2.3.0 integrate with versions 3.x of vbAdvanced. On Windows-based servers, there is a small bug in vbAdvanced with some versions of PHP, which requires a minor change to the code.

Older versions of LDM which work with vBulletin 3.5.x and 3.0.x remain available on vBulletin.org but are no longer supported.

Server Configuration

Standard web servers generally run LDM without difficulty if vBulletin is functioning properly. There is a known problem with some versions of Microsoft's IIS web server running PHP in CGI mode, see below.

Problems may arise depending on settings in php.ini. You can use (e.g.) the phpinfo facility [VB Admincp/Import and Maintenance/View PHP info] to review the settings described below. Once installed, LDM checks key settings and displays these on all main LDM admin pages, see image.

IIS Servers and DOCUMENT_ROOT

With some versions of Microsoft's IIS server running PHP in CGI mode, a key environment variable DOCUMENT_ROOT is not set. If LDM discovers this situation, it will report Document Root not set and stop. To correct this problem, edit includes/local_links_init.php. Find the line

// define('LDM_DOCUMENT_ROOT', '/path/to/your/site');

uncomment it, and replace /path/to/your/site with the full pathway to your web site's home directory (NB: not the forum directory).

Accessing Remote Files - The cURL extension

LDM can manage uploads and downloads of files stored on the local web server, and downloads from (but not uploads to) remote servers. It can access remote sites in two ways:

  • Using the cURL library
  • Using the file handling routines built into the standard php library

If your web server includes the cURL library, LDM will use this by default, as this is more secure and offers more features than the standard php library. (The LDM admin setting force_fopen can be used to force LDM to use the php library.)

On some servers, the cURL library is not installed. Other sites explicitly block remote file handling using the standard php file handling routines, by disabling the php setting allow_url_fopen. If both conditions apply, LDM cannot:

  • manage downloads of remote files
  • check the status of urls
  • display thumbnails of image files stored on a remote server

In this situation, you can still use LDM:

  • to manage downloads that are stored on the local web server and specified using a local filename (i.e. with no url), and
  • to access any links (entries with filetypes that do not appear in the VBulletin attachments table).

Limiting Access to Local Files - the open_basedir Setting

Site administrators use the parameter open_basedir in the php.ini file to controls which parts of the local directory tree can be accessed by web scripts.

This can restrict some features of LDM, for example:

  • Uploads, downloads and the image thumbnail cache cannot be held outside the authorised directories
  • The file_icons_dir setting (used to add illustrative icons to downloads) must also point within the authorised directories

LDM shows the current setting of open_basedir on its adminstration pages. If this parameter is set, avoid problems by ensuring that LDM's local_file_root and local_file_root_prefix settings point within the allowed space.

If you have problems cause by open_basedir, the workaround is clear: either modify open_basedir or change where you store files.

Restricted PHP functions

Some sites disable access to certain PHP functions in order to improve security. LDM versions 3.0.1 and higher check that key, but commonly disabled functions, such as fpassthru(), fopen(), fread(), etc. are available and provide suitable warnings, since without these functions LDM cannot operate.

Output Buffering

If you run LDM on a Windows server, especially using Microsoft's web server software rather than Apache, check the setting of output_buffering in your php.ini. Setting this 'On' (rather than to a particular numerical value) improves performance dramatically.

Safe Mode

The file upload facility is unlikely to work if your site runs in safe mode. You may try setting the owenership of the directory used to hold these uploads to the userid running the web site, although this has not been tested and is probably bad security practice.

Graphics Library

By default, LDM uses the PHP GD2 library to create image thumbnails. Version 2.3.0 included an 'extra' to patch LDM to use the GD2 or ImageMagick library according to the image options chosen for vBulletin, and this has become part of the standard code with effect from release 3.0.1.

The GD2 library is limited to handling image files in .gif, .jpg and .png formats. It is also potentially quite memory-intensive, for example when creating thumbnail images of high resolution files. ImageMagick can handle many more formats but is less tightly-integrated with the PHP library.

Upload Size Limits

Two settings in php.ini place overall limits on the size of uploads:

  • upload_max_filesize
  • post_max_size

It is important that the value of post_max_size is larger than the value of upload_max_filesize. (If you plan to allow users to upload "N" files at the same time, then post_max_size should bigger than N-times upload_max_filesize.) Otherwise you will experience strange errors (for example about missing security tokens) if you try to upload a file that is larger than upload_max_filesize.

The two settings define the overall maximum size of file uploads. Within these limits, more restrictive settings can be applied on a per-filetype basis (vBulletin->admincp->attachments->attachment manager).

The Suhosin Module

Suhosin, aka the Hardened PHP project, is an advanced protection system designed to protect servers and users from flaws in PHP applications and the PHP core. Some sites use it to protect servers that are running vBulletin.

Suhosin can create strange problems. One example is that when users submit forms (for example, to create a category), nothing happens or they get a message suggesting that they did something wrong. These errors are caused by limits on the number of form parameters that Sohosin passes through to the server, and are remedied by changing Suhosin's control parameters. Give particular attention to the following settings:

suhosin.*.max_array_depth
suhosin.*.max_array_index_length
suhosin.*.max_name_length
suhosin.*.max_totalname_length
suhosin.*.max_value_length
suhosin.*.max_vars

where * is get, post, and request.

It is not possible to give precise estimates of the required values for these settings, other than to say that the default values are generally too small by a factor of 2-3.

Mimetype Headers

It is generally possible to control file transfers using LDM configuration settings. However, in some situations (specifically, when LDM is configured to handle a filetype as a link rather than as a download), it may be necessary to adjust the server settings to send the correct mimetype information for that filetype. See Configuring Filetypes for further information.

Renaming the Database Tables

The LDM database tables are normally given names with the prefix local_, e.g. local_linkslink is the main 'entries' table. This is specified in includes/local_links_init.php by the statement:

define('THIS_TABLE', 'local_')

Edit this file if you wish. There is a hint given how to change the prefix to match your standard VB table prefix.

Warning - if you modify this prefix when you install LDM, remember to make the same changes each time you upgrade. Otherwise, your users will find themselves looking at an empty LDM database. (Don't worry, nothing has been lost. The contents will reappear when you reapply the edit.)

Renaming the PHP Scripts

All LDM's php scripts also have names prefixed with local, e.g. local_links.php, etc. You can rename the main scripts in the forums directory (the scripts which users access directly) by editing the corresponding lines in local_links_init.php:

define('LINKS_SCRIPT',  'local_links');
define('ACTION_SCRIPT', 'local_links_actions');
define('ADMIN_SCRIPT',  'local_links_admin');
define('SEARCH_SCRIPT', 'local_links_search');
define('STREAM_SCRIPT', 'local_stream');
define('RESIZE_SCRIPT', 'local_resize');

and all lines in includes/xml/cpnav_xlinks.xml containing

local_links_admin.php

Do not rename the files in the subdirectories (includes/, etc) without checking and modifying all the include statements throughout LDM.

A similar effect can be obtained by using a url-rewriter, e.g. Apache's mod_rewrite or vbSEO, see Search Engine Optimisation.

URL protocols

LDM can access files using various protocols:

  • HTTP and FTP protocols are available by default
  • HTTPS and FTPS protocols depend on having openssl compiled into php.
  • IRC protocol is supported but requires that the user has a self-launching irc client.
  • MMS protocol is supported for streaming media files. The stream_mms_videos extra im[roves handling of this protocol.
Personal tools