hustoj ubuntu14.04-i386 安装流程

Ubuntu14.04 i386下hustoj安装的步骤

1.安装mysql

apt-get install mysql-server mysql-client

2.安装 apache2

apt-get install apache2

这里要说明一下的就是 ubuntu 下的 apache 默认网页执行文件夹在 /var/www/ 下面,配置文件在 /etc/apache2/apache2.conf ,配置文件子目录在 /etc/apache2/ 下

进入火狐浏览器,键入 http://localhost ,出现 It works !代表安装成功

3.安装 php

apt-get install php5 libapache2-mod-php5

重启 apache ,输入 /etc/init.d/apache2 restart

安装文本编辑器 gedit

apt-get install gedit

...(图见原博客)

/var/www/html/info.php

进入火狐浏览器,键入 http://localhost/info.php ,出现 php 属性页面代表安装成功

4.安装onlinejudge(ubuntu14.04 i386)

执行如下命令
    sudo apt-get update
    sudo apt-get install subversion
    sudo svn co https://github.com/zhblue/hustoj/trunk/trunk/install hustoj
    cd hustoj
    sudo bash install-interactive.sh


进入火狐浏览器,键入http://localhost/JudgeOnline,出现JudgeOnline页面代表安装成功, 其他相关问题查看 http://code.google.com/p/hustoj/wiki/FAQ

安装pascal和java编译器

hustoj安装完默认只能判c和c++代码

sudo apt-get install fpc openjdk-6-jdk

PS:1.svn锁定副本的问题:

你回到他的上级目录进行clear up,如果还不行,那就回到最上级的目录进行clear up

我出现的是judge-read-only的副本锁定问题,导致本应下载的内容下载不下来,我就干脆把这个文件夹删了,重新安装了一遍!

2.如果出现

Could not connect: Access denied for user 'root'@'localhost'(using password: YES)

那么打开目录:

var/www/html/judgeonline/include中的db_info.inc.php

把DBPASS改成数据库密码(之前设置的)

5.设置apache服务器网站根路径(设置之后可通过IP访问OJ)

1.进入目录 /etc/apache2/sites-aviliable/

2. 打开目录下的两个文件( default 什么的),把其中的 documentroot 后面加上 judgeonline

3.然后重启apache2 :终端输入

/etc/init.d/apache2 restart

这样应该就 OK 了。

终端 ipconfig, 找到本机 IP 地址,浏览器中输入 IP ,登陆 OJ

6.注册帐号测试 admin 功能

来,打开OJ,注册一个账号,下面我们来为这个账号获得管理员权限

比如说我注册的帐号叫 yutou

第一步,终端进入 输入sudo su 输密码

第二步 输入 mysql –u root –p 回车

然后输密码 进入mysql

第三步 输入 show databases;查看所有数据库

第四步, 输入 use jol;(hustoj用户数据库) 要想进去的话就输入select * from jol;

第五步 输入

insert into privilege(user_id,rightstr)values('yutou','administrator');

如果你的帐号叫zhangkun,那么只需要更改帐号部分,如

insert into privilege(user_id,rightstr)values('zhangkun','administrator');

OK 大功告成,这样你的账号就有管理员权限了。。。。重点是选对数据库。

7.一直PENGIND的情况

弄完之后登录OJ交题出现题目一直PENGIND的情况,如果你也出现,解决办法如下

判题程序judged需要用root帐号启动,请重启服务器或手动执行sudojudged。如果无效,请检查/home/judge/etc/judge.conf中的数据库账号配置,把其中的root密码和admin的密码改成自己设置的。

参考 Configuration ,修正后再次重启服务器或执行sudo pkill-9 judged等待一会儿再执行sudo judged

下图是成功的标志。。。

8.后续问题:

hustoj配置文件

http://blog.csdn.net/zhblue/article/details/7366194

/home/judge/etc/judge.conf

/var/www/html/JudgeOnline/include/db_info.inc.php

改变蓝色边框颜色:/var/www/html/JudgeOnline/template/bs/image

重启 apache ,输入 /etc/init.d/apache2 restart

9.oj的其他问题

谷歌浏览器下无法编辑问题

reserve的问题可以被看到

参考

http://blog.csdn.net/chaoshenyutou/article/details/40183965

https://github.com/zhblue/hustoj

搭建oj环境:

http://aaron67.cc/blog/ubuntu-server-12-04%E6%90%AD%E5%BB%BAhustoj/

http://blog.csdn.net/chaoshenyutou/article/details/18950909

OJ问题讨论版

http://code.google.com/p/hustoj/issues/list?can=1&q=label:Priority-Medium&x=&y=&mode=grid

怎样使用,安装mysql指令

http://www.cnblogs.com/zhuyp1015/p/3561470.html

有关java RE的问题

https://code.google.com/p/hustoj/issues/detail?id=99

配置文件

http://blog.csdn.net/zhblue/article/details/7366194

What steps will reproduce the problem?

1. Install Ubuntu 14.04 LTS (64bit) ;-)

1. 安装 Ubuntu 14.04 LTS (64bit)

2. Submit a C/C++ code

2. 提交 C/C++ 程序(#include <stdio.h> 然后只有 scanf 和 printf,就是最普通的那个 A+B =_=

3. Get Runtime Error:[ERROR] A Not allowed system call: runid:8674 called:89

3. 然后就 RE 了,call 号是 89,虽然我也不知道它 readdir 干嘛,但是它就是调用了。

What is the expected output? What do you see instead?

Accepted ;-), but get Runtime Error:[ERROR] A Not allowed system call: runid:8674 called:89

What version of the product are you using? On what operating system?

Ubuntu 14.04 LTS (64bit), gcc (Ubuntu 4.8.2-17ubuntu1) 4.8.2, HUSTOJ core lastest svn(最后的 svn 版本)

Ubuntu 14.04 LTS 32bit not tested. Errors may occur =w= (32 位没有测试,不过估计可能也会有问题)

Please provide any additional information below.

add 89 with HOJ_MAX_LIMIT in okcalls.h and problem solved.

然后我在 okcalls.h 里加了个 89 和 HOJ_MAX_LIMIT 就可以了。