搭建OJ-这个版本 并一直解决 RE 问题

#!/bin/bash
#before install check DB setting in 
#	judge.conf 
#	hustoj-read-only/web/include/db_info.inc.php
#	and down here
#and run this with root

#CENTOS/REDHAT/FEDORA WEBBASE=/var/www/html APACHEUSER=apache 
WEBBASE=/var/www/
APACHEUSER=www-data
DBUSER=root
DBPASS=root

#try install tools
sudo apt-get install make
sudo apt-get install flex
sudo apt-get install g++
sudo apt-get install libmysql++-dev
sudo apt-get install php5 
sudo apt-get install apache2
sudo apt-get install mysql-server
sudo apt-get install php5-mysql
sudo apt-get install php5-gd
sudo apt-get install php5-cli
sudo apt-get install mono-gmcs
sudo apt-get install subversion

sudo /etc/init.d/mysql start

#sudo yum -y update
#sudo yum -y install php httpd php-mysql mysql-server php-xml php-gd gcc-c++  mysql-devel php-mbstring glibc-static flex
sudo /etc/init.d/mysqld start

sudo svn checkout http://hustoj.googlecode.com/svn/trunk/ hustoj-read-only
#http://hustoj.googlecode.com/svn/tags/1.2rc/ 解决 一直 RE 问题

#create user and homedir
sudo  /usr/sbin/useradd -m -u 1536 judge

#compile and install the core
cd hustoj-read-only/core/
sudo ./make.sh
cd ../..
#install web and db
sudo mkdir -p $WEBBASE/JudgeOnline
sudo cp -R hustoj-read-only/web $WEBBASE/JudgeOnline
sudo chmod -R 771 $WEBBASE/JudgeOnline
sudo chown -R $APACHEUSER $WEBBASE/JudgeOnline
sudo mysql -h localhost -u$DBUSER -p$DBPASS < db.sql

#create work dir set default conf
sudo    mkdir /home/judge
sudo    mkdir /home/judge/etc
sudo    mkdir /home/judge/data
sudo    mkdir /home/judge/log
sudo    mkdir /home/judge/run0
sudo    mkdir /home/judge/run1
sudo    mkdir /home/judge/run2
sudo    mkdir /home/judge/run3
sudo cp java0.policy  judge.conf /home/judge/etc
sudo chown -R judge /home/judge
sudo chgrp -R $APACHEUSER /home/judge/data
sudo chgrp -R root /home/judge/etc /home/judge/run?
sudo chmod 775 /home/judge /home/judge/data /home/judge/etc /home/judge/run?

#boot up judged
sudo cp judged /etc/init.d/judged
sudo chmod +x  /etc/init.d/judged
sudo ln -s /etc/init.d/judged /etc/rc5.d/S93judged
sudo ln -s /etc/init.d/judged /etc/rc3.d/S93judged
sudo ln -s /etc/init.d/judged /etc/rc2.d/S93judged
sudo /etc/init.d/judged start
sudo /etc/init.d/apache2 restart
sudo /etc/init.d/httpd restart

转载于:https://www.cnblogs.com/robbychan/p/3786770.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值