Skip to content

NENU-OJ/online-judge

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 

Repository files navigation

OnlineJudge

WEB

配置文件

src/front/config/params.phpsrc/front/config/db.php中的字段按照需要进行修改

文件权限修改

如果使用Nginx则需要sudo chown -R www-data:www-data src/front/uploads/avatar/user/ src/front/ckfinder

安装并开启GD库

sudo apt-get install php5.6-gd && sudo service nginx restart

修改文件上传大小限制

sudo gedit /etc/nginx/nginx.conf添加client_max_body_size 20M; sudo /etc/php/5.6/fpm/php.ini修改post_max_size 64Mupload_max_filesize 64M

Ubuntu Mysql 关闭 ONLY_FULL_GROUP_BY

  1. sudo vim /etc/mysql/my.cnf
  2. Add this to the end of the file
[mysqld]
sql_mode = "STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION"

Memcached

  1. sudo apt-get install memcached
  2. sudo apt-get install php5.6-memcached
  3. 重启php-fpmsudo service php5.6-fpm restart
  4. 修改/etc/memcached.conf文件中的-m项为128
  5. 重启memcachedsudo service memcached restart

限制比赛提交

通过src/front/config/params.php文件contestWhiteList字段以白名单方式管理,若这个列表为空则表示无限制,否则只有列表中的比赛可以提交,非比赛提交id0。 例:

  • 没有限制:[]
  • 只有比赛1和比赛2可以提交:[1, 2]
  • 只有比赛3和非比赛提交:[0, 3]

Docker

Memcached

Run src/memcached/start.sh

MySQL

Set up environment variables and run src/mysql/start.sh

Web

Run src/web/builddocker.sh to build.

Set environment variable USE_CDN to true if use CDN to get some javascript and css libs.

Dev

Set environment variable WEB_DEV to true, set permission of src/front/runtime and src/front/views/smarty/templates_c and data folders properly, then run src/web/rundocker.sh.

Prod

Set environment variables properly and set permission of data folders properly, then run src/web/rundocker.sh.