Shell one-liner playground: https://shellgei-online-judge.com/
- client: html + js + css ( + nginx)
- server: php + python ( + docker)
- data: problem text files
- scripts: deploy & test
- Ubuntu 24.04 LTS (+WSL2)
- Ubuntu 22.04 LTS
- Amazon Linux 2023
execute the following command:
sudo apt update && sudo apt -y upgrade
# sudo dnf update && sudo dnf upgrade
# install nginx
sudo apt -y install nginx
# install php
# sudo apt -y install php
# install php-fpm
sudo apt -y install php-fpm
execute the following command:
# edit config
sudo vim /etc/nginx/conf.d/default.conf
# or
sudo vim /etc/nginx/sites-available/default
Update as follows:
# example: php8.1-fpm
location ~ \.php$ {
fastcgi_pass unix:/run/php/php8.1-fpm.sock;
fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
# WSL2(Ubuntu 24.04 LTS): fastcgi_param SCRIPT_FILENAME <root_path>$fastcgi_script_name;
# ex: fastcgi_param SCRIPT_FILENAME /var/www/html/$fastcgi_script_name;
include fastcgi_params;
}
execute the following command:
# install docker
sudo apt update && sudo apt -y upgrade
sudo apt install ca-certificates curl gnupg lsb-release
sudo mkdir -p /etc/apt/keyrings
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
sudo apt update
sudo apt install docker-ce docker-ce-cli containerd.io docker-compose-plugin
# setup
sudo gpasswd -a $USER docker
sudo systemctl restart docker
# download image file
docker pull theoldmoon0602/shellgeibot
Change the execution user from nginx to www-data in WSL.
# example: 8.3
sudo vim /etc/php/8.3/fpm/pool.d/www.conf
sudo vim /etc/nginx/nginx.conf
execute the following command:
sudo visudo
Add the following line to the end.
# the username that executes PHP: www-data
# which docker: /usr/bin/docker
www-data ALL=(ALL) NOPASSWD: /usr/bin/docker
execute the following command:
sudo systemctl restart nginx
# sudo systemctl status nginx
# sudo systemctl start nginx
# sudo systemctl stop nginx
usr
:/usr/share/nginx/html/
var
:/var/www/html
execute the following command:
cd scripts
# `usr`
./deploy.bash usr server
# `var`
./deploy.bash var server
# local
./deploy.bash usr local
# or
./deploy.bash var local
execute the following command:
cd scripts
# server
python3 test.py server
# local test
python3 test.py local
cat root_path/shellgei_log.txt | tail -n 20
docker pull theoldmoon0602/shellgeibot
sudo apt update
sudo apt upgrade
sudo dnf update
sudo dnf upgrade
sudo certbot certonly --standalone
sudo systemctl reload nginx
# sudo chmod 400 example.pem
ssh -i "example.pem" [email protected]
- License file
- data: Creative Commons BY-NC-ND 4.0
- client, server, scripts: Apache License 2.0