ubuntu16.04安装hustoj

安装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就能够了。

相关文章
相关标签/搜索