27 Star 205 Fork 60

zhblue / hustoj

Create your Gitee Account
Explore and code with more than 12 million developers,Free private repositories !:)
Sign up
Clone or Download
contribute
Sync branch
Cancel
Notice: Creating folder will generate an empty file .keep, because not support in Git
Loading...
README.md
GPL-2.0

HUSTOJ

流行的OJ系统,跨平台、易安装、有题库。

常见问题请先查阅

FAQ常见问答

目录

模板演示

版权说明

致谢

更新日志

安装说明

安装说明

注意事项

系统演示

硬件需求

校园网安装

基于 Ubuntu 20.04 安装 新手首选, 各类软件最新,最容易操作成功

Ubuntu 更换软件源

[基于Deepin深度安装](#基于 Deepin 20+ 安装)

基于CentOS安装

基于Docker安装

基于其他发行版安装

LiveCD下载安装

卸载阿里云盾

装后须知

装后须知

备份

迁移

更新升级

修复

二次开发

支持捐助、加入社区

免费题库

求助 报错

如果您喜欢在线聊天,希望问题获得及时反馈,不介意付费获得服务,请加官方QQ群 23361372点我加群

自带的5种模板演示

syzoj主题 added by@renbaoshuo

bs3原版

sweet主题

bshark主题 added by @yemaster

mdui主题 added by@renbaoshuo

修改 db_info.inc.php[默认位置/home/judge/src/web/include]$OJ_TEMPLATE 的值,即可使用上述模板。

版权说明

HUSTOJ is an GPL Free Software.

HUSTOJ 是采用 GPL 的自由软件。(仅限原创部分代码,其中使用了其他开源项目的组件,请遵循原组件的协议。)

感谢下述及其他被使用到的开源代码项目贡献者,来自这些项目的代码及衍生代码遵循其原有开源协议,不受本项目的GPL授权影响。

  • masteroj uoj loj syzoj zoj qduoj openJudger
  • linux apache nginx php mysql mariadb memcached
  • bootstrap kindeditor ACEeditor blockly codemirror katex phpfilemanager mdui
  • sim gcc clang openjdk freepascal mono docker SyntaxHighlighter

排名不分先后本列表欢迎补充

注意:基于本项目源码从事科研、论文、系统开发,请在文中或系统中表明来自于本项目的内容和创意。

论文请引用参考文献 基于开放式云平台的开源在线评测系统设计与实现

如果打算进行二次开发, Wiki 和这份Wiki 可能有帮助。

PS: GPL保证你可以合法忽略以上注意事项但不能保证你不受鄙视,呵呵。

有关安装、使用问题请先查阅 FAQ常见问答文档 或使用搜索引擎。

如果这个项目对你有用,请:

  • 挥动鼠标,右上角给个 **Star** !
  • 保留网站页脚的二维码
  • 访问 tk题库 ,充值下载题目
  • 向同学同事推荐这个项目
  • 每天扫一扫本页底部的支付宝红包
  • 在您的论文参考文献中写出本项目的网址

Star us, please!

更新日志

2023年
日期 类型 更新内容
10-09 更新 私有比赛结束后,比赛创建者可以看到比赛中正在被其他私有比赛使用的题目的标题和链接。导入题目的标题重复时,自动加数字后缀导入。
09-29 更新 支持导入HOJ导出的json+in/out的zip文件。
09-17 更新 当增加用户权限时,给管理员email / $OJ_ADMIN 发送提醒邮件,以备查偷偷给自己加权限的学生。
09-06 更新 增加邮件激活账号功能。
08-25 更新 选择题题面用span class=auto_select标记的范围,自动生成单选框控件;题面标注“多选”,生成复选框。
08-05 更新 在AC时记实际分数,不再是100分,比赛可以组合合适的题目,使OI排名中的总分为100分。
08-04 更新 支持多选题,允许用<input type=checkbox name=1 value=A> 添加多选按钮。
08-03 更新 当题目是选择题时ACE自动关闭,露一手中提交显示分数,选择题允许用<input type=radio name=1 value=A> 添加单选按钮。
07-23 补丁 改善远程判题remote_bas的性能,更新部分菜单中文显示,修补手动判题功能。
06-20 更新 后台题目列表支持跨页选择,自动保存已选题目状态。优化ubuntu22.04安装脚本,支持512M迷你服务器。
06-08 补丁 改善对hydroOJ题目导入的支持。
04-21 更新 支持基于文件名的subtask绑定。默认字体颜色调黑。
04-17 更新 设置$OJ_BG="bing";每小时从bing.com动态更新一次背景图片。
04-10 更新 增加对syzoj导出的zip文件的支持(可以导入题面和数据)。开源《信息学奥赛一本通 —— 编程启蒙》题库接口。
04-07 更新 22.04的安装脚本开始用podman作为默认容器管理程序。
04-05 更新 增加了OJ_DEDICATE参数优化判题效率,增加podman可选平替docker(感谢Azure99指点迷津)。
04-03 更新 增加了每小时注册数量限制$OJ_REG_SPEED,私有比赛的观战限制开关$OJ_NO_CONTEST_WATCHER。
03-31 更新 优化了对于内存小于1G的系统安装时mysql占用问题,解决个人信息不能修改的问题。
03-27 更新 优化了查重功能,减少系统资源占用。zzb16888 贡献了导出总排名功能。
03-25 更新 TK题库所有含洛谷标签的题目,全部免费下载。
03-24 更新 毛玻璃特效和更便捷的背景图片,为syzoj皮肤增加首页提交图表。
03-23 更新 增加RemoteOJ的开关,默认关闭,修订remote_hdu.php。 宝硕贡献remote-luogu.php。
03-20 补丁 修正部分题面因不正确使用大于小于号导致的显示问题。
03-19 补丁 优化RemoteOJ的轮询频次和逻辑。
03-06 补丁 改善RemoteOJ方式的题目的分类标签显示形式。
03-01 更新 测试数据管理界面显示题目的标题,Main.c/cc不存在的时候自动生成9对空文件供填写。
02-28 补丁 万能头和iostream同时使用可能导致编译出错(更新Dockerfile,重新运行docker.sh)
02-27 更新 RemoteJudge 模块(vjudge-hdu)
02-26 更新 新题分类默认继承最后一题
02-25 更新 RemoteJudge 模块(vjudge-poj)
02-14 补丁 修复测试数据压缩操作失败问题。
2022年
日期 类型 更新内容
12-14 更新 手机界面优化,单IP登录限制。
12-06 致敬 长者一路走好!
11-30 更新 syzoj皮肤增加了利用localStorage自动保存临时代码的功能。
11-18 更新 管理后台帮助页首行增加服务器状态。
11-16 补丁 给Docker容器中的/usr/include/c++/9/iostream打补丁,禁用endl的cout.flush()操作,提高cout性能。
11-15 补丁 修复新版本golang报错Urgent I/O condition和 Forbidden system call:35 [35]
11-12 补丁 修补中间的特定数量题目以后,大序号的题目不显示的问题。
11-06 更新 增加简单的导入HydroOJ打包zip(yaml+目录)格式题目的功能,目前不支持图片等高级特性,老版本需要自行安装php-yaml(sudo apt install php-yaml)。
10-19 更新 将syzoj首页中的排名更换为标题为HelloWorld!的新闻内容,可在db_info.inc.php中配置$OJ_INDEX_NEWS_TITLE的值来选择要在首页显示的新闻。
10-18 更新 增加以csv格式导入用户列表的功能,如有中文内容,需以UTF-8编码。
10-12 更新 增加简单的导入QDUOJ打包zip(json+目录)格式题目的功能,目前不支持图片等高级特性。
10-08 更新 增加$OJ_MARKDOWN开关,实验性支持markdown语法,用[md] [/md]在源码模式嵌入题面和新闻,也支持<div class='md' ></div>
10-05 更新 允许在题面、新闻中上传更多的文件类型。
09-19 更新 优化了露一手功能的页面布局
08-31 补丁 QQ邮箱作为发件邮箱,不能发送找回密码邮件。
08-30 补丁 修复管理员前台不能翻页到最后几页,看不全题目。
08-29 补丁 docker镜像切换阿里云后自动重新加载。
08-14 更新 spj扩展了2=RawTextJudge,用于选择填空题的判题。
07-18 更新 存档很少人用的blockly目录到blockly.tar.gz, 未来从web目录中删除,留一个web下载链接在db_info.inc.php供需要的用户下载。
07-14 补丁 修复了论坛无贴打不开的问题。
07-10 补丁 修复了php8.1(Ubuntu22.04) 不能上传图片和不能压缩文件的问题。
06-05 更新 新增了HelloWorld公告,Cobol,Github的自动化集成测试增加判题测试,基于docker/Ubuntu22.04.
05-17 更新 对Ubuntu22.04及PHP8.1进行了针对性修复。
05-09 更新 增加了ubuntu20.04下的宝塔安装脚本与配套说明。
01-15 更新 测试数据文件管理器中增加生成.out文件和.ans文件批量改名功能。
01-12 补丁 修复nodejs,增加部分系统调用。
01-10 更新 移除部分老式代码,为php8.1进行兼容性调整,增加适用于Ubuntu22.04lts的安装脚本。
01-03 补丁 修复图片上传路径的问题。
01-01 补丁 修复Docker中-lm不能加载sqrt函数的问题。
1月 喜讯 star过2.5k!
2021年
日期 类型 更新内容
12-31 更新 增加UOS20安装脚本
12-21 更新 让题单plist元素可以收缩,标题链接打开新窗口。
12-18 更新 给admin下的problem_list等页增加汉化
12-16 补丁 给龙芯补充新的系统调用
10-17 更新 给默认syzoj添加discuss
10-16 更新 设置默认模板为syzoj
10-15 更新 syzoj模板国际化字符串替换
10-12 更新 SaaS模式实例 MyOJ 上线 http://my.hustoj.com/
09-30 更新 增加JudgeHub程序,为SaaS建立技术平台。
09-28 更新 增加友善级别$OJ_FRENDLY_LEVEL,辅助初级用户快速配置系统。
09-03 更新 增加管理员双击修改用户昵称的功能。
09-01 更新 新增一个OJ_AUTO_RESULT=4,让机器判断结果AC可以被设定为4或者14,4代表正确,14代表机器判断通过,等待人工复核。让拥有HTTP_JUDGE权限的用户手工给出结果。
08-17 补丁 修复了Mathlab等多种语言在Ubuntu20.04的运行环境,对docker增加了限制参数,对运行的环境变量做了统一。
07-11 更新 增加了新闻页对BBcode的支持,并增加了[plist=1000,1001]题单名称[/plist]语法,支持在新闻页中添加题单。
07-05 补丁 修补并增强了隐藏功能中的UOJ题目摘抄功能,使用时注意频率,请勿给UOJ带来过多流量压力。
06-22 补丁 修复其他模板运行结果自动刷新的问题。
06-20 补丁 修复其他模板部分静态资源不走CDN的问题。
06-20 补丁 修复bs3部分静态资源不走CDN的问题。
06-19 更新 允许设置不参与ranklist排名的管理员列表,$OJ_RANK_HIDDEN="'admin','zhblue'";
06-18 更新 允许在docker内使用外部的judge_client判题,方便更新judge_client。judge.conf新增选项:OJ_INTERNAL_CLIENT=1
06-16 更新 允许使用"tpj"作为文件名,命名一个基于testlib.h的spj,当"tpj"文件存在时,优先用tpj进行特判。
06-12 更新 gcc/g++ 优化级别可配置,默认-O2,允许用OJ_CC_OPT进行覆盖。
06-06 更新 Ubuntu20.04的机器上,让C的标准升级为C17,允许用OJ_CC_STD进行覆盖。
06-05 更新 Ubuntu20.04的机器上,让C++的标准升级为C++17,允许用OJ_CPP_STD进行覆盖。
05-02 补丁 禁止查看进行中的比赛所用的题目在比赛之前提交的源码,避免训练中偷懒复制老代码。
04-08 更新 增加可选的docker作为judge_client外部容器,以增强安全性。参考用法
03-26 更新 增加权限类型VIP,拥有VIP权限的账户,可以参加所有标题含[VIP]标记的私有比赛。
03-08 补丁 修复在Ubuntu20.04上运行sqlite3
02-06 更新 新的模板 mdui 基本可用,如需启用新模板,只需修改 /home/judge/src/web/include/db_info.inc.php ,设置 $OJ_TEMPLATE="mdui"; 即可。如需内网使用,请在 /home/judge/src/web/include/db_info.inc.php 末尾添加 $MDUI_OFFLINE=true; 即可。 (Author: @renbaoshuo)
01-01 更新 新的模板 syzoj 基本可用,如需启用新模板,只需修改 /home/judge/src/web/include/db_info.inc.php ,设置 $OJ_TEMPLATE="syzoj"; 即可。 (Author: @renbaoshuo)
2020年
日期 类型 更新内容
12-30 更新 新版 wiki 已经迁移至本仓库,可通过 https://zhblue.github.io/hustoj/ 访问。
12-29 更新 导入导出FPS(xml)时,增加文件名,默认排序。
12-28 更新 增加手工指定测试数据分值的特性,文件名test01[60].in 代表1号数据60分。
12-27 补丁 修补龙芯上因为系统调用而提前超时的问题。
12-21 补丁 修补手工添加题目失败的问题。
12-07 更新 HTTP判题机可以通过账号的problem_start/problem_end限制其领取任务的题目号范围,配合judge.conf中的HTTP_DOWNLOAD=0可以让不方便更新判题数据的判题机发挥部分功效。
12月 喜讯 star过2.0k!
11-30 更新 优化s树莓派4安装脚本,修补漏洞、合并关于下载排名文件的更新。
11-29 更新 优化输入数据提供方式,提高整体判题效率。
11-28 补丁 修复18.04以上系统里C++编译错误,对C/C++输出中文尝试支持。
11-22 补丁 修复部分RuntimeError, 更合理的限时控制。
09-23 更新 针对Github国内访问缓慢,安装脚本SVN超时的情况进行了安装脚本优化,解决了18.04/20.04安装失败的问题。
09-20 补丁 修复私有比赛题目不正确列出的问题。
08-08 补丁 增加了环境"PYTHONIOENCODING=utf-8",修复Python3环境下不能输出中文字符的问题。
07-13 更新 允许长时间维持登录状态,管理员可自定义维持时间. 开启方式:修改 /home/judge/src/web/include/db_info.inc.php,设置 OJ_COOKIE_LOGIN=true;,自定义OJ_KEEP_TIME自最后一次登陆起最长允许保持登录的时间
07-12 更新 允许在WA掉的时候,ShOW_DIFF打开的情况下,下载出错的一组测试数,zip方式打包.in/.out文件
02-10 更新 新的模板 bshark 基本可用,如需启用新模板,只需修改 /home/judge/src/web/include/db_info.inc.php ,设置 $OJ_TEMPLATE="bshark";
01-31 更新 @melongist 增加了很多页面美化。
01-27 更新 题目限时增强为浮点型,3位小数精度,即标称毫秒(ms)。
01-26 更新 允许为每个Web添加多个UDP通知对象,每个判题服务器允许使用不同的UDP端口监听消息。阿里云+腾讯云测试通过。
01-23 更新 修订了Moodle集成代码,实现HUSTOJ给moodle系统作业自动判分。
01-20 更新 删除 noip 模式比赛的多余提交记录,允许自定义 noip 关键词,增加 privilegeuser_id 索引。
2019年
日期 类型 更新内容
12-19 更新 增加了 judge.conf 中的注释,提供了备案号变量 $OJ_BEIAN ,对系统判题时间分辨率进行了更新优化,提高灵活度。
11-23 喜讯 hustoj 在首届深度软件开发大赛中获得三等奖
11-21 补丁 修复比赛中点击 Edit 按钮后可以选择出题人禁用的语言提交【感谢湘潭大学谢老师的报告】。
11-20 更新 在运行结果对比输出(OJ_SHOW_DIFF)中提示每个数据点的结果(AC/WA/TLE...)。
11-16 优化 @muzea 开发了从 GitHub 到 Gitee 的同步机制,并部署了CI。
11-13 更新 在运行时错误(RuntimeError)中显示数据点文件名(infile)
10-30 更新 提供 $OJ_OI_MODE 开关。
10-29 更新 加强了 OI 模式下的限制,控制 Web 行为。
10-03 更新 修订测试 deepin 15.11 安装脚本
10-03 补丁 注册页面验证 csrf
09-23 补丁 修复昵称比赛中不更新问题,以及提醒官方群用户及时更新处理504超时问题。
09-21 补丁 修复部分安装脚本不能执行第二次的问题
08-06 更新 支持用UDP数据包触发判题轮询,实现Web本地judge秒判。
07-26 更新 支持华为鲲鹏服务器,aarch64,感谢深度科技公司和华为云提供鲲鹏服务器。
07-06 更新 对于标题带有 NOIP 字样的比赛,比赛结束后才能看到结果。
07-04 更新 设置 $OJ_MARK="mark" 显示得分,$OJ_MARK="percent" 显示错误率(WA)或通过率(AC),设置 $OJ_MARK="" 只显示最终结果。
06-24 文档 对项目首页进行分块标注,调整顺序和内容,增加目录。
06-12 更新 添加 Fortran 语言、Matlab(Octave),修订:比赛结束后编辑时丢失提交统计数据、修复部分RE。
05-18 修订 16.04以上版本FB显示异常。 基于OpenJudger的Windows集成便携版 浙传网盘
05-17 修订 改善ajax,减少并发量,降低web压力,提高judge轮询效率。
05-15 修订 修复了部分TLE误判为RE的情况,主要是在Ubuntu18/19 Deepin15.9/15.10 以上的版本,估计与gcc/g++有关。
05-07 更新 @muzea 提供了 Debian 安装包打包(*.deb), https://github.com/zhblue/hustoj/releases
04-13 更新 支持 SQL 判题,基于 SQLite3 ,支持龙芯3A3000(致谢江苏航天龙梦信息技术有限公司提供龙芯主机!)。
03-14 更新 主线支持 树莓派(arm) 龙芯(loongson-2f) i386 x86_64

安装说明

视频教程

Ubuntu 18.04 安装 (https://www.bilibili.com/video/BV1Mp4y1C7Xx)

注意事项

根据你选择的发行版不同,从下面三个脚本里选一个来用。

不要相信百度来的长篇大论的所谓教程,那些都是好几年前的老皇历了,会导致不判题,不显示,不好升级等等问题。

尤其别装 Apache ,如果已经安装,请先停用或卸载,以免80端口冲突。

不要 使用 LNMP LAMP Cpanel 或其他面板程序提供的 Mysql Nginx Apache PHP 环境,安装脚本已经包含所有必须环境的安装。

腾讯云用户请 换软件源 ,增加 multiverse

阿里云用户请百度 阿里云 80端口

基于 Ubuntu 22.04 安装

各类公有云首选, 最容易,成功率最高,近期部署数量最多,开发者原型机

仅支持原生Ubuntu系统,不支持WSL和docker中的Ubuntu系统

建议服务器配置双核2G内存以上

wget http://dl.hustoj.com/install.sh
sudo bash install.sh

基于 Ubuntu 20.04 安装

仅支持原生Ubuntu系统,不支持WSL和docker中的Ubuntu系统

建议服务器配置单核2G内存以上

wget http://dl.hustoj.com/install.sh
sudo bash install.sh

脚本运行完成直接浏览器输入ip地址即可访问,如不能打开请检查访问策略防火墙设置是否打开80端口。

提醒:阿里云的 Ubuntu 20.04 预装了 apparmor ,小概率可能会造成 systemdumount 进程卡CPU 100% 可能的解决方案1:安装docker(运行judge_client目录下的docker.sh)并启用OJ_USE_DOCKER=1 或2:卸载阿里云盾。**

基于 Ubuntu 18.04 安装 即将脱离维护期,不推荐

wget http://dl.hustoj.com/install.sh
sudo bash install.sh

校园网安装

近期 Github 的 SVN 访问缓慢,可以到 Releases 中下载 tar.gz 版本,然后用 install 目录下的 *-bytgz.sh 脚本安装。

但是注意这样安装的实例,将来升级时只能手工升级。

Ubuntu 18.04 为例:下载好 Releases 中的 Source code(tar.gz),然后准备好 install-ubuntu18-bytgz.sh

sudo bash install-ubuntu18-bytgz.sh 19.06.04.tar.gz

基于 Ubuntu 20.04+宝塔 安装

先看宝塔系统安装HUSTOJ指南v0.2.docx

wget http://dl.hustoj.com/install-ubuntu-bt.sh
sudo bash install-ubuntu-bt.sh

Ubuntu 更换软件源

下列两个脚本可以二选一,对于使用腾讯云镜像Ubuntu 原版镜像的用户,推荐使用脚本二。

  • 脚本一
wget http://dl.hustoj.com/sources.list.sh
sudo bash sources.list.sh
  • 脚本二
wget http://dl.hustoj.com/update-sources-ubuntu.sh
sudo bash update-sources-ubuntu.sh

基于 Deepin 20+ 安装

国内桌面用户 Deepin 20+ (内置QQ、微信、WPS方便出题人本地测试,最新20测试通过)

wget http://dl.hustoj.com/install-deepin20+.sh
sudo bash install-deepin20+.sh

基于 UOS 20+ 安装

国内桌面用户 UOS 20+ (内置QQ、微信、WPS方便出题人本地测试,最新20测试通过)

wget http://dl.hustoj.com/install-uos20.sh
sudo bash install-uos20.sh

基于 CentOS 安装 CentOS发行策略改变,未来前景不确定,不推荐

假如你不得已非要用centos7 (有的语言可能不支持,但是某些机架式服务器的Raid卡Ubuntu不认只能装CentOS),可以用下面脚本快速安装OJ:

wget https://raw.githubusercontent.com/zhblue/hustoj/master/trunk/install/install-centos7.sh
sudo bash install-centos7.sh

REDHAT / CentOS 用户请浏览

https://github.com/zhblue/hustoj/blob/master/wiki/CentOSx86_64.md

https://github.com/zhblue/hustoj/blob/master/wiki/CentOS.md

基于 Docker 安装

基于 Docker 安装,可用于快速体验 HUSTOJ 的全部功能,可能存在未知的魔法问题,请慎重考虑用于生产环境!!!

使用构建好的 Docker 镜像(GitLab CI/CD系统自动构建)

docker run -d           \
    --name hustoj       \
    -p 8080:80          \
    -v ~/volume:/volume \
    registry.gitlab.com/mgdream/hustoj

由于 Web端/数据库/判题机 全部被打包在同一个镜像,无法扩展,不推荐使用此镜像做分布式判题,另外请不要在 Docker 中使用 SHM 文件系统,会由于内存空间不足无法挂载沙箱环境而导致莫名其妙的运行错误

部署后使用浏览器访问 http://localhost:8080

基于Docker安装(分布式)

Docker分布式改造基本完成,目前支持web/mysql/judge基础镜像,支持使用环境变量进行配置。 目前judge镜像仍处于不稳定状态,有能力的用户对docker/judge进行完善。

在本地执行前需要先创建Docker网络docker network create hustoj,使用下面的命令来运行对应的服务。

  • MySQL服务
docker run -d \
    --network hustoj \
    --name hustoj.mysql \
    -e MYSQL_USER=<mysql_username> \
    -e MYSQL_PASSWORD=<mysql_password> \
    -v mysql:/var/lib/mysql \
    registry.gitlab.com/mgdream/hustoj:mysql

基础镜像为mysql:5.7,所有的环境变量都继承自mysql:5.7官方镜像,默认提供数据库为jol

  • Web服务
docker run -d \
    --network hustoj
    --name hustoj.web \
    -e DB_HOST=<mysql_server> \
    -e DB_NAME=<mysql_database> \
    -e DB_USER=<mysql_username> \
    -e DB_PASS=<mysql_password> \
    -v data:/home/judge/data \
    -p 80:80 \
    registry.gitlab.com/mgdream/hustoj:web

基础镜像为ubuntu:18.04,使用php版本为php7.2,所有的环境变量都继承自db_info.inc.php文件,后续会完善php与nginx的环境变量配置。

基于其他发行版安装

其他的发行版,如Debian10+(Debian10/11) 树莓派的 raspbian8/9 , ubuntu14.04的安装脚本在 install 目录可以找到,但是可能存在少量细节不完善,安装后需要部分手工修复调整。

https://www.youtube.com/watch?v=hRap7ettUWc

树莓派用户请用 rpi 分支源码(实验性质)手工搭建 web ,并编译安装 core 目录下的 judgedjudge_client

更多安装方法

LiveCD下载安装

家宽下载 Linux不熟悉的用户、内网用户、无网用户无法使用标准版Ubuntu安装时推荐使用。

HUSTOJ_LiveCD(发送"livecd"到微信公众号 onlinejudge ,获得百度云下载链接)

使用说明见iso中README,也可以参考LiveCD简介

Linux新手请看鸟哥的私房菜

建好系统需要题目,请访问TK题库freeeproblemset项目

卸载阿里云盾

逐条执行下列代码删除阿里云盾:

# 卸载云盾
wget http://update.aegis.aliyun.com/download/uninstall.sh
chmod +x uninstall.sh
./uninstall.sh
wget http://update.aegis.aliyun.com/download/quartz_uninstall.sh
chmod +x quartz_uninstall.sh
./quartz_uninstall.sh
# 删除残留
pkill aliyun-service
rm -rf /etc/init.d/agentwatch /usr/sbin/aliyun-service
rm -rf /usr/local/aegis*

重启后若执行 ps -aux | grep -E 'aliyun|AliYunDun' 显示没有阿里云盾相关进程即为卸载成功。

装后须知

Python重度用户注意查阅

常见问题自动应答微信公众号: hustoj

关注后回复: 新装系统、升级、目录等关键词,系统会自动回复相关帮助。

有问题请先查阅 FAQ常见问答Wiki使用技巧 或使用搜索引擎。

安装完成,用admin作为用户名注册一个用户,自动成为管理员。

大部分功能和选项的开关和参数调整都在配置文件中,安装后几个重要配置文件的位置如下:

路径 内容
/home/judge/etc/judge.conf 判题 judged judge_client
/home/judge/src/web/include/db_info.inc.php Web
/etc/php5/fpm/php.ini/etc/php7.0/fpm/php.ini/etc/php.ini (in Centos7) php
/etc/nginx/sites-enabled/default/etc/nginx/nginx.conf (in Centos7) nginx

如果用户量比较大,报 50x 错误,可能需要修改 /etc/nginx/nginx.conf 中的设置:

	worker_processes 8;    #其中数字8可以取CPU核心数的整数倍。
	events {
		worker_connections 2048;
		multi_accept on;
	}

如果遇到比赛人数多,比赛排名 xls 文件无法下载,请修改 /etc/nginx/sites-enabled/default ,在 fastcgi_pass 一行的后面增加

 	fastcgi_buffer_size 128k;
        fastcgi_buffers 32 32k;

保存后,重启 nginx

备份

脚本安装的用户,可以使用 install 目录中的 bak.sh进行备份。

sudo bash /home/judge/src/install/bak.sh

备份后的数据在 /var/backups/ 目录下, 命名格式为 hustoj_%Y%m%d.tar.bz2。

百度学习crontab的用法后,可以使用 sudo crontab -e 定制自动备份计划,部分安装脚本中包含了自动备份,但可能需要运行上面的语句一次来激活。

迁移到CentOS

如果你需要进行跨系统迁移(如从 Ubuntu 迁移到 CentOS ),可以尝试使用下面的脚本backup+.sh进行备份, 对应的*.tar.gz,备份的文件需要用restore+.sh还原。

sudo bash /home/judge/src/install/backup+.sh  #备份后的归档在 `/home/judge/backup` 命名格式为 +%Y-%m-%d-%H-%M-%S.tar.gz

迁移

首先在新服务器上做全新安装和测试,没有问题后,再迁移数据。

将你需要迁移的归档复制到目标系统的/home/judge/backup目录下,执行下面的脚本进行恢复

cd /home/judge/backup
sudo bash /home/judge/src/install/restore.sh hustoj_%Y%m%d.tar.bz2

脚本的第一个参数为恢复的目标归档,如果没有参数则默认为按名字排序后字典序最大的归档

*如果是backup+.sh备份的.tar.gz文件,用restore+.sh还原。

cd /home/judge/backup
sudo bash /home/judge/src/install/restore+.sh +%Y-%m-%d-%H-%M-%S.tar.gz

更新升级

脚本安装的用户,可以使用 install 目录中的 update-hustoj 进行更新升级。

sudo bash /home/judge/src/install/update-hustoj

升级脚本执行后,可能需要登陆web端管理后台,执行一次更新数据库。

  • hustoj开源版的所有历史版本,只要没有对数据库结构进行改动,都可以无损升级到最新版本,包括10年以上历史的早期版本。
  • 如果老系统更新有疑问,随时加官方群咨询群主。

修复

自己不小心改坏了 web 代码,可以使用 install 目录中的 fixing.sh 进行系统修复。

sudo bash /home/judge/src/install/fixing.sh

支持捐助、加入社区

使用上需要帮助,请加用户交流 QQ 群 23361372 ,验证问题答案:【学校、公司、机构】姓名

或加TG群。

群共享有题库、安装盘、文档 ,群内可以讨论、答疑 。 新加群,请改群名片,5分钟后可以发言。 请尊重开源软件开发者的辛苦劳动,出言不逊者将被踢出。

您可以用这几种方式支援本项目:

1、领取并使用支付宝红包

2、在 TK题库 充值下载题目

3、右上角点击Star,给本项目加星

4、保留您安装使用的系统中页脚的公众号和红包二维码

5、在您的论文中引用本项目的网址

6、向其他老师同学推荐本项目

系统演示

前台演示 龙芯部署

后台功能

硬件需求

处理器1CPU核心, 1G内存,20G硬盘可以安装,1Mbps 网络带宽,约能满足20~50人轻度使用。

人数每增加50人,等比例增加核心数,内存,硬盘空间和网络带宽。

阿里云腾讯云华为云,最小学生机均可稳定运行。

更严谨的请求数 QPS 测试,请参考 @muzeaHUSTOJ web 跑分小工具

免费题库

访问项目FPS下载免费例程。

访问TK题库免费专区

FQ访问谷歌代码存档版,下载老版本 FPS 共享题库。

推荐云服务商

搬-瓦+工 UCloud年度大促 快杰云主机推广

推荐开源IDE

小熊猫

GNU GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Lesser General Public License instead.) You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. The precise terms and conditions for copying, distribution and modification follow. GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does. 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program. In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following: a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. 4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. 10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. <one line to give the program's name and a brief idea of what it does.> Copyright (C) <year> <name of author> This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Also add information on how to contact you by electronic and paper mail. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: Gnomovision version 69, Copyright (C) year name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker. <signature of Ty Coon>, 1 April 1989 Ty Coon, President of Vice This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Lesser General Public License instead of this License.

About

hustoj -- 流行的OJ系统,跨平台、易安装、有题库 expand collapse
PHP and 6 more languages
GPL-2.0
Cancel

Contributors

All

Activities

Load More
can not load any more
PHP
1
https://gitee.com/zhblue/hustoj.git
git@gitee.com:zhblue/hustoj.git
zhblue
hustoj
hustoj
master

Search

F2647f8d 8189591 Bbdfb06e 8189591