Detailed ubuntu14.04 build (migration) hustoj record

After entering the system to update the system, personally like the vim editor, so first download the vim editor.

sudo apt-get update
sudo apt-get install vim #Editor depends on personal preference
sudo apt-get install openssh-server #Remote connection tool

Change the domestic download source:

###### Alibaba Cloud Source:
deb http://mirrors.aliyun.com/ubuntu/ trusty main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ trusty-security main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ trusty-updates main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ trusty-proposed main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ trusty-backports main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ trusty main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ trusty-security main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ trusty-updates main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ trusty-proposed main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ trusty-backports main restricted universe multiverse
###### University of Science and Technology Source:
deb http://debian.ustc.edu.cn/ubuntu/ trusty main multiverse restricted universe 
deb http://debian.ustc.edu.cn/ubuntu/ trusty-backports main multiverse restricted universe 
deb http://debian.ustc.edu.cn/ubuntu/ trusty-proposed main multiverse restricted universe 
deb http://debian.ustc.edu.cn/ubuntu/ trusty-security main multiverse restricted universe 
deb http://debian.ustc.edu.cn/ubuntu/ trusty-updates main multiverse restricted universe 
deb-src http://debian.ustc.edu.cn/ubuntu/ trusty main multiverse restricted universe 
deb-src http://debian.ustc.edu.cn/ubuntu/ trusty-backports main multiverse restricted universe 
deb-src http://debian.ustc.edu.cn/ubuntu/ trusty-proposed main multiverse restricted universe 
deb-src http://debian.ustc.edu.cn/ubuntu/ trusty-security main multiverse restricted universe 
deb-src http://debian.ustc.edu.cn/ubuntu/ trusty-updates main multiverse restricted universe
###### Tsinghuayuan:
deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ trusty main restricted universe multiverse 
deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ trusty-security main restricted universe multiverse 
deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ trusty-updates main restricted universe multiverse 
deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ trusty-backports main restricted universe multiverse 
deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ trusty-proposed main restricted universe multiverse 
deb-src http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ trusty main restricted universe multiverse 
deb-src http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ trusty-security main restricted universe multiverse 
deb-src http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ trusty-updates main restricted universe multiverse 
deb-src http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ trusty-backports main restricted universe multiverse 
deb-src http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ trusty-proposed main restricted universe multiverse

Modify the download source:

sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak #Backup
sudo vim /etc/apt/sources.list #modify
sudo apt-get update #update list

Because the desktop version of ubuntu14.04 is installed, uninstall the almost unused software here:

sudo apt-get remove --purge libreoffice* 
sudo apt-get remove unity-webapps-common 
sudo apt-get remove thunderbird totem rhythmbox empathy brasero simple-scan gnome-mahjongg aisleriot gnome-mines cheese transmission-common gnome-orca webbrowser-app gnome-sudoku landscape-client-ui-install 
sudo apt-get remove onboard deja-dup 

This way the system is relatively clean.

Installation script (because I am transplanting the original project and adopting the nginx environment, the script is adapted from the script of Teacher Zhang Haobin):

# Pack all the original projects into the judge.inside tar file
# Below judge are: data etc JudgeOnline log run0 run1 run2 run3
#! /bin/bash
DBUSER=root
DBPASS=root
printf "Input Database(MySQL) Username:"
read tmp
if test -n "$tmp"
then
 DBUSER="$tmp"
fi
printf "Input Database(MySQL) Password:"
read tmp
if test -n "$tmp"
then
 DBPASS="$tmp"
fi
# unzip files
tar -xvf judge.tar
# Update source
sudo apt-get install update
# Compiler Environment
sudo apt-get install mono-mcs subversion 
sudo apt-get install make flex g++ clang libmysqlclient-dev libmysql++-dev
# Java and other compilation environment download
sudo apt-get install ruby2.0-y
sudo apt-get install fpc -y
sudo apt-get install openjdk-7-jdk -y
sudo apt-get install perl -y
sudo apt-get install mono-gmcs -y
# LNMP environment
sudo apt-get install nginx mysql-server php5-fpm php5-mysql php5-gd php-xml-* php-cli php-mbstring redis-server php-redis
sudo mkdir /JudgeOnline
sudo cp -r ./judge/JudgeOnline/* /JudgeOnline
sudo chown -R www-data /JudgeOnline
sudo chmod -R 711 /JudgeOnline
sudo mysql -h localhost -u$DBUSER -p$DBPASS < ./jol.sql
# Restart nginx
sudo service php5-fpm restart 

sudo service nginx restart
# Take out the judged source file to compile and install
sudo svn checkout https://github.com/zhblue/hustoj/trunk/trunk hustoj-read-only
cd hustoj-read-only/core/
sudo ./make.sh
cd ../..
# Create the judge user and root directory
sudo /usr/sbin/useradd -m -u 1536 judge
# Copy the file to the judge&#39;s home directory. This is based on your own situation
sudo cp -r ./hustoj /home/judge
# Change folder permissions
sudo chown -R www-data /home/judge
sudo chown -R root /home/judge/log /home/judge/etc /home/judge/run?
sudo chmod 711 /home/judge /home/judge/data
sudo chgrp judge /home/judge/run?
sudo chmod 771 /home/judge/run?
sudo chmod -R 000 /home/judge/etc

Then modify the /etc/nginx/sites-available/default file.

sudo vim /etc/nginx/sites-available/default

Modify the original server module as follows:

server{

 listen 80;
 listen [::]:80 ipv6only=on;

 root /JudgeOnline;
 index index.php index.html index.htm;

 server_name localhost;

 error_page 404/404.html;
 error_page 500502503504/50x.html;

 location ~ \.php$ {
 try_files $uri =404;
 fastcgi_split_path_info ^(.+\.php)(/.+)$;
 fastcgi_pass unix:/var/run/php5-fpm.sock;
 fastcgi_index index.php;
 fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
 include fastcgi_params;}}

Restart nginx:

sudo service nginx restart 

Log in to the hustoj background to update the database. Then try a question, if there are no questions, you're done.

The above is the whole content of this article, I hope it will be helpful to everyone's study.

Recommended Posts

Detailed ubuntu14.04 build (migration) hustoj record
Detailed ubuntu 20.04 LTS installation record
Ubuntu build etcd
Ubuntu installation record
Ubuntu 14.04 configuration record
Ubuntu build Seafile
Ubuntu 18.04 LTS LAMP build
Ubuntu 17.10 installation toss record
Ubuntu own software record
[Linux] Build Samba server (ubuntu16.04)
ubuntu16.04 build vim and pyt
ubuntu 16.04 build pptpd V** server
Server upgrade Ubuntu 20.04 LTS record
Build Ubuntu 12.04 cross compilation server
ubuntu1804 build the latest Suricata
Server upgrade Ubuntu 20.04 LTS record
ubuntu build python development environment
Ubuntu16.04 build GitLab server tutorial