SYZOJ 搭建 Note
开了一台全新的 Aliyun,Ubuntu 20.04
基本按照官方文档走一遍就 OK
但是中间有几个地方卡住了
尝试用 npm install 失败了,后来换成 yarn 就成功了,原因未知
systemctl 始终 fail,所以我直接开了三个 screen,把三个 js 直接运行在 screen 里了
记录一下 history(只剩下最后一部分了……)
ssh-copy-id root@oj.mollnn.com
npm install
cd /opt/syzoj/web && node app.js
vim /opt/syzoj/web/config.json
cd /opt/syzoj/web && node app.js
vim /opt/syzoj/web/config.json
cd /opt/syzoj/web && node app.js
vim /opt/syzoj/web/config.json
cd /opt/syzoj/web && node app.js
lynx localhost:80
apt install lynx
lynx localhost:80
cd /opt/syzoj/web && node app.js
vim /opt/syzoj/web/config.json
cd /opt/syzoj/web && node app.js
rm -rf /opt/syzoj /etc/systemd/system/syzoj*
mkdir -p /opt/syzoj
cd /opt/syzoj
git clone https://github.com/syzoj/syzoj web
cd web
yarn
cd /opt/syzoj/web && node app.js
npm install
npm audit fix
npm audit fix --force
cd /opt/syzoj/web && node app.js
vim /opt/syzoj/web/config.json
mkdir -p /opt/syzoj/config
cp /opt/syzoj/web/config-example.json /opt/syzoj/config/web.json
ln -s ../config/web.json /opt/syzoj/web/config.json
mv /opt/syzoj/web/uploads /opt/syzoj/data
ln -s ../data /opt/syzoj/web/uploads
mkdir /opt/syzoj/sessions
ln -s ../sessions /opt/syzoj/web/sessions
vim mv /opt/syzoj/web/uploads /opt/syzoj/data
vim /opt/syzoj/web/config.json
lynx localhost:5283
lynx 127.0.0.1:5283
cd /opt/syzoj/web && node app.js
systemd
touch /etc/systemd/system/syzoj-web.service
vim /etc/systemd/system/syzoj-web.service
systemctl start syzoj-web
systemctl enable syzoj-web
lynx localhost:5283
rm -rf /opt/syzoj /etc/systemd/system/syzoj*
mkdir -p /opt/syzoj
cd /opt/syzoj
git clone https://github.com/syzoj/syzoj
mv syzoj web
cd web
npm install
cd /opt/syzoj/web && node app.js
mkdir -p /opt/syzoj/config
cp /opt/syzoj/web/config-example.json /opt/syzoj/config/web.json
ln -s ../config/web.json /opt/syzoj/web/config.json
vim /opt/syzoj/web/config.json
cd /opt/syzoj/web && node app.js
ls
npm config set registry https://registry.npm.taobao.org
rm -rf /opt/syzoj /etc/systemd/system/syzoj*
mkdir -p /opt/syzoj
cd /opt/syzoj
git clone https://github.com/syzoj/syzoj web
cd web
yarn
sudo apt remove cmdtest
sudo apt remove yarn
curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
sudo apt install yarn
yarn
mkdir -p /opt/syzoj/config
cp /opt/syzoj/web/config-example.json /opt/syzoj/config/web.json
ln -s ../config/web.json /opt/syzoj/web/config.json
vim /opt/syzoj/web/config.json
mv /opt/syzoj/web/uploads /opt/syzoj/data
ln -s ../data /opt/syzoj/web/uploads
mkdir /opt/syzoj/sessions
ln -s ../sessions /opt/syzoj/web/sessions
adduser --disabled-password --gecos "" syzoj # 以用户名 syzoj 为例
chown -R syzoj:syzoj /opt/syzoj/data /opt/syzoj/sessions /opt/syzoj/config/web.json
cd /opt/syzoj/web && node app.js
vim /opt/syzoj/web/config.json
touch /etc/systemd/system/syzoj-web.service
vim /etc/systemd/system/syzoj-web.service
systemctl start syzoj-web
systemctl enable syzoj-web
systemctl daemon-reload
systemctl enable syzoj-web
cd /opt/syzoj/web && node app.js
lynx localhost:5283
cd /opt/syzoj/web && node app.js
vim /etc/systemd/system/syzoj.service
systemd
vim /etc/systemd/system/syzoj.service
systemd
systemctl start syzojweb
systemctl start syzoj
cd /opt/syzoj/web && node app.js
systemctl start syzoj
systemctl restart syzoj
npm start
systemctl status
systemctl reboot
cd /opt/syzoj/web && node app.js
systemctl restart syzoj
systemctl start syzoj
systemctl status
cd /opt/syzoj/web && node app.js
sudo apt-get install pygmentize
sudo apt-get update
sudo apt-get install pygmentize
cd etc
cd /etc/systemd/system
ls
vim syzojweb.service
systemctl startsyzojweb
systemctl start syzojweb
systemctl statu
systemctl status
systemctl list-units --failed
apt remove systemd
screen
apt install screen
screen -S syzojweb
screen -ls
vim /etc/default/grub
update-grub && reboot
wget -O /sandbox-rootfs.tar.xz https://github.com/syzoj/sandbox-rootfs/releases/download/181202/sandbox-rootfs-181202.tar.gz
mkdir -p /opt/syzoj/sandbox/rootfs
cd /opt/syzoj/sandbox/
tar xvf /sandbox-rootfs.tar.xz
mkdir -p /opt/syzoj/sandbox/{bin,tmp1}
apt install build-essential libboost-all-dev
apt install redis-server
apt install rabbitmq-server
mkdir -p /opt/syzoj
cd /opt/syzoj
git clone https://github.com/syzoj/judge-v3
mv judge-v3 judge
cd judge
yarn
yarn run build
cd /opt/syzoj
cp judge/daemon-config-example.json config/daemon.json
cp judge/runner-shared-config-example.json config/runner-shared.json
cp judge/runner-instance-config-example.json config/runner-instance.json
cd config/
ls
vim daemon.json
vim runner-shared.json
cd ..
cd judge
cd lib
ls
screen -ls
screen -S syzoj-judge-daemon
screen -S syzoj-judge-runner
cd ..
cd web
screen -S syzoj-web
screen -ls
history
history | cut -c 8-