muzea / note

0 stars 0 forks source link

hustoj quick install #14

Open muzea opened 5 years ago

muzea commented 5 years ago

for ubuntu 14

apt-get update
apt-get  install  git gcc  g++ make libmysqlclient-dev libmysql++-dev -y
mkdir /home/judge
cd / && git clone https://github.com/zhblue/hustoj.git

cd /hustoj/trunk/core/judged
make
chmod +x judged
cp judged /usr/bin
cd ../judge_client
make
chmod +x judge_client
cp judge_client /usr/bin
mkdir /home/judge/etc
mkdir /home/judge/data
mkdir /home/judge/log
mkdir /home/judge/run0
useradd -m -u 1536 judge
chown -R judge /home/judge
chmod 775 /home/judge /home/judge/data /home/judge/etc /home/judge/run?

apt-get install vim nginx php5-fpm php5-mysql -y
apt-get install mysql-server -y
cd && wget https://raw.githubusercontent.com/zhblue/hustoj/master/trunk/install/db.sql && mysql -uroot -phustoj < db.sql
cd /home/judge/etc && wget https://raw.githubusercontent.com/zhblue/hustoj/master/trunk/install/judge.conf
mv /hustoj/trunk/web /usr/share/nginx/html
chown -R www-data:www-data /usr/share/nginx/html
echo "insert into jol.privilege values('admin','administrator','N');"|mysql -h localhost -u$USER -p$PASSWORD 
muzea commented 5 years ago
PREFIX ?= /usr/local

judged:
    cd core/judged \
    && g++ -Wall -c -I/usr/local/mysql/include/mysql -I/usr/include/mysql judged.cc \
    && g++ -Wall -o judged judged.o -L/usr/local/mysql/lib/mysql -L/usr/lib/mysql  -L/usr/lib64/mysql  -lmysqlclient

judge_client:
    cd core/judge_client \
    && g++ -Wall -c -I/usr/local/mysql/include/mysql -I/usr/include/mysql judge_client.cc \
    && g++ -Wall -o judge_client judge_client.o -L/usr/local/mysql/lib/mysql -L/usr/lib/mysql  -L/usr/lib64/mysql -lmysqlclient

all: judged judge_client

install: all