The config.php file already exists. This is an indication of an already existing installation" . " of RivetTracker. If you are sure you are installing for the first time, please try recopying the files/folders." . " This is also a security feature to prevent malicious attempts to run the installer if you forgot to delete it." . " This installer will now abort."; exit(); } if (isset($_POST["download"])) { //download config.php using header() header('content-type: application/octet-stream'); header("Content-Disposition: attachment; filename=\"config.php\""); print ""; exit; } ?> RivetTracker Installer

HelpHelp

RivetTracker Installer

RivetTracker Installation


Check for PHP and MySQL

table {width: 650px; margin: auto;} th {background: transparent; border: none; align: center;} td.a {width: 225px; text-align: center;} td.c {width: 50px; height: 42px; margin: auto;} HTML; // PHP Version $_GET['php_version'] = PHP_VERSION; // Check 5.3 if (version_compare(PHP_VERSION, '5.3.0', '>=')) { echo <<
PHP Version:
{$_GET['php_version']}Your server supports PHP 5.3+.Supported
HTML; } // Check 5.0 else if (version_compare(PHP_VERSION, '5.0.0', '>=')) { echo <<
HTML; } // Does not support PHP 5 else if (version_compare(PHP_VERSION, '4.4.9', '<=')) { echo <<
PHP Version:
{$_GET['php_version']}Your server supports PHP 5.0+. Update to PHP 5.3 or higher when possible. Supported
PHP Version:
{$_GET['php_version']}Your server does not support PHP 5. You may have issues running this tracker. Not Supported
HTML; } echo << HTML; //MySQL check if (class_exists('mysqli') OR function_exists('mysql_connect')) { echo <<
MySQL Support:
YesYour server supports MySQL.Supported
HTML; } // No MySQL else { echo <<
MySQL Support:
NoYour server does not support MySQL. Not Supported
HTML; } echo ("

"); if (version_compare(PHP_VERSION, '5.0.0', '>=') && class_exists('mysqli') || version_compare(PHP_VERSION, '5.0.0', '>=') && function_exists('mysql_connect')) echo "
Fully supported. You may continue.
"; else if (version_compare(PHP_VERSION, '5.0.0', '>=') && !class_exists('mysqli') || version_compare(PHP_VERSION, '5.0.0', '>=') && !function_exists('mysql_connect')) die ("
Fully supported, but cannot connect to database. You may not continue.
"); if (version_compare(PHP_VERSION, '4.4.9', '<=') && class_exists('mysqli') || version_compare(PHP_VERSION, '4.4.9', '<=') && function_exists('mysql_connect')) echo "
Not fully supported, but you may try.
"; else if (version_compare(PHP_VERSION, '4.4.9', '<=') && !class_exists('mysqli') || version_compare(PHP_VERSION, '4.4.9', '<=') && !function_exists('mysql_connect')) die("
Not fully supported, also cannot connect to database. You may not continue.
"); ?>


RivetTracker Installer

RivetTracker Installation


The MySQL database needs to be prepared for the tracker. This script will help you do that.

You have two choices:





RivetTracker Installation

RivetTracker Installation


Database hostname:
(in MySQL format, example: localhost)
Tracker's database username:
Tracker's database password:
Database name:
Table Prefix:
(If you want to use an existing
database this will add the tables in
with the specified prefix. If you
are unsure, leave this blank.)
e.g.: rt_



Tracker Installation

RivetTracker Installation


Username of database admin:
Password of database admin:
Database hostname:
(in MySQL format, example: localhost)
Create user for MySQL:
(make sure this user does not already exist)
Password:
Create database (name):


"); $password = $_POST["password"] or die(errorMessage() . "No username password was given, this is a huge security risk, please try again.

"); $database = $_POST["database"] or die(errorMessage() . "No database specified, please try again.

"); $hostname = $_POST["host"] or die(errorMessage() . "No database hostname specified, please try again.

"); $db = mysql_connect($hostname, $username, $password) or die(errorMessage() . "Can't connect to database: " . mysql_error() . "

"); mysql_select_db($database) or die(errorMessage() . "Can't select database: " . mysql_error() . "

"); mysql_query($makesummary) or die(errorMessage() . "Can't make the summary table: " . mysql_error() . "

"); mysql_query($makenamemap) or die(errorMessage() . "Can't make the namemap table: " . mysql_error() . "

"); mysql_query($maketimestamps) or die(errorMessage() . "Can't make the timestamps table: " . mysql_error() . "

"); mysql_query($makespeedlimit) or die(errorMessage() . "Can't make the speedlimit table: " . mysql_error() . "

"); mysql_query($makewebseedfiles) or die(errorMessage() . "Can't make the webseedfiles table: " . mysql_error() . "

"); mysql_query("INSERT INTO ".$prefix."speedlimit values (0,0,0)") or die(errorMessage() . "Can't insert zeros into speedlimit table: " . mysql_error() . "

"); echo "

Database was created successfully!



"; } if (isset($_POST["domakeaccount"])) { $username = $_POST["username"] or die(errorMessage() . "No username was given, please try again.

"); $password = $_POST["password"] or die(errorMessage() . "No username password was given, this is a huge security risk, please try again.

"); $database = $_POST["database"] or die(errorMessage() . "No database specified, please try again.

"); $hostname = $_POST["host"] or die(errorMessage() . "No database hostname specified, please try again.

"); $dbadmin = $_POST["adminname"] or die(errorMessage() . "No admin username was given, please try again.

"); $dbpass = $_POST["adminpass"]; // No admin password, OK but huge security risk... // Escaping strings will be ignored for now. $db = mysql_connect($hostname, $dbadmin, $dbpass) or die(errorMessage() . "Error connecting: " . mysql_error() . "

"); mysql_select_db("mysql") or die(errorMessage() . "Can't select db \"mysql\":" . mysql_error() . "

"); mysql_query("INSERT INTO user SET user=\"$username\", password=PASSWORD(\"$password\"), host=\"\"") or die(errorMessage() . "Can't make user: " . mysql_error() . "

"); mysql_query("INSERT INTO db SET Host=\"%\", db=\"$database\", user=\"$username\", select_priv='Y', Insert_priv='Y', Update_priv='Y', Delete_priv='Y', Create_priv='Y', Drop_priv='Y', Alter_priv='Y', index_priv='Y'") or die(errorMessage() . "Cannot insert into \"Db\": " . mysql_error() . "

"); mysql_query("CREATE DATABASE $database") or die(errorMessage() . "Can't make database: " . mysql_error() . "

"); mysql_query("FLUSH PRIVILEGES") or die(errorMessage() . "Can't flush privileges: " . mysql_error() . "

"); mysql_select_db($database) or die(errorMessage() . "Can't select database \"$database\":" . mysql_error() . "

"); mysql_query($makesummary) or die(errorMessage() . "Can't make the summary table: " . mysql_error() . "

"); mysql_query($makenamemap) or die(errorMessage() . "Can't make the namemap table: " . mysql_error() . "

"); mysql_query($maketimestamps) or die(errorMessage() . "Can't make the timestamps table: " . mysql_error() . "

"); mysql_query($makespeedlimit) or die(errorMessage() . "Can't make the speedlimit table: " . mysql_error() . "

"); mysql_query($makewebseedfiles) or die(errorMessage() . "Can't make the webseedfiles table: " . mysql_error() . "

"); mysql_query("INSERT INTO ".$prefix."speedlimit values (0,0,0)") or die(errorMessage() . "Can't insert zeros into speedlimit table: " . mysql_error() . "

"); echo "

Database was created successfully!



"; } if (isset($_POST["domakeaccount"]) || isset($_POST["maketables"])) { //have user set values for config.php ?>
\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; ?>

Create Configuration File



This last step allows you to configure the "config.php" file. This file stores all the necessary settings for your tracker. You can edit these settings at a later time in the admin page if you need to change them. Please do NOT edit the "config.php" file directly, use the admin page for any changes. It's usually pretty safe to leave most of the settings to the default unless you know what you're doing.

* - required value

Make tracker hidden: This will require a login by either the admin or upload user in order to see the torrents available on the main statistics page. This does not mean it's a private tracker. If you need a private tracker, there are many other trackers out there. Also, you will need to secure the "torrents" folder with an .htaccess file for Apache or some other method. The tracker will still accept all valid connections by clients. There is no user checking in that regard.
Enable or disable scraping by clients. Generally it is safe to leave this on unless you have a large number of torrents or users which can lead to increased bandwidth usage. Also, scraping can possibily be used maliciously by abusive clients.
Displays custom titles on the main torrent statistics page instead of the filename. This is because the uploader script will auto-rename your uploaded filename to exactly what you specified initally or by automatically using the data from the uploaded torrent. Check this if you want the titles to be different from the filename.
Short Announce URL: You can enable the short announce feature, making the URL end in /announce for your tracker. You should not utilize both tracker URL forms in one torrent at the same time, or you will get inconsistent results. Note: You will need the provided htaccess file, have URL rewrite capabilities, and have it properly set up to use this feature. Otherwise, leave it disabled.
* Lists the number of torrents on each page on your torrent tracker list. Default is 10.
* Lists the number of torrents on each page on the detailed statistics page. Default is 5.
* Maximum reannounce interval (in seconds) 1800 == 30 minutes
* Minimum reannounce interval (also in seconds) 300 == 5 minutes
* Number of peers to send in one request. Some logic will break if you set this to more than 300, so please don't do that. 100 is the most you should set anyway.
If set, NAT checking will be performed. This may cause trouble with some providers, so it's off by default.
Persistent MySQL connections: Check with your webmaster to see if you're allowed to use these. Highly recommended, especially for higher loads, but generally not allowed unless it's a dedicated machine.
Allow users to override ip address. Enable this if you know people have a legit reason to use this function. Leave disabled otherwise.
For heavily loaded trackers, uncheck this. It will stop count the number of downloaded bytes and the speed of the torrent, but will significantly reduce the load.
* Username for individual who can add torrents to tracker database. This user is only able to create, and not delete torrents to the tracker. For full privileges, see the admin user.
* Password for individual who can add torrents to tracker database. Again, this user is only able to create, and not delete torrents to the tracker. For full privileges, see the admin user.
* Admin username. The admin is able to go to the admin page and show detailed information about the tracker as well as access a few other important tools. The admin is also able to upload torrents to the database just like the previous account.
* Password for admin. Again, The admin is able to go to the admin page and show detailed information about the tracker as well as access a few other important tools. The admin is also able to upload torrents to the database.
Title on index.php statistics page, if not set, defaults to "Tracker Statistics"
Enable RSS feed: If you do not want the RSS feed to be created for privacy reasons or do not need it disable this checkbox.
RSS Title: In the rss.xml file, this is the main
<title>
tag.
RSS link to main website: In the rss.xml file, this is the main
<link>
tag.
RSS description: In the rss.xml file, this is the main
<description>
tag.
* Main website url that the tracker runs on, example: http://www.mywebsite.com
* For HTTP seeding, this is the maximum total upload rate per second in kilobytes, for example 100 would be 100 KB/s
* For HTTP seeding, this is the maximum number of uploads to run at a time
* Date format of the torrent publication date. It shows on statistics.php. If you change this setting, you will have to change it for every other existing torrent!
* Timezone that the server runs on




"; exit(); } if (!is_numeric($_POST["indexpagelimitspecify"]) || $_POST["indexpagelimitspecify"] == "" || $_POST["indexpagelimitspecify"] <= 0) { echo errorMessage() . "Error: The index page limit is not an integer, a negative number, or is blank.

"; exit(); } if (!is_numeric($_POST["statspagelimitspecify"]) || $_POST["statspagelimitspecify"] == "" || $_POST["statspagelimitspecify"] <= 0) { echo errorMessage() . "Error: The statistics page limit is not an integer, a negative number, or is blank.

"; exit(); } if (!is_numeric($_POST["report_interval"]) || $_POST["report_interval"] == "" || $_POST["report_interval"] <= 0) { echo errorMessage() . "Error: The maximum reannounce interval is not an integer, a negative number, or is blank.

"; exit(); } if (!is_numeric($_POST["min_interval"]) || $_POST["min_interval"] == "" || $_POST["min_interval"] <= 0) { echo errorMessage() . "Error: The minimum reannounce interval is not an integer, a negative number, or is blank.

"; exit(); } if (!is_numeric($_POST["maxpeers"]) || $_POST["maxpeers"] == "" || $_POST["maxpeers"] > 300 || $_POST["maxpeers"] <= 0) { echo errorMessage() . "Error: The number of peers to send in one request is not an integer, over 300, a negative number, zero, or blank.

"; exit(); } if ($_POST["upload_username"] == "") { echo errorMessage() . "Error: The upload username is blank.

"; exit(); } if ($_POST["upload_password"] == "") { echo errorMessage() . "Error: The upload user password is blank. This is considered a security risk.

"; exit(); } if ($_POST["admin_username"] == "") { echo errorMessage() . "Error: The admin username is blank.

"; exit(); } if ($_POST["admin_password"] == "") { echo errorMessage() . "Error: The admin user password is blank. This is considered a LARGE security risk.

"; exit(); } if ($_POST["dbhost"] == "") { echo errorMessage() . "Error: The database hostname is blank.

"; exit(); } if ($_POST["dbuser"] == "") { echo errorMessage() . "Error: The database username is blank.

"; exit(); } if ($_POST["dbpass"] == "") { echo errorMessage() . "Error: The database password is blank.

"; exit(); } if ($_POST["database"] == "") { echo errorMessage() . "Error: The database name is blank.

"; exit(); } if ($_POST["rss_link"] != "" && Substr($_POST["rss_link"], 0, 7) != "http://") { echo errorMessage() . "Error: The RSS website URL does not start with http://

"; exit(); } if ($_POST["website_url"] == "" || Substr($_POST["website_url"], 0, 7) != "http://") { echo errorMessage() . "Error: The website URL does not start with http:// or is blank.

"; exit(); } if (!is_numeric($_POST["max_upload_rate"]) || $_POST["max_upload_rate"] == "" || $_POST["max_upload_rate"] <= 0) { echo errorMessage() . "Error: The maximum upload rate is not an integer, a negative number, or is blank.

"; exit(); } if (!is_numeric($_POST["max_uploads"]) || $_POST["max_uploads"] == "" || $_POST["max_uploads"] <= 0) { echo errorMessage() . "Error: The maximum uploads is not an integer, a negative number, or is blank.

"; exit(); } if ($_POST["dateformat"] == "") { echo errorMessage() . "Error: The date format is blank.

"; exit(); } if ($_POST["timezone"] == "") { echo errorMessage() . "Error: The timezone is blank.

"; exit(); } if ($_POST["upload_username"] == $_POST["admin_username"]) { echo errorMessage() . "Error: The admin username cannot be the same as the upload username.

"; exit(); } //create config.php based on user input //first try creating it on the server if (is_writable("./")) { //go through checkboxes and change "on" to "true" if ($_POST["hiddentracker"] == "on") $hiddentracker = "true"; else $hiddentracker = "false"; if ($_POST["enablerss"] == "on") $enablerss = "true"; else $enablerss = "false"; if ($_POST["scrape"] == "on") $scrape = "true"; else $scrape = "false"; if ($_POST["customtitle"] == "on") $customtitle = "true"; else $customtitle = "false"; if ($_POST["NAT"] == "on") $NAT = "true"; else $NAT = "false"; if ($_POST["persist"] == "on") $persist = "true"; else $persist = "false"; if ($_POST["ip_override"] == "on") $ip_override = "true"; else $ip_override = "false"; if ($_POST["countbytes"] == "on") $countbytes = "true"; else $countbytes = "false"; //write config.php file $fd = fopen("config.php", "w") or die(errorMessage() . "Error: couldn't make config.php!

"); fwrite($fd, "" ); fclose($fd); echo "

config.php file was created successfully!

"; } //if unable to create on server, user downloads config.php file for future upload if (!is_writable("./")) { ?>

"config.php" was unable to be created on the server, you will have to download the file and upload it manually.


"> ">

Make sure you go and delete this installer script when you are done! (install.php)



\n"; echo "

Also, check the permissions and make sure the 'torrents' and 'rss' folders are able to be written to by the server.



\n"; echo "
Main Statistics Page
\n"; echo "\n"; } ?>