安裝hustoj須要lamp環境。php
前提工做:mysql
更新軟件庫:git
sudo apt update
更新所有軟件: github
sudo apt upgrade
(一)安裝mysql5.7:sql
sudo apt-get install mysql-server mysql-client
安裝過程當中會彈出框來讓你設置密碼,這個密碼要記住,在安裝hustoj的時候要用到。apache
(二)安裝Apache2:ubuntu
sudo apt-get install apache2
ubuntu下默認網頁是放在/var/www下的,在瀏覽器輸入127.0.0.1,看到It works 就說明成功安裝了。瀏覽器
(三)安裝php7.0:bash
在ubuntu16.04版本下安裝hustoj須要PHP7的環境,官方說的。服務器
sudo apt-get install php7.0 libapache2-mod-php7.0
安裝完後重啓Apache服務器:
/etc/init.d/apache2 restart
建立a.php文件,內容爲:
<?php phpinfo();?>
在瀏覽器中訪問127.0.0.1/a.php查看是否安裝成功PHP
如今LAMP環境以及搭建好了,開始安裝hustoj
首先運行這個
sudo apt-get update sudo apt-get install subversion
下一步就有所不一樣,查了不少博客都是運行:
sudo svn co https://github.com/zhblue/hustoj/branches/php7/trunk/install hustoj
但關鍵是:這個url以及失效了,經過GitHub能夠查到install的url是https://github.com/zhblue/hustoj/tree/master/trunk/install
那麼經過svn下載源代碼時就要運行:
sudo svn co https://github.com/zhblue/hustoj/trunk/trunk/install hustoj
下載後進入這個目錄 : cd hostoj
最後運行下面這句就能夠了。
sudo bash install-interactive.sh
經過訪問http://IP/JudgeOnline就能夠了。