Qingdao University OnlineJudge2.0 open source project construction

reference

Open source project address

Environment construction document

Official documents

Demonstration Demo

Linux server

Alibaba Cloud Student Server, the minimum installation version of CentOS7.6 is sufficient.

Or use your own local virtual machine (such as VMware) to practice.

For convenience, use the root user to log in.

1. Install necessary dependencies

# 更新yum包管理器
sudo yum update
# 自动配置yum的软件仓库
sudo yum -y install epel-release
# 清除yum缓存
sudo yum clean all
# 安装vim文本编辑器
sudo yum -y install vim
# 安装curl文本传输工具
sudo yum -y install curl
# 安装git
sudo yum install -y git

# 建议使用
# 使用EPEL仓库安装python3.6
sudo yum -y install python36
# 安装docker-compose自动化工具
pip3 install docker-compose

Reference here: Three ways to install Python3 on CentOS

2. Install Docker

# 国内用户使用脚本一键安装
sudo curl -sSL https://get.daocloud.io/docker | sh
# 国外用户使用脚本一键安装
sudo curl -sSL get.docker.com | sh

# 启动docker服务
sudo systemctl start docker
# 设置开机自启动
sudo systemctl enable docker
# 查看docker版本
docker version

3. Installation project

# 选择磁盘空间富裕的位置克隆代码,如当前用户home目录下
git clone -b 2.0 https://github.com/QingdaoU/OnlineJudgeDeploy.git && cd OnlineJudgeDeploy

# 启动服务
# 根据网速情况,大约5到30分钟就可以自动搭建完成,全程无需人工干预。
docker-compose up -d
# 查看容器状态
docker ps -a

4. Visit the project

Access the HTTP 80 port of the server through a browser (if you are using a cloud server, make sure this port is open in the firewall whitelist) or the HTTPS 443 port, and you can start using it. The background management path is /admin, the super administrator user name automatically added during the installation process  root, the password is  rootrootplease be sure to change the password in time .

http://服务器ip地址

Operation result (language can be modified in settings): 

 

appendix

  • Modify port mapping
# docker-compose.yml文件中
# 对应 主机端口号:容器端口号 
# 比如:需要改成8090访问则改为0.0.0.0:8090:8000
...
ports:
      - "0.0.0.0:80:8000"
      - "0.0.0.0:443:1443"
  • Import questions

 

  • Set Python3 as the default version
# 查看当前python版本
which python

# 用户自定义的配置放入/etc/profile.d/目录中
vim /etc/profile.d/python.sh
# 添加内容
alias python='python版本路径'

# 重启会话使配置生效
source /etc/profile.d/python.sh

 

Published 19 original articles · Like9 · Visit 3008

Guess you like

Origin blog.csdn.net/Necrolic/article/details/103592279