Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

The method of building hustoj by ubuntu14.04

2025-03-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

This article will explain in detail the method of building hustoj on ubuntu14.04. The editor thinks it is very practical, so I share it with you for reference. I hope you can get something after reading this article.

Update the system after entering the system, personally prefer the vim editor, so first download the vim editor.

Sudo apt-get updatesudo apt-get install vim # Editor look at personal preferences sudo apt-get install openssh-server # remote connection tool

Change the domestic download source:

# Ali Yunyuan: deb http://mirrors.aliyun.com/ubuntu/ trusty main restricted universe multiversedeb http://mirrors.aliyun.com/ubuntu/ trusty-security main restricted universe multiversedeb http://mirrors.aliyun.com/ubuntu/ trusty-updates main restricted universe multiversedeb http://mirrors.aliyun.com/ubuntu/ trusty-proposed main restricted universe multiversedeb http://mirrors.aliyun.com/ubuntu/ trusty-backports main restricted universe multiversedeb-src http://mirrors.aliyun.com/ubuntu/ trusty Main restricted universe multiversedeb-src http://mirrors.aliyun.com/ubuntu/ trusty-security main restricted universe multiversedeb-src http://mirrors.aliyun.com/ubuntu/ trusty-updates main restricted universe multiversedeb-src http://mirrors.aliyun.com/ubuntu/ trusty-proposed main restricted universe multiversedeb-src http://mirrors.aliyun.com/ubuntu/ trusty-backports main restricted universe multiverse#: 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# source: 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

Due to the desktop version of ubuntu14.04 installed, software that is rarely used is uninstalled 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

In this way, the system is cleaner.

Installation script (since I am porting the original project and adopting the nginx environment, the script is adapted according to teacher Zhang Haobin's script):

# package all the original projects into the judge.tar file # judge: data etc JudgeOnline log run0 run1 run2 run3 #! / bin/bashDBUSER=rootDBPASS=rootprintf "Input Database (MySQL) Username:" read tmpif test-n "$tmp" then DBUSER= "$tmp" fiprintf "Input Database (MySQL) Password:" read tmpif test-n "$tmp" then DBPASS= "$tmp" fi# extract file tar-xvf judge.tar# update the source sudo apt-get install update# compilation environment sudo apt-get install mono-mcs subversion sudo Download the sudo apt-get install ruby2.0-ysudo apt-get install fpc-ysudo apt-get install openjdk-7-jdk-ysudo apt-get install perl-ysudo 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-redissudo mkdir / JudgeOnlinesudo cp-r. / judge/JudgeOnline/ from other compilation environments such as apt-get install make flex gathers + clang libmysqlclient-dev libmysql++-dev#java * / JudgeOnlinesudo chown-R www-data / JudgeOnlinesudo chmod-R 711 / JudgeOnlinesudo mysql-h localhost-u$DBUSER-p$DBPASS <. / jol.sql# restart nginxsudo service php5-fpm restart sudo service nginx restart# take out judged source files, compile and install sudo svn checkout https://github.com/zhblue/hustoj/trunk/trunk hustoj-read-onlycd hustoj-read-only/core/sudo. / make.shcd. /.. # create judge user and root directory sudo / usr/sbin/useradd-m-u 1536 judge# copy files to judge home directory this change folder permissions sudo chown-R www-data / home/judgesudo chown-R root / home/judge/log / home/judge/etc / home/judge/run?sudo chmod 711 / home/judge/run?sudo chmod-R / home/judge/etc according to your own situation sudo cp-r. / hustoj / home/judge#

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 500502 503504 / 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 to do a problem, if there is no problem, it will be done.

This is the end of this article on "ubuntu14.04 's method of building hustoj". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, please share it out for more people to see.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report