mirror of
https://github.com/lkddi/nexusphp.git
synced 2026-04-16 05:50:55 +08:00
prepare to v1.6
This commit is contained in:
2
.gitignore
vendored
2
.gitignore
vendored
@@ -6,6 +6,8 @@
|
||||
/attachments
|
||||
/bitbucket
|
||||
/subs
|
||||
/public/install
|
||||
/public/update
|
||||
npm-debug.log
|
||||
.env
|
||||
.buildpath
|
||||
|
||||
215
INSTALL
215
INSTALL
@@ -1,215 +0,0 @@
|
||||
NexusPHP 1.5 beta 4 20100517 Installation
|
||||
This guide is intended for experienced webmasters and takes Ubuntu Server 10.04 as the example. Check out http://www.nexusphp.com for more tutorials.
|
||||
1.Environment
|
||||
This project should work on most operation systems where PHP is supported, such as Linux, Unix and Microsoft Windows.
|
||||
1.1.Required:
|
||||
A web server, Apache HTTP Server (v2.2.X tested) preferred. IIS HTTP Server (6.0 tested) should work as well but not recommended.
|
||||
PHP 5 (v5.2.X and v5.3.X tested). Multibyte String(mbstring), MySQL(mysql), Memcache(memcache), GD extensions are required.
|
||||
MySQL Server (v5.0.X tested).
|
||||
memcached
|
||||
|
||||
1.2.Optional:
|
||||
PEAR with HTTP_Request2 package. For the feature of IMDb information scraping.
|
||||
A SMTP server, Postfix preferred. IIS SMTP Server (6.0 tested) should work, too. For sending email.
|
||||
|
||||
2.INSTALL
|
||||
2.1.Apache web server
|
||||
2.1.1.install the web server.
|
||||
on Ubuntu Server 10.04:
|
||||
# OS commandline starts
|
||||
sudo apt-get install apache2
|
||||
# OS commandline ends
|
||||
2.1.2.edit the configuration file (usually named 'Apache2.conf' or 'httpd.conf')
|
||||
on Ubuntu Server 10.04:
|
||||
# OS commandline starts
|
||||
sudo nano /etc/apache2/sites-enabled/000-default
|
||||
# OS commandline ends
|
||||
|
||||
# configuration starts
|
||||
<IfModule dir_module>
|
||||
DirectoryIndex index.php index.html
|
||||
</IfModule>
|
||||
<VirtualHost *:80>
|
||||
DocumentRoot "/your/http/document/root"
|
||||
<Directory "/your/http/document/root">
|
||||
Options FollowSymLinks
|
||||
AllowOverride None
|
||||
Order allow,deny
|
||||
Allow from all
|
||||
</Directory>
|
||||
<DirectoryMatch /\.svn/>
|
||||
AllowOverride None
|
||||
Order allow,deny
|
||||
Deny from all
|
||||
</DirectoryMatch>
|
||||
<Directory "/your/http/document/root/_db">
|
||||
AllowOverride None
|
||||
Order allow,deny
|
||||
Deny from all
|
||||
</Directory>
|
||||
<Directory "/your/http/document/root/config">
|
||||
AllowOverride None
|
||||
Order allow,deny
|
||||
Deny from all
|
||||
</Directory>
|
||||
<Directory "/your/http/document/root/_doc">
|
||||
Options +Indexes
|
||||
Order allow,deny
|
||||
Allow from all
|
||||
</Directory>
|
||||
<Directory "/your/http/document/root/lang">
|
||||
AllowOverride None
|
||||
Order allow,deny
|
||||
Deny from all
|
||||
</Directory>
|
||||
</VirtualHost>
|
||||
# configuration ends
|
||||
|
||||
Note: replace '/your/http/document/root' with your own path, e.g. '/var/www/nexusphp'
|
||||
|
||||
2.2.PHP
|
||||
2.2.1.install PHP with all required extensions.
|
||||
on Ubuntu Server 10.04:
|
||||
# OS commandline starts
|
||||
sudo apt-get install php5 php5-gd php5-memcache php5-mysql
|
||||
# OS commandline ends
|
||||
2.2.2.edit the configuration file (usually named 'php.ini')
|
||||
on Ubuntu Server 10.04:
|
||||
# OS commandline starts
|
||||
sudo nano /etc/php5/apache2/php.ini
|
||||
# OS commandline ends
|
||||
IMPORTANT: You must turn off the 'magic quotes' feature in PHP. It is unfortunately turned on by default with PHP 5.2
|
||||
|
||||
; configuration starts
|
||||
magic_quotes_gpc = Off
|
||||
magic_quotes_runtime = Off
|
||||
magic_quotes_sybase = Off
|
||||
; Optional. Increase it if memory-limit-reached error occurs when uploading large torrent files.
|
||||
memory_limit = 128M
|
||||
; configuration ends
|
||||
|
||||
2.3.MySQL server
|
||||
2.3.1.install it.
|
||||
on Ubuntu Server 10.04:
|
||||
# OS commandline starts
|
||||
sudo apt-get install mysql-server
|
||||
# OS commandline ends
|
||||
2.3.2.edit the configuration file (usually named 'my.cnf' or 'my.ini')
|
||||
on Ubuntu Server 10.04:
|
||||
# OS commandline starts
|
||||
sudo nano /etc/mysql/my.cnf
|
||||
# OS commandline ends
|
||||
|
||||
IMPORTANT: Do not set any SQL Modes. This project is not tested to work with them.
|
||||
# configuration starts
|
||||
sql-mode=""
|
||||
; Optional. Increase it if mysql connection-failure occurs under heavy traffic load.
|
||||
max_connections = 1000
|
||||
# configuration ends
|
||||
|
||||
2.3.3.with the 1.5 beta 4 release, no installation script comes with the project. So you have to do everything yourself, such as creating a database:
|
||||
2.3.3.1.connect to MySQL server
|
||||
# OS commandline starts
|
||||
mysql --user=yourdbusername --password=yourdbpassword --host=yourdbhostname
|
||||
# OS commandline ends
|
||||
Note: replace 'yourdbusername' with your own MySQL username e.g. 'root', 'yourdbpassword' with your MySQL user password, and 'yourdbhostname' with your MySQL hostname e.g. 'localhost'
|
||||
2.3.3.2.create a database.
|
||||
-- MySQL commandline starts
|
||||
CREATE DATABASE yourdbname;
|
||||
USE yourdbname;
|
||||
-- MySQL commandline end
|
||||
Note: replace 'yourdbname' with your own mysql database name, e.g. 'nexusphp'.
|
||||
2.3.3.3.import database structure from this project.
|
||||
-- MySQL commandline starts
|
||||
SET NAMES utf8;
|
||||
SOURCE /path/to/project/source/_db/dbstructure.sql;
|
||||
-- MySQL commandline ends
|
||||
Note: replace '/path/to/project/source' with your own path where you save files from this project.
|
||||
2.3.3.4.quit MySQL
|
||||
-- MySQL commandline starts
|
||||
quit;
|
||||
-- MySQL commandline ends
|
||||
|
||||
2.4.Memcached
|
||||
2.4.1.install it.
|
||||
on Ubuntu Server 10.04:
|
||||
# OS commandline starts
|
||||
sudo apt-get install memcached
|
||||
# OS commandline ends
|
||||
2.4.2.run it as a daemon.
|
||||
on Ubuntu Server 10.04:
|
||||
# OS commandline starts
|
||||
memcached -d -u nobody
|
||||
# OS commandline ends
|
||||
|
||||
2.5.PEAR and HTTP_Request2 package
|
||||
To save the trouble, a package named 'Required.Files.From.PEAR' is available from the website http://www.nexusphp.com. You may skipped the following procedure if you have downloaded that package.
|
||||
2.5.1.install PEAR basic package
|
||||
on Ubuntu Server 10.04:
|
||||
# OS commandline starts
|
||||
sudo apt-get install php-pear
|
||||
# OS commandline ends
|
||||
2.5.2.set preferred package state of PEAR to 'alpha'
|
||||
on Ubuntu Server 10.04:
|
||||
# OS commandline starts
|
||||
sudo pear config-set preferred_state alpha
|
||||
# OS commandline ends
|
||||
2.5.3.install HTTP_Request2 package.
|
||||
# OS commandline starts
|
||||
sudo pear install HTTP_Request2
|
||||
# OS commandline ends
|
||||
|
||||
2.6.Postfix
|
||||
2.6.1.install it.
|
||||
on Ubuntu Server 10.04:
|
||||
# OS commandline starts
|
||||
sudo apt-get install postfix
|
||||
# OS commandline ends
|
||||
|
||||
2.7.Restart MySQL and Apache HTTP Server services
|
||||
For edits of configuration to take effect, services need to be restarted.
|
||||
on Ubuntu Server 10.04:
|
||||
# OS commandline starts
|
||||
sudo /etc/init.d/apache2 restart
|
||||
sudo /etc/init.d/mysql restart
|
||||
# OS commandline ends
|
||||
|
||||
3.Set up this project
|
||||
3.1.put all files from this project into the document root of your http server, e.g. '/var/www/nexusphp'
|
||||
3.2.on *nix OS, change files' access permission to 777
|
||||
on Ubuntu Server 10.04:
|
||||
# OS commandline starts
|
||||
sudo chmod -Rf 777 /your/http/document/root
|
||||
# OS commandline ends
|
||||
Note: replace '/your/http/document/root' with your own path, e.g. '/var/www/nexusphp'
|
||||
3.3.edit the configuration file (named 'config/allconfig.php') of this project
|
||||
|
||||
// configuration starts
|
||||
$BASIC=array(
|
||||
'SITENAME' => 'yoursitename',
|
||||
'BASEURL' => 'yoursiteurl',
|
||||
'announce_url' => 'yoursiteurl/announce.php',
|
||||
'mysql_host' => 'yourdbhostname',
|
||||
'mysql_user' => 'yourdbusername',
|
||||
'mysql_pass' => 'yourdbpassword',
|
||||
'mysql_db' => 'yourdbname',
|
||||
);
|
||||
// configuration ends
|
||||
Note: replace 'yoursitename' with your own name of the website e.g. 'MyTracker', 'yoursiteurl' with your site base URL (without prefixing 'http://') e.g. 'www.nexusphp.com', 'mysql_host' with your MySQL hostname e.g. 'localhost', 'yourdbhostname' with your MySQL username e.g. 'root', 'yourdbusername' with your MySQL user password, and 'mysql_db' with your MySQL database name e.g. 'nexusphp'.
|
||||
3.4.visit your site. Register a new user.
|
||||
3.5.set yourself the Staff Leader.
|
||||
Again, you have to do it the dirty way, namely running MySQL query manually.
|
||||
3.5.1.connect to mysql server
|
||||
# OS commandline starts
|
||||
mysql --user=yourdbusername --password=yourdbpassword --host=yourdbhostname yourdbname
|
||||
# OS commandline ends
|
||||
Note: replace 'yourdbusername' with your own MySQL username e.g. 'root', 'yourdbpassword' with your MySQL user password, 'yourdbhostname' with your MySQL hostname e.g. 'localhost', and 'yourdbname' with your MySQL database name e.g. 'nexusphp'.
|
||||
3.5.2.set your class to Staff Leader
|
||||
-- MySQL commandline starts
|
||||
UPDATE users SET class=16 WHERE username='yourwebsiteusername';
|
||||
-- MySQL commandline ends
|
||||
NOTE: replace 'yourwebsiteusername' with the username you have just registered on the website.
|
||||
3.5.3.quit MySQL
|
||||
-- MySQL commandline starts
|
||||
quit;
|
||||
-- MySQL commandline ends
|
||||
7
README
7
README
@@ -1,7 +0,0 @@
|
||||
ABOUT NexusPHP
|
||||
This Project NexusPHP is an open-sourced private tracker script written in PHP.
|
||||
It forks from the TBSource project and some other open-sourced projects.
|
||||
Please read the LICENSE file before using this project.
|
||||
Read the INSTALL file for information about how to use it.
|
||||
Read the RELEASENOTE file about this release.
|
||||
Visit http://www.nexusphp.com for more information about this project.
|
||||
31
RELEASENOTE
31
RELEASENOTE
@@ -1,31 +0,0 @@
|
||||
Release note for v1.5 beta 5 20120707
|
||||
fix tracker "can't unzip" issue when zlib is not enabled
|
||||
|
||||
Release note for v1.5 beta 5 20120301
|
||||
Fix: several security issues
|
||||
Fix: takesignup not checking invitation code
|
||||
Fix: function sqlesc() with numeric value
|
||||
Fix: sendmail delay issue
|
||||
Fix: language file in docleanup()
|
||||
Fix: language setting at FAQ and Rules
|
||||
Mod: default promotion display type to 'icon'
|
||||
thank http://wiki.nexusphp.org for reporting bugs
|
||||
|
||||
Release note for v1.5 beta 4 20100919
|
||||
Fix: "There is a minimum announce time of 30 seconds", caused by timezone settings. Now you should set correct timezone in php.ini
|
||||
Fix: varchar column length exceed 255 characters, which causes errors in MySQL 5.0.3 and later
|
||||
Mod: set mysql sql_mode in php level
|
||||
Mod: change mysql_pconnect to mysql_connect
|
||||
Release note for v1.5 beta 4 20100905
|
||||
Add: promotion timeout setting per torrent
|
||||
Fix: some minor bugs
|
||||
Release note for v1.5 beta 4 20100615
|
||||
Change default cleanup from cron-triggered to browser-triggered
|
||||
Release note for v1.5 beta 4 20100603
|
||||
Fix a few minor bugs from previous release
|
||||
Release note for v1.5 beta 4 20100531
|
||||
Fix a few minor bugs from previous release
|
||||
Release note for v1.5 beta 4 20100517
|
||||
This release is not considered stable and ready for major time. A lot of things, especially those in staff panel, may not work as expected.
|
||||
No installer available yet.
|
||||
Use it at your own risk.
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
class RedisCache {
|
||||
class class_cache_redis {
|
||||
|
||||
public $isEnabled;
|
||||
public $clearCache = 0;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "xiaomlove/nexusphp",
|
||||
"description": "A private tracker server application base on NexusPHP.",
|
||||
"description": "A private tracker application base on NexusPHP.",
|
||||
"type": "project",
|
||||
"license": "GPL-2.0-only",
|
||||
"authors": [
|
||||
|
||||
@@ -24,7 +24,7 @@ require $rootpath . 'include/config.php';
|
||||
if (!IS_ANNOUNCE) {
|
||||
require $rootpath . get_langfile_path("functions.php");
|
||||
}
|
||||
$Cache = new RedisCache(); //Load the caching class
|
||||
$Cache = new class_cache_redis(); //Load the caching class
|
||||
$Cache->setLanguageFolderArray(get_langfolder_list());
|
||||
define('TIMENOW', time());
|
||||
define('TIMENOW_STRING', date('Y-m-d H:i:s'));
|
||||
|
||||
@@ -160,7 +160,7 @@ class Install
|
||||
|
||||
public function listSettingTableRows()
|
||||
{
|
||||
$defaultSettingsFile = ROOT_PATH . '_doc/install/settings.default.php';
|
||||
$defaultSettingsFile = __DIR__ . '/settings.default.php';
|
||||
$originalConfigFile = ROOT_PATH . 'config/allconfig.php';
|
||||
if (!file_exists($defaultSettingsFile)) {
|
||||
throw new \RuntimeException("default setting file: $defaultSettingsFile not exists.");
|
||||
|
||||
Reference in New Issue
Block a user