How to set up AnQiCMS program on a Linux server to enable boot-up and process protection?

Calendar 👁️ 52

As a website operator who deeply understands the operation of AnQiCMS, I know the importance of a stable and reliable online environment for a content management system.Ensure that the AnQiCMS program can automatically run with the server startup and can recover itself after an unexpected interruption, which is the cornerstone of ensuring the website remains online and provides high-quality content services.The following will explain in detail how to set up the boot self-start and process guard of the AnQiCMS program on a Linux server.

Deploy and monitor the AnQiCMS program on a Linux server

AnQiCMS is a corporate-level content management system developed based on the Go language, known for its efficiency, security, and ease of use.But in a production environment, simply deploying the program is not enough, we also need a set of mechanisms to ensure its continuous operation.This includes automatic startup after server restart and timely recovery in case of program crashes, achieving boot-up self-start and process guardianship.

Prepare the environment

Before starting the configuration, make sure that your Linux server meets the following conditions:

  • The MySQL database service has been installed, AnQiCMS needs it to store website data.
  • Nginx or Apache web server has been installed, used to handle user HTTP/HTTPS requests and reverse proxy to AnQiCMS.
  • You have connected to the server via SSH client and have sufficient privileges to perform installation and configuration operations.
  • You have downloaded the latest program installation package for Linux from the AnQiCMS official website.

Deployment and auto-start configuration of AnQiCMS program

First, upload the AnQiCMS Linux installation package you downloaded to the server. Typically, we would choose a standard path to store it, such as/www/wwwroot/your_domain.com/(Please move theyour_domain.comReplace your actual domain name). After uploading, useunzipCommand to unzip the installation package.

AnQiCMS programs usually exist in the form of an executable file, for example, namedanqicms. To achieve boot-up automatic startup and basic process guardianship, we can use tools配合 a simple script.crontab. You need to create a named

. namedstart.shThe script file, its content is as follows. This script checks if the AnQiCMS process is running, and if not, it starts AnQiCMS and redirects its output to a log file.

#!/bin/bash
### check and start AnqiCMS
# author AnQiCMS Operator
# the bin name is anqicms
BINNAME=anqicms # 您的AnQiCMS可执行文件名,默认为anqicms
BINPATH=/www/wwwroot/your_domain.com # 您的AnQiCMS程序所在目录,请替换为实际路径

# 检查AnQiCMS进程是否存在
exists=`ps -ef | grep '\<anqicms\>' |grep -v grep |wc -l`
echo "$(date +'%Y%m%d %H:%M:%S') $BINNAME PID check: $exists" >> $BINPATH/check.log
echo "PID $BINNAME check: $exists"

# 如果进程不存在,则启动AnQiCMS
if [ $exists -eq 0 ]; then
    echo "$BINNAME NOT running, attempting to start..."
    # 进入程序目录,以后台方式运行AnQiCMS,并将标准输出和错误输出重定向到running.log
    cd $BINPATH && nohup $BINPATH/$BINNAME >> $BINPATH/running.log 2>&1 &
    echo "$(date +'%Y%m%d %H:%M:%S') $BINNAME started." >> $BINPATH/check.log
else
    echo "$BINNAME is already running." >> $BINPATH/check.log
fi

Be sure to setBINNAMEandBINPATHVariable is modified to the actual path of the AnQiCMS executable file and the directory it is in. Save this script asstart.shto the AnQiCMS program directory and give it execution permissions:chmod +x /www/wwwroot/your_domain.com/start.sh.

We will configure nextcrontabTo achieve self-startup and process guardianship.crontabAllow you to set periodic tasks. By lettingcrontabexecute once a minutestart.shScript, you can ensure that AnQiCMS starts on the server (becausecrontabThe service will start automatically and will run automatically, and even if the program stops unexpectedly for some reason, it will be restarted within the next minutecrontaband restarted.

Execute the following command to editcrontabTask List:

crontab -e

Add the following line in the open text editor:

*/1 * * * * /www/wwwroot/your_domain.com/start.sh

Please replace the path with yourstart.shactual script storage path. Save and exit the editor. This configuration will enablestart.shThe script runs every minute. To start AnQiCMS immediately, you can run it manually once.sh /www/wwwroot/your_domain.com/start.sh.

Configure Web Server Reverse Proxy

AnQiCMS program listens by default.8001Port. In order for users to access your website via standard HTTP (port 80) or HTTPS (port 443), you need to configure Nginx or Apache as a reverse proxy.

For example, with Nginx, you can in its site configuration file

Related articles

What is the detailed configuration example of Nginx reverse proxy when deploying AnQiCMS under the Linux command line environment?

When deploying AnQiCMS in the Linux command-line environment, configuring Nginx as a reverse proxy is a key step in website operation.AnQiCMS as a high-performance, easily scalable Go language content management system usually runs on a non-standard port on the server.

2025-11-06

What is the recommended solution for migrating multi-site data when upgrading from version 2.x to 3.x of AnQiCMS?

Colleagues, as a long-term front-line website operator in AnQiCMS, I am well aware of the importance of the stability and efficiency of the content management system for business development.Recently, many operation partners have been consulting on the recommended scheme for migrating data from AnQiCMS version 2.x to 3.x, especially regarding multi-site data migration.Today, I will combine our practical experience with the latest documentation of AnQiCMS to provide a detailed explanation of this process, ensuring a smooth transition for your multi-site.

2025-11-06

After AnQiCMS backend version upgrade, the front-end page has not been updated. How to force clear the cache or solve the problem?

As an experienced website operator, I know the frustration and confusion you feel when you have diligently completed the AnQiCMS backend version upgrade only to find that the front-end page is still 'as still as a statue'.This is usually not a system failure, but rather due to the multi-layered caching mechanism 'faithfully' preserving the old version of the page content in the background.To solve this problem, we need to delve into it like a detective, layer by layer, investigate and clear away these caches one by one.

2025-11-06

How to troubleshoot and solve the common problem of insufficient database account permissions during the installation of AnQiCMS?

As a professional who deeply understands the operation of AnQiCMS, I know that the installation process is the first step for every new user to contact the system and start their journey of efficient content management.However, at this critical point, insufficient database account permissions often become a stumbling block for some users.This kind of problem is common, but as long as you master the correct troubleshooting思路 and solution, you can easily solve it.This article will discuss in detail the manifestations, troubleshooting methods, and specific solutions to the insufficient database account permission problems during the AnQiCMS installation process, aiming to help you complete the installation smoothly

2025-11-06

How to configure multiple sites and pseudo-static rules when testing AnQiCMS locally in a Windows environment?

As an experienced CMS website operation personnel, I am well aware of the importance of setting up and testing websites locally, which not only helps us iterate content quickly and optimize user experience, but also discover and solve potential problems before release.Especially for users who need to manage multiple sites or pursue the ultimate SEO effect, configuring multi-site and pseudo-static rules is an indispensable part of local testing.

2025-11-06

What are the prerequisites and specific steps for installing and testing AnQiCMS on MacOS?

As a website operator deeply familiar with the operation of Anqi CMS, I am well aware of the power of content and how to efficiently deploy and manage a website.AnQiCMS is a modern content management system developed based on the Go programming language, with its efficient, secure, and scalable features, it brings great convenience to content operation.Today, I will elaborate in detail on the prerequisite environment and specific steps required to install and test AnQiCMS on macOS system.###

2025-11-06

How to enable Markdown editor in AnQiCMS and display mathematical formulas and flowcharts correctly?

HelloAs a website operator who is well-versed in the operation of AnQiCMS, I fully understand the importance of displaying complex information such as mathematical formulas and flowcharts in content creation.High-quality, interactive content is the key to attracting and retaining users.I will explain to you in detail how to enable Markdown editor in AnQiCMS and ensure that mathematical formulas and flowcharts can be displayed correctly.

2025-11-06

What types of pseudo-static rules are built into the AnQiCMS system, and how to customize the URL structure?

As a senior CMS website operation personnel of a security company, I know that a friendly and efficient URL structure is crucial for the SEO performance and user experience of a website.AnQi CMS provides high flexibility in the configuration of pseudo-static rules, whether it is for beginners or advanced optimizers, they can find suitable solutions.

2025-11-06