1. General Configuration Options

While OJS strives to be an easily-installed, low-maintenance system requiring minimal external configuration, a handful of options need direct system access to be configured. These options are largely set in config.inc.php. The following is not a comprehensive breakdown of that file - rather, it you will find here instructions on administering the most commonly changed components.

Note

When you enable an option in config.inc.php you must ensure that it is not commented out in order for them to take effect. Lines in this file are commented out using a semi-colon. Therefore, to enable Scheduled Tasks,

; scheduled_tasks = Off

should be changed to

scheduled_tasks = On

in order to function properly.

1.1. Scheduled Tasks

OJS includes a scheduled tasks script that will periodically execute certain tasks (such as send out periodic Review Reminder emails). To enable this script, you will have to enable the option in config.inc.php, and also set up the appropriate cron job on your server.

Open config.inc.php and under the general section find

; scheduled_tasks = Off

Change that line to

scheduled_tasks = On

keeping in mind to remove the semi-colon at the beginning of the line.

You will then need to instruct your server to periodically execute (as the same user your webserver is running under) the PHP script found at tools/runScheduledTasks.php in your OJS directory. On *nix operating systems, this is typically done by adding a simple cron task, whereas on Windows systems you can use the Windows Task Scheduler. Detailed instructions for each can be found in docs/README.

If using the scheduled tasks script, it is recommended that the script be set up to execute at least once per day.

On *nix operating systems, this can be done by adding a simple cron task:

# crontab -e www
0 * * * *       php /path/to/ojs2/tools/runScheduledTasks.php

In this example the script would be executed every hour.

On Windows XP systems, this can be done by using the Windows Task Scheduler:

  1. From the Control Panel, double-click on Scheduled Tasks.

  2. Right-click within the Scheduled Tasks window and choose: New > Scheduled Task

  3. Under the Task tab, in the Run field, enter: php c:\path\to\ojs2\tools\runScheduledTasks.php

  4. You will also be asked to specify the folder to start this task in (which will usually be the folder that PHP was installed into) and the user under which the task will be executed as.

  5. Under Schedule tab and the Settings tab, you can more specifically configure the task. For example, you can choose start and end dates for this scheduled task and also how often to execute this task.

1.2. Email Settings

By default, OJS uses PHP's mail() function to send email. You can configure OJS to use SMTP to send mail instead. To do so, you will need to uncomment and configure the relevant lines in config.inc.php, under the Email Settings subheading. Your final configuration might look something like the following:

; Use SMTP for sending mail instead of mail()
smtp = On
    
; SMTP server settings
smtp_server = mail.example.com
smtp_port = 25
    
; Enable SMTP authentication
; Supported mechanisms: PLAIN, LOGIN, CRAM-MD5, and DIGEST-MD5
smtp_auth = PLAIN
smtp_username = username
smtp_password = password

You will have to find the appropriate SMTP information (server, port, authentication type, username and password) from your ISP.

To allow for notification of bounced emails (sent to the email address specified in Journal Setup 1.4) you will have to uncomment and enable the envelope_sender configuration option in config.inc.php; you may also want to provide a default email address.

; Allow envelope sender to be specified
; (may not be possible with some server configurations)
allow_envelope_sender = On

; Default envelope sender to use if none is specified elsewhere
default_envelope_sender = my_address@my_host.com

There are a number of other email options in config.inc.php but they are sufficiently explained in the configuration file, and are rarely, if ever, changed from the default.

1.3. CAPTCHA Settings

You can configure OJS to use CAPTCHA challenges to prevent user registration and comment abuse. Find the CAPTCHA Settings section in config.inc.php and uncomment and change to the following:

[captcha]

; Whether or not to enable Captcha features
captcha = On

; Whether or not to use Captcha on user registration
captcha_on_register = On

; Whether or not to use Captcha on user comments
captcha_on_comments = On

; Font location for font to use in Captcha images
font_location = /usr/share/fonts/truetype/freefont/FreeSerif.ttf

Please note that your server needs to support the IMLIB library for this to work, and that you need to point your font_location variable to a font that exists on your system, which may be different than the default provided.

1.4. Debugging Options

If things start to go strange with your OJS installation, you have several debugging options available to you.

  • If you encounter a blank page, chances are there's a PHP error of some sort happening in the background. PHP errors are normally sent to your web server or system log file. To send any PHP errors to the browser, put the following line near the top of the root index.php file:

    ini_set('display_errors', E_ALL);

    When you rerun the task or reload the page you were having problems with, any PHP error messages that were being sent to the log files should now be displayed on the web page.

    Note

    Of course, you can always check your server's error log for errors as well.

There are also a number of debugging variables in config.inc.php.

  • You can set the system to display database output in the page header. Under the Database Settings section of config.inc.php, set the debug variable to On:

    ; Enable database debug output (very verbose!)
    debug = On

    Turning database debugging on will display every database query for that particular page, regardless of any errors (or the lack thereof) in the page header. You may also see a few warnings about headers in the debug info too: those are harmless and can be ignored.

    With debug turned on, certain parts of the system may not function (for example, trying to log in). The debug option should only be used to try and diagnose a problem and may expose private information. Additionally, as the warning in the config file suggests, it is very verbose - it prints out every database query regardless of whether the system has encountered an error, and so should not be turned on by default.

  • Turning on show_stats (Under Debug Settings at the end of config.inc.php) will display execution stats provided by the included PHP Quick Profiler.

    ; Display execution stats in the footer
    show_stats =  On

    The Profiler will give you information and metrics on load times, database queries, files included, and more, and is useful for pinpointing bottlenecks and other points of failure.

  • The stack_trace option (found just after the show_stats option) will cause OJS to display a full dump of the current call stack if an error occurs. This makes it easier to find out where in the process of execution an error occurred, by displaying the full list of functions that are running at the time. It may expose a variety of private information, depending on where the error occurs, and should be left disabled on a production machine.