Skip to main content
OpenEduCat logo
安装指南

How to Install OpenEduCat on CentOS

Step-by-step guide to install OpenEduCat Free Edition on CentOS 7/8 or Rocky Linux with PostgreSQL, Python dependencies, and Nginx reverse proxy.

This guide covers installing OpenEduCat on CentOS 7, CentOS 8, or Rocky Linux 8, which are common choices for enterprise and government-sector deployments due to their stability and long support cycles. CentOS and Rocky Linux require additional configuration steps compared to Ubuntu, including EPEL repository setup, firewall rules, and SELinux policies. This guide addresses all of these platform-specific requirements. The complete installation takes approximately 45-60 minutes and produces a production-ready deployment behind an Nginx reverse proxy with automatic service management via systemd.

前置条件

  • CentOS 7/8 or Rocky Linux 8
  • Minimum 4GB RAM (8GB recommended)
  • 20GB free disk space
  • Root or sudo access
  • Internet connection

安装步骤

步骤 1:Update System Packages

$ sudo yum update -y

注意:Or use dnf on CentOS 8/Rocky Linux.

步骤 2:Install EPEL Repository

$ sudo yum install epel-release -y

步骤 3:Install PostgreSQL

$ sudo yum install postgresql-server postgresql-contrib -y
$ sudo postgresql-setup initdb
$ sudo systemctl start postgresql
$ sudo systemctl enable postgresql

步骤 4:Create Database User

$ sudo -u postgres createuser -s openeducat
$ sudo -u postgres psql -c "ALTER USER openeducat WITH PASSWORD 'your_password';"

注意:Replace your_password with a secure password.

步骤 5:Install Python Dependencies

$ sudo yum install python3 python3-pip python3-devel -y
$ sudo yum install libxml2-devel libxslt-devel openldap-devel -y

步骤 6:Install wkhtmltopdf

$ sudo yum install wkhtmltopdf -y

注意:Required for PDF report generation.

步骤 7:Download OpenEduCat

$ cd /opt
$ sudo git clone https://github.com/openeducat/openeducat_erp.git openeducat

步骤 8:Install Python Packages

$ cd /opt/openeducat
$ pip3 install -r requirements.txt

步骤 9:Configure Firewall

$ sudo firewall-cmd --permanent --add-port=8069/tcp
$ sudo firewall-cmd --reload

步骤 10:Configure SELinux for OpenEduCat

$ sudo setsebool -P httpd_can_network_connect on
$ sudo semanage port -a -t http_port_t -p tcp 8069

注意:If SELinux is enforcing, these commands allow Nginx to proxy to the OpenEduCat application port. Skip this step if SELinux is disabled or set to permissive mode.

步骤 11:Create a Systemd Service

$ sudo nano /etc/systemd/system/openeducat.service

注意:Add a systemd unit file so OpenEduCat starts automatically on boot and can be managed with systemctl start, stop, and restart commands. Set the User to the openeducat system account, the WorkingDirectory to /opt/openeducat, and the ExecStart to python3 openeducat-bin with your configuration file.

步骤 12:Enable and Start the Service

$ sudo systemctl daemon-reload
$ sudo systemctl enable openeducat
$ sudo systemctl start openeducat

注意:The enable command ensures OpenEduCat starts automatically after a server reboot. Check status with sudo systemctl status openeducat.

步骤 13:Install and Configure Nginx as Reverse Proxy

$ sudo yum install nginx -y
$ sudo systemctl enable nginx
$ sudo systemctl start nginx

注意:Configure an Nginx server block to proxy requests from port 80 or 443 to localhost:8069. This provides HTTPS termination, static file caching, and connection handling. Use proxy_pass http://127.0.0.1:8069 in your location block and set appropriate proxy headers for X-Forwarded-For and X-Forwarded-Proto.

步骤 14:Verify the Installation

$ curl -I http://localhost:8069
$ sudo systemctl status openeducat
$ sudo systemctl status nginx

注意:Confirm that OpenEduCat responds on port 8069 and that both the application and Nginx services are running. Open your browser and navigate to http://your-server-ip to access the OpenEduCat web interface through the Nginx reverse proxy. The default administrator credentials are admin/admin. Change the password immediately after your first login.

准备好变革您的教育机构了吗?

了解 OpenEduCat 如何释放时间,让每位学生都能获得应有的关注。

免费试用 15 天,无需信用卡。