Freefcw/hustoj Install Guide

Source: Internet
Author: User
Tags deprecated vps kohana

First of all, this version hustoj is a skin and improved for https://code.google.com/p/hustoj/. So the can migrate the old version of Web to this version without any big chance.

This are not a deep tutorial for beginner, the base step to OS and backend you should reference the old version of H Ustoj.

Mysql
  1. Run the Origin hustoj DB script Origin Database of Hustoj
  2. Run the DB Alter script database changed
Set names UTF8; Create Database Judge;use judge; CREATE TABLE ' compileinfo ' (' solution_id ' int (one) not NULL DEFAULT ' 0 ', ' Error ' text, PRIMARY KEY (' solution_id ')) EN Gine=myisam DEFAULT Charset=utf8;  CREATE TABLE ' contest ' (' contest_id ' int (one) not null auto_increment, ' title ' varchar (255) DEFAULT NULL, ' start_time '  datetime default NULL, ' End_time ' datetime default NULL, ' defunct ' char (1) NOT null DEFAULT ' N ', ' description ' text, ' Private ' tinyint (4) NOT null default ' 0 ', ' langmask ' int not null default ' 0 ' COMMENT ' bits for LANG to mask ', PRIMARY KEY (' contest_id ')) Engine=myisam auto_increment=1000 DEFAULT Charset=utf8;  CREATE TABLE ' Contest_problem ' (' problem_id ' int (one) not null default ' 0 ', ' contest_id ' int (one-by-one) default NULL, ' title ' char (+) NOT null default ' ', ' num ' int (one-by-one) NOT null default ' 0 ') engine=myisam default Charset=utf8; CREATE TABLE ' loginlog ' (' user_id ' varchar () NOT NULL default ', ' Password ' varchar (+) default NULL, ' IP ' varchar ( ) DEFAult null, ' time ' datetime default NULL, KEY ' User_log_index ' (' user_id ', ' time ')) Engine=myisam DEFAULT Charset=utf8; CREATE TABLE ' mail ' (' mail_id ' int (one) not null auto_increment, ' to_user ' varchar (ON) NOT null DEFAULT ' ', ' from_user ' varchar ' NOT null default ', ' title ' varchar ($) NOT null default ' ', ' content ' text, ' new_mail ' tinyint (1) not Null default ' 1 ', ' Reply ' tinyint (4) Default ' 0 ', ' in_date ' datetime default NULL, ' defunct ' char (1) NOT null default ' N ', PRIMARY key (' mail_id '), key ' uid ' (' To_user ')) Engine=myisam auto_increment=1013 DEFAULT Charset=utf8; CREATE TABLE ' News ' (' news_id ' int (one) not null auto_increment, ' user_id ' varchar (in) NOT null DEFAULT ' ', ' title ' VA Rchar (+) NOT null default ' ', ' content ' text is not null, ' time ' datetime is NOT null default ' 0000-00-00 00:00:00 ', ' Impor Tance ' tinyint (4) NOT null default ' 0 ', ' defunct ' char (1) NOT null default ' N ', PRIMARY KEY (' news_id ')) Engine=myisam A uto_increment=1004 DEFAULT Charset=utf8;CREATE TABLE ' privilege ' (' user_id ' char () NOT NULL default ' ', ' rightstr ' char (+) ' NOT null default ' ', ' defunct ' char (1) Not NULL default ' N ') engine=myisam default Charset=utf8; CREATE TABLE ' problem ' (' problem_id ' int (one) not null auto_increment, ' title ' varchar ($) NOT null DEFAULT ' ', ' desc  Ription ' text, ' input ' text, ' output ' text, ' sample_input ' text, ' sample_output ' text, ' SPJ ' char (1) Not NULL DEFAULT ' 0 ', ' hint ' text, ' source ' varchar (+) default NULL, ' In_date ' datetime default NULL, ' Time_limit ' int (one) NOT NULL Default ' 0 ', ' memory_limit ' int (one) not null default ' 0 ', ' defunct ' char (1) NOT null default ' N ', ' accepted ' int (one) DE FAULT ' 0 ', ' submit ' int (one) default ' 0 ', ' solved ' int (one) ' default ' 0 ', PRIMARY KEY (' problem_id ')) Engine=myisam auto_i ncrement=1000 DEFAULT Charset=utf8; CREATE TABLE ' reply ' (' rid ' int (one) not null auto_increment, ' author_id ' varchar (ON) ' NOT null ', ' time ' datetime is not NU LL DEFAULT ' 0000-00-00 00:00:00 ', ' content ' tExt NOT NULL, ' topic_id ' int (one) not null, ' status ' int (2) is not null DEFAULT ' 0 ', ' IP ' varchar (+) NOT NULL, PRIMARY KE Y (' rid '), KEY ' author_id ' (' author_id ')) Engine=myisam DEFAULT Charset=utf8; CREATE TABLE ' sim ' (' s_id ' int (one) not null, ' sim_s_id ' int (one) default null, ' SIM ' int (one) ' default NULL, PRIMARY KE Y (' s_id ')) Engine=myisam DEFAULT Charset=utf8; CREATE TABLE ' solution ' (' solution_id ' int (one) not null auto_increment, ' problem_id ' int (one) not null DEFAULT ' 0 ', ' u ser_id ' char ' not NULL, ' time ' int (one) not null default ' 0 ', ' memory ' int (one-by-one) NOT null default ' 0 ', ' in_date ' Dateti Me NOT null default ' 0000-00-00 00:00:00 ', ' result ' smallint (6) NOT null default ' 0 ', ' language ' INT UNSIGNED not null D Efault ' 0 ', ' IP ' char (+) NOT null, ' contest_id ' int (one) default NULL, ' valid ' tinyint (4) NOT null default ' 1 ', ' num ' tinyint (4) NOT null default '-1 ', ' code_length ' int (one) not null default ' 0 ', ' judgetime ' datetime default NULL, ' Pass_ Rate ' DECIMAL (2,2) UNSigned not NULL DEFAULT 0, PRIMARY key (' solution_id '), key ' uid ' (' user_id '), key ' pid ' (' problem_id '), key ' Res ' (' r Esult '), KEY ' CID ' (' contest_id ')) Engine=myisam auto_increment=1001 DEFAULT Charset=utf8; CREATE TABLE ' Source_code ' (' solution_id ' int (one) not null, ' source ' text not NULL, PRIMARY KEY (' solution_id ')) ENGI Ne=myisam DEFAULT Charset=utf8;  CREATE TABLE ' topic ' (' tid ' int (one) not null auto_increment, ' title ' varbinary "NOT NULL", ' status ' int (2) NOT NULL  Default ' 0 ', ' top_level ' int (2) NOT null default ' 0 ', ' CID ' int (one) default NULL, ' pid ' int (one) ' NOT null, ' author_id ' varchar () not NULL, PRIMARY key (' tid '), key ' CID ' (' CID ', ' pid ')) Engine=myisam DEFAULT Charset=utf8; CREATE TABLE ' users ' (' user_id ' varchar) ' NOT null default ', ' email ' varchar (+) default NULL, ' Submit ' int (11) Default ' 0 ', ' solved ' int (one) default ' 0 ', ' defunct ' char (1) NOT null default ' N ', ' IP ' varchar (a) NOT null default '  , ' Accesstime ' datetime DEFAULT NULL,' Volume ' int (one) NOT null default ' 1 ', ' language ' int (one) NOT null default ' 1 ', ' password ' varchar (+) default NULL, ' R Eg_time ' datetime DEFAULT NULL, ' Nick ' varchar (+) NOT null default ' ', ' school ' varchar (+) ' NOT null default ', PRI MARY KEY (' user_id ') Engine=myisam DEFAULT Charset=utf8; CREATE TABLE ' online ' (' hash ' varchar (+) collate utf8_unicode_ci not NULL, ' IP ' varchar "character set UTF8 not NUL L default ', ' UA ' varchar (255) Character Set UTF8 not NULL default ' ', ' refer ' varchar (255) COLLATE Utf8_unicode_ci def Ault null, ' lastmove ' int (ten) not null, ' firsttime ' int (ten) default NULL, ' uri ' varchar (255) Collate utf8_unicode_ci de Fault NULL, PRIMARY key (' hash '), UNIQUE key ' hash ' (' hash ') engine=memory DEFAULT Charset=utf8 Collate=utf8_unicode_c I CREATE TABLE ' runtimeinfo ' (' solution_id ' int (one) not NULL DEFAULT ' 0 ', ' Error ' text, PRIMARY KEY (' solution_id ')) EN Gine=myisam DEFAULT Charset=utf8; CREATE TABLE ' custominput ' (' solution_id ' int (one) NOT NULL Default ' 0 ', ' input_text ' text, PRIMARY KEY (' solution_id ')) Engine=myisam DEFAULT Charset=utf8; 

Datavase changed:

# Support LanguageALTER TABLEUsersADDLocaleCHAR(7)NULL; # SupportUserThemeALTER TABLEUsersADDThemeCHAR( -)NULL; # Add option TableCREATE TABLE' Options ' (' option_id ' )int( One) unsigned not NULLauto_increment, ' name 'varchar( -) not NULL DEFAULT "',  `desc`varchar( -) not NULL DEFAULT "', ' value 'varchar( -) not NULL DEFAULT "',  PRIMARY KEY(' option_id ')) ENGINE=MyISAM auto_increment=1 DEFAULTCHARSET=UTF8;INSERT  into' Options ' (' option_id ', ' name ', 'desc' , ' value ')VALUES    (2,'Ga_code','Google Analytics Code','ua-yourcode-1');

Web
  1. git clone https://github.com/freefcw/hustoj.gitInto the code to your Webdocs
  2. Follow the Configure Guide. Notice, the old extension of MySQL for PHP are deprecated, so are need use mysqli, or PDO
Configuren Guide:

The config file is locate Applicaiton/config directory

    1. CP production/database.sample.php to production/database.php, set your database information

    2. CP base.sample.php to base.php, set domain and base_url, domain should not contain the port

Problems:
skys215 commented on 2 2014When wil the installation sction 'll be updated?I Downloaded it, but I cannot install.regards,@freefcwOwnerfreefcw commented on5 2014I 'll DoIt when I had enough Time, you can install UseThe old judge database from Google Code@dotkrnlcollaboratordotkrnl commented on5 2014With an installed Google Code version Hustoj. See hints in https://github.com/freefcw/hustoj/wiki/database-changed and Https://github.com/freefcw/hustoj/wiki/configure. This project just refactored the front-end.@skys215skys215 commented on6 2014I did asYou guys said, but it remains "error, please contact Freefcw#gmail".@skys215skys215 commented on6 2014I got the500Http Response andthis error message: Database_exception [8192]:mysql_connect(): TheMySQLExtension is deprecated and would be removed on the future: Usemysqli or PDO INSTEAD@FREEFCWOWNERFREEFCW commented on6 2014Choose Mysqli or PDO in database. php. TheMySQLdriver is deprecated in the newest PHP version@skys215skys215 commented on6 2014Yes, it solved the problem.But there‘s Annother problem:when I Click the links on the navbar, it get a 404 error. (eg.http://127.0.0.1:8889/problem/list) But if I add index.php in the URL and then it' s OK. (eg. http://127.0.0.1:8889/index.php/problem/list)Is it my Apache Configuration 's problem? Update:it was my Apache Configuration' s problem, allowoverride was set to None.it works perfect after changed it to all and restarting the Apache.Thanks forThe help!@skys215skys215 commented on2014Hustoj works well at my localhost, but there 's an error running on my VPS. errorexception [Fatal Error]: Call to undefined function __ () syspath/classes/kohana/kohana/exception.php []it seems That i18n.php didn' t load propperly.Update:One of my friend who are familiar with Kohana said, I need to give permissions to the Application/cache/and application/logs/after This, the problem is solved.@freefcwOwnerfreefcw commented on2014Yes, you should che the owner of the Webdocs,chmod-R Www-data:www-dataDIR@skys215skys215 commented on2014After asking a net-friend, he said that the judgingsystemIs isn't in this repository.This repository is just another webInterfaceof the judgingsystem.So I Checkout the JudgesystemWhich is in SVN, and did the Sudo bash install/install-interactive.sh. This Time, I can open the online judge, I can add problem, submit code and judge the code on localhost.If I did the same thing on my VPS, it seems that it can create the Problem-id directory in The/home/judge/data, I don 't know why. If I Create the directory manualy, then the code could is accepted. @qhpeklh5959qhpeklh5959 commented on Oct 2014I' ve configed the database and permission of the dictionary, but I get "error, please contact Freefcw#gmail". I WonderifI 've made some mistake??  @freefcwOwnerfreefcw commented on Oct 2014please Check the error log for the detail@qhpeklh5959qhpeklh5959 commented on OCT 20142014-10-29 09:03:05---DEBUG: #0/var/www/hustoj/system/classes/kohana/request.php (986): Kohana_http_ Exception::factory (404,' Unable to find ... ', Array) #1/var/www/hustoj/index.php: Kohana_request->execute () #2 {main} in/var/www/hustoj/system/ Classes/kohana/request.php:98how to fix it? @freefcwOwnerfreefcw commented on Oct 2014The imformation was hide the most I Mportant, please give me the whole log. Seems route set have some problem in route, do u installed in subdirectory? @jcf94jcf94 commented on Apr 2015I think I g Et a same error like qhpeklh5959 do ..... Here are my log:2015-04-26 16:20:42---emergency:http_exception_404 [404]: The requested URL Hustoj was isn't found on th is server. ~ syspath/classes/kohana/http/exception.php [] in/var/www/html/hustoj/system/classes/kohana/request/client/ INTERNAL.PHP:792015-04-26 16:20:42---DEBUG: #0/var/www/html/hustoj/system/classes/kohana/request/client/ internal.php: Kohana_http_exception::factory (404,' The requested U ... ', Array) #1/var/www/html/hustoj/system/classes/kohana/request/client.php: Kohana_request_client_ Internal->execute_request (object (Request), Object (Response)) #2/var/www/html/hustoj/system/classes/kohana/ request.php (997): Kohana_request_client->execute (Object (Request)) #3/var/www/html/hustoj/index.php (105): Kohana_request->execute () #4 {main} in/var/www/html/hustoj/system/classes/kohana/request/client/internal.php : 79@foxprodevfoxprodev commented on 2015Same error. What should I does? @freefcwOwnerfreefcw commented on the May 2015@xff252595680 @FoxprodevPlease show me your nginx or Apache Site Config File@foxprodevfoxprodev commented on the 2015@FREEFCW already fixed it, allowoverride in the This directory. But how to fix http://stackoverflow.com/questions/4624726/http-error-302-using-uploadify? In Firefox, Safari, OS X browsers.
View Code

Admin
  1. Open the site and register a user as the Master admin.
  2. Run the SQL Script insert into privilege(user_id,rightstr) values(‘admin‘,‘administrator‘); Admin is the username of your registered

Freefcw/hustoj Install Guide

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.