A small website is used for the management of ACM training problem library, competitions, teams, completed problems with solution.
- Install support libraries needed for this project (Tornado 4.5.3+, pymsql 0.9.2+, python 3.7+, mysql 8.0.16+)
- Import the sql data into mysql, modify the mysql connection parameters in config.py, and run server.py.
Taking Ubuntu 18.04 for example.
python3
sudo apt update
sudo apt -y upgrade
sudo apt install -y python3-pip
pip3 install package_name
pymysql
python3 -m pip install PyMySQL
tornado
sudo apt-get install python3-tornado
mysql
Installation of mysql 8.0+.
sudo wget https://dev.mysql.com/get/mysql-apt-config_0.8.14-1_all.deb
sudo dpkg -i mysql-apt-config_0.8.14-1_all.deb
sudo apt-get update
sudo apt-get install mysql-server
mysql_secure_installation
mysql -u root -p # login to MySQL Database
Create a MySQL remote user.
mysql -u root -p
CREATE USER 'root'@'%' IDENTIFIED BY 'password';
GRANT ALL PRIVILEGES ON *.* TO 'root'@'%';
FLUSH PRIVILEGES;
Enable MySQL remote access.
sudo vim /etc/mysql/mysql.conf.d/mysqld.cnf
# change the "bind-address = 127.0.0.1" into "bind-address = 0.0.0.0"
sudo systemctl restart mysql.service
Run
Install Screen and run the project in it.
sudo apt-get install screen
screen
python3 server.py
cron
crontab -l # check all tasks
crontab -e # add new task
/etc/init.d/cron stop
/etc/init.d/cron start
/etc/init.d/cron restart
/etc/init.d/cron status
we need to use crontab -e
to add the task below to back up mysql every two hours.
54 */2 * * * /root/mysql_backup_script.sh
.sh file
This file contains the config and the input of command line, we could use it to back up the mysql.
/etc/mysql/mysql.conf.d
And we add the specific configs in the "/etc/mysql/mysql.conf.d".
[mysqldump]
user=root
password=passwd
Web Portal
Main Page
Problem Library
Contest
User
More Details
If you want to know more information, you could consult for the "ACM-PLATFORM Report.pdf" in this project.