Config¶
Config variables are stored in the config.php
file at the root of the www
directory.
Unlike Settings, config options cannot be updated via the admin page and instead must
be edited directly by modifying the contents of config.php
.Below you will find detailed
information on each option.
Config.php¶
The file config.php file is located in newznab/www
looks like this:
<?php
//=========================
// Config you must change - updated by installer.
//=========================
define('DB_TYPE', 'mysql');
define('DB_HOST', 'localhost');
define('DB_PORT', 3306);
define('DB_USER', 'username');
define('DB_PASSWORD', 'password');
define('DB_NAME', 'newznab');
define('DB_INNODB', false);
define('DB_PCONNECT', true);
define('DB_ERRORMODE', PDO::ERRMODE_SILENT);
define('NNTP_USERNAME', 'username');
define('NNTP_PASSWORD', 'password');
define('NNTP_SERVER', 'my.newsserver.com');
define('NNTP_PORT', '563');
define('NNTP_SSLENABLED', true);
define('CACHEOPT_METHOD', 'none');
define('CACHEOPT_TTLFAST', '120');
define('CACHEOPT_TTLMEDIUM', '600');
define('CACHEOPT_TTLSLOW', '1800');
define('CACHEOPT_MEMCACHE_SERVER', '127.0.0.1');
define('CACHEOPT_MEMCACHE_PORT', '11211');
// define('EXTERNAL_PROXY_IP', ''); //Internal address of public facing server
// define('EXTERNAL_HOST_NAME', ''); //The external hostname that should be used
require("automated.config.php");
DB_TYPE¶
Currently the only option for this is mysql
and is not used.
The default setting for this option is mysql
.
DB_HOST¶
The database server which has the Newznab database on it. localhost
if the database is on the same webserver as Newznab. This can be fully qualified name, IP address, ‘localhost’ or ‘127.0.0.1’.
The default setting for this option is localhost
.
DB_USER¶
The username to access the database.
DB_PASSWORD¶
The password for DB_USER
.
DB_INNODB¶
This changes the behaviour of how deletes are done on the database. If you are using InnoDB tables, set this to True
.
The default for this option is false
.
DB_PCONNECT¶
Forces a persistent connection to the database server.
The default setting for this option is True
.
DB_ERRORMODE¶
This attribute controls how the PHP Data Object (PDO) error reporting mode operates.
The options for this are:
PDO::ERRMODE_SILENT
PDO::ERRMODE_WARNING
PDO::ERRMODE_EXCEPTION
The default setting for this option is PDO::ERRMODE_SILENT
.
NNTP_USERNAME¶
Your username for your news server.
NNTP_PASSWORD¶
Your password for NNTP_USERNAME
NNTP_SERVER¶
The fully qualified domain name of your news server.
NNTP_PORT¶
The port to connect to your news server. Typically this is port 119
or port 563
if using SSL. If you are going to use SSL, you will need to set NNTP_SSLENABLED
.
The default setting for this option is 119
.
NNTP_SSLENABLED¶
Enable SSL for communications to your news server. Set it to true
to enable SSL.
The default setting for this option is false
.
CACHEOPT_METHOD¶
This setting enables the use of memcached. To use it, set it to memcache
. The other option is to have query results saved to files. They will be located in “newznab/db/cache”.
The options for this are:
none
memcache
file
The default setting for this option is none
.
CACHEOPT_TTLFAST¶
The default is 120
seconds.
CACHEOPT_TTLMEDIUM¶
The default is 600
seconds.
CACHEOPT_TTLSLOW¶
The default is 1800
seconds.
CACHEOPT_MEMCACHE_SERVER¶
The address of the memcached server. The default assumes memcached is installed on the same server as Newznab. This can be fully qualified name, IP address, ‘localhost’ or ‘127.0.0.1’.
The default setting for this option is 127.0.0.1
.
CACHEOPT_MEMCACHE_PORT¶
The port used to connect to the memcache server.
The default setting for this option is 11211
.
EXTERNAL_PROXY_IP¶
If you are behind a proxy, enable this setting and set it to the Internal Address of your proxy server. This can be fully qualified name or IP address.
The default setting for this option is not enabled.
EXTERNAL_HOST_NAME¶
If you are behind a proxy, enable this setting and set it to the fully qualified external hostname.
The default setting for this option is not enabled.