Quick start
Install HUSTOJ on the Ubuntu16.04 host
Project address: Zhblue/HustoJ Official website: Hustoj
The host that
The user name | password |
---|---|
ubuntu | ubuntu |
root | root |
judge | judge |
The network configuration
ifconfig
cat /etc/network/interfaces
Copy the code
ubuntu@ubuntu:~$ cat /etc/network/interfaces
# interfaces(5) file used by ifup(8) and ifdown(8)
source /etc/network/interfaces.d/*
# The loopback network interface
auto lo
iface lo inet loopback
auto ens33
iface ens33 inet dhcp
ubuntu@ubuntu:~$ ifconfig
ens33 Link encap:Ethernet HWaddr 00:0c:29:be:bc:ac
inet addr:192.168.0.100 Bcast:192.168.0.255 Mask:255.255.255.0
inet6 addr: fe80::20c:29ff:febe:bcac/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:82 errors:0 dropped:0 overruns:0 frame:0
TX packets:117 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:13775 (13.7 KB) TX bytes:21060 (21.0 KB)
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:65536 Metric:1
RX packets:737 errors:0 dropped:0 overruns:0 frame:0
TX packets:737 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:62712 (62.7 KB) TX bytes:62712 (62.7 KB)
Copy the code
Based on Ubuntu16.04 installation
Install ubuntu16.04 first (php7 speed is recommended), then use the following script to quickly install OJ:
wget https://raw.githubusercontent.com/zhblue/hustoj/master/trunk/install/install-ubuntu16+.sh
sudo bash install-ubuntu16+.sh
Copy the code
Installation Video Tutorial
Interactive setting Database root account password: 123456
— Error handling
Error may be reported but will not affect the use
ln -s /usr/bin/mcs /usr/bin/gmcs
ln -sf /usr/bin/mcs /usr/bin/gmcs
Copy the code
Deployment is complete
If you register a user with the user name admin, the user automatically becomes an administrator.
IP address, admin password 123456
Import the subject
Test the running status of the question
Configuration management
Most functions and options are enabled and parameters are adjusted in the configuration file. After the installation, several important configuration files are located as follows:
/home/judge/etc/judge.conf Judged/judge_client # convicted
/home/judge/src/web/include/db_info.inc.php # Web/etc/php7.0/ FPM /php.ini /etc/php.iniin Centos7) # phpThe/etc/nginx/sites - enabled/default or/etc/nginx/nginx. Conf (in Centos7) # nginx
Copy the code
/etc/nginx/nginx.conf /etc/nginx/nginx.conf /etc/nginx/nginx.conf
worker_processes 8; The number 8 can be an integer multiple of the number of CPU cores.
events {
worker_connections 2048;
multi_accept on;
}
Copy the code
2. If there are too many people to download the XLS file, please modify /etc/nginx/site-enabled /default and add the following line after the fastcgi_pass line:
fastcgi_buffer_size 128k;
fastcgi_buffers 32 32k;
Copy the code
After saving, restart nginx
sudo service nginx restart
Copy the code
Reference: husto is based on the ubuntu1604 installation
3. Configure the access port
sudo vim /etc/nginx/sites-enabled/default
Copy the code
Then restart nginx
sudo service nginx restart
Copy the code
update
sudo bash /home/judge/src/install/update-hustoj
Copy the code
During the upgrade, the option of genuine needs to be configured. In this case, tc is selected
The PSH configuration database file also changes and needs to be modified
sudo vim /home/judge/src/web/include/db_info.inc.php
Copy the code
Restart the nginx
sudo service nginx restart
Copy the code
After the upgrade script is executed, you may need to log in to the web management background and update the database on the web page.
To learn more
Go to the GItHub project ZhBlue/Hustoj and the official Demo to learn more.