How to deploy AnQiCMS on a Linux server without a graphical panel in a command-line environment?

Calendar 👁️ 64

In the wave of digitalization, an efficient and stable content management system (CMS) is an indispensable foundation for both enterprises and individuals to operate websites.AnQiCMS (AnQiCMS) is an enterprise-level CMS developed based on the Go language, with excellent performance, security, and flexible scalability, winning a good reputation in the industry.It is particularly suitable for users who pursue lightweight, efficient, and customizable solutions, whether they are small and medium-sized enterprises, self-media, or multi-site administrators.

Many senior system administrators and developers tend to deploy applications on Linux servers without a graphical interface, which not only maximizes the use of server resources but also provides higher security and more flexible control.This article will focus on this requirement, elaborating on how to efficiently and stably deploy AnQiCMS in a command-line environment, so that your website runs smoothly on the solid foundation of Linux.


Deploy AnQiCMS efficiently in a pure command-line environment

Deploying AnQiCMS on a Linux server without a visual panel means that you will connect to the server via SSH and operate throughout using the command line.This approach may seem daunting at first glance, but once mastered, you will have a deeper understanding and control over servers and applications, which is the essence of efficient operation and maintenance.

Before starting the deployment of AnQiCMS, you need to ensure that the server environment is ready.This usually includes a server running a Linux distribution (such as Ubuntu, CentOS, etc.), which is already configured with a web server (Nginx or Apache) for reverse proxy, as well as a database service (MySQL is recommended), all of which are the foundation for backend application operation and data storage.Assume you already have these basic environments.

First step: Download and unzip the AnQiCMS installation package

The first step in deploying AnQiCMS is to download the installation package to your Linux server.You can download the latest Linux version installation package from the AnQiCMS official website.This is usually a compressed file, such asanqicms-linux-v3.x.x.zip.

BywgetorcurlThe command can directly download the package to the server:

wget https://en.anqicms.com/download/anqicms-linux-v3.x.x.zip

After the download is complete, we need to create a dedicated directory to store the AnQiCMS program. For example, we choose to place it in/www/wwwroot/Create a directory named after your domain, which helps in multi-site management and permission isolation:

mkdir -p /www/wwwroot/yourdomain.com
cd /www/wwwroot/yourdomain.com

Next, move the downloaded installation package to this newly created directory and extract it. If the command is not available on the serverunzipyou may need to install it first (such assudo apt install unziporsudo yum install unzip)

mv /path/to/anqicms-linux-v3.x.x.zip .
unzip anqicms-linux-v3.x.x.zip

After unzipping, you will see a file namedanqicmsan executable file and other necessary files and directories such aspublic(static resources),template(template files) and so on.

Step 2: Configure the automatic startup and monitoring of AnQiCMS service

AnQiCMS is a Go language application, compiled into a standalone binary file. To ensure that the service can run continuously, even if the server restarts, and can automatically start and recover if the program stops unexpectedly, we need to usecrontabSet a guardian task.

First, edit the crontab configuration:

crontab -e

This will open a text editor where you can add scheduled tasks. Add the following two lines at the end of the file:

*/1 * * * * /www/wwwroot/yourdomain.com/start.sh
@reboot /www/wwwroot/yourdomain.com/start.sh

The first line indicates that the AnQiCMS running status is checked every minute. If it is not running, it will start it, serving as a guardian process.The second line ensures that AnQiCMS can start immediately after the server restart.

Herestart.shIs the startup script bundled with the AnQiCMS installation package, it will checkanqicmsWhether the process exists, if it does not exist, it will be started in the background (nohup). Please make sure to confirm.start.shin the scriptBINPATHandBINNAMEThe variable points to the correct path and executable file name. If your AnQiCMS executable file is notanqicms, please editstart.shto make the modification.

After addingcrontabAfter the task, you need to manually execute oncestart.shScript to immediately start the AnQiCMS service:

cd /www/wwwroot/yourdomain.com
./start.sh

At this time, the AnQiCMS service is already running in the background, defaulting to listen on8001on the port.

Step 3: Configure the reverse proxy of the web server

Due to AnQiCMS defaulting to listen on a non-standard port (8001), we need a web server (Nginx or Apache) as a frontend to receive users' HTTP/HTTPS requests and then forward them to the AnQiCMS service.This is called reverse proxy, it not only allows websites to access through standard ports (80 or 443), but also provides advanced features such as SSL certificates, load balancing, caching, etc.

For example, using Nginx, you need to edit or create a configuration file for the Nginx site. This file is usually located/etc/nginx/conf.d/or/etc/nginx/sites-available/In the directory. For example, create a file namedyourdomain.com.conffile:

sudo vim /etc/nginx/conf.d/yourdomain.com.conf

Add the following Nginx configuration in the file:

server {
    listen 80;
    server_name yourdomain.com www.yourdomain.com; # 替换为您的实际域名

    # 网站根目录指向AnQiCMS的public目录
    root /www/wwwroot/yourdomain.com/public;

    # AnQiCMS的反向代理配置
    location @AnqiCMS {
        proxy_pass https://en.anqicms.com; # AnQiCMS监听的端口
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;
    }

    # 优先尝试匹配文件,如果找不到,则交由AnqiCMS处理
    location / {
       try_files $uri $uri/index.html @AnqiCMS;
    }

    # 可选:配置SSL证书
    # listen 443 ssl;
    # ssl_certificate /etc/nginx/ssl/yourdomain.com.pem;
    # ssl_certificate_key /etc/nginx/ssl/yourdomain.com.key;

    access_log /var/log/nginx/yourdomain.com_access.log;
    error_log /var/log/nginx/yourdomain.com_error.log;
}

Configuration points to note:

  • listen 80;andserver_name yourdomain.com www.yourdomain.com;: Defines the listening port and your website domain.
  • root /www/wwwroot/yourdomain.com/public;:Very importantSet Nginx's document root directory to the AnQiCMS program directory underpublicfolder, which is the place to store static resources.
  • location @AnqiCMS { ... }: Defined an internal forwarding rule to proxy requests locally8001Port running AnQiCMS service.
  • try_files $uri $uri/index.html @AnqiCMS;: This is the core pseudo-static rule. It first tries to find inpublicLook for the requested URI (such as static files) in the directory, if not found, try to look for itindex.htmlIf it is still not found, then forward the request to@AnqiCMSHandle. This can make use of Nginx to efficiently process static files and hand over dynamic requests to AnQiCMS.
  • error_page 404 =200 @AnqiCMS;Ensure that 404 errors can also be handled by AnQiCMS while maintaining URL consistency.

Save and close the configuration file after, you need to check the syntax of the Nginx configuration file and reload the Nginx service to make the configuration take effect: “`bash

Related articles

What are the precautions to be taken when configuring Nginx pseudo-static for AnQiCMS multi-site on the Baota panel?

As an experienced website operations expert, I am well aware of the importance of Nginx pseudo-static configuration for improving user experience and search engine optimization (SEO), especially in a powerful, multi-site management system like AnQiCMS.Static URL rewriting not only makes the URL look more concise and readable, but also makes it more friendly for search engine spiders to crawl and index the content, thus bringing better rankings.

2025-11-06

How to set the root directory and database name of a new site when adding AnQiCMS multi-site via Baota panel to avoid conflicts?

As an experienced website operations expert, I know that how to deploy multiple websites efficiently and without conflict is the key to success.AnQiCMS (AnQiCMS) provides us with great convenience with its excellent multi-site management capabilities.Today, let's delve into how to cleverly set the root directory and database name of a new site when deploying AnQiCMS multi-site with Baota panel, in order to avoid annoying conflicts and ensure that each site can run independently and stably.The strength of AnQi CMS lies in its ability to utilize a simple and efficient system architecture

2025-11-06

How to install and manage multiple AnQiCMS sites on the same Linux server?

HelloAs an experienced website operations expert, I fully understand the importance of efficiently and conveniently utilizing existing resources when managing multiple websites.AnQiCMS with its powerful multi-site management capabilities is born for such needs.It can not only help us reduce operating costs, but also significantly improve management efficiency. Next, I will focus on how to install and manage multiple AnQiCMS sites on the same Linux server?

2025-11-06

What are the common reasons for initialization installation failure of AnQiCMS, and how to troubleshoot?

AnQiCMS (AnQiCMS) benefits from the efficient and customizable features brought by Go language, and is favored by a large number of webmasters and corporate users.However, even the most excellent system is bound to encounter some minor hiccups during the initial installation.As an experienced website operation expert, I am well aware of the importance of a smooth installation experience for users.Today, let's deeply analyze the common reasons for the initialization installation failure of AnQiCMS, and provide you with a set of effective troubleshooting methods to help you easily master AnQiCMS.

2025-11-06

How to configure Nginx reverse proxy after installing AnQiCMS via command line to access through port 80?

AnQiCMS is an enterprise-level content management system developed based on the Go language, which is favored by an increasing number of small and medium-sized enterprises and content operation teams due to its high efficiency, security, and ease of deployment.Under Linux, after installing AnQiCMS via the command line, we usually find that it runs on a specific port like `8001` by default.

2025-11-06

How to compile and install the Go language source code of AnQiCMS, what are the required environment dependencies?

As an experienced website operation expert, I am willing to give you a detailed explanation of the steps for compiling and installing the AnQiCMS (AnQiCMS) Go language source code and the required environment dependencies.AnQi CMS, with its excellent genes in Go language, provides high-performance and high-concurrency content management capabilities. For advanced users who want to deeply customize or deploy in specific environments, source code compilation is undoubtedly an ideal choice.

2025-11-06

How to test and run AnQiCMS on Windows system for local development and debugging?

As an experienced website operations expert, I fully understand the importance of setting up a development environment locally.It not only allows you to safely test new features and adjust page layouts, but also accelerates content creation and feature iteration without affecting the online website.Today, let's delve deeply into how to easily set up and test run AnQiCMS on a Windows system, and embark on your local development and debugging journey.

2025-11-06

How to correctly stop or close the AnQiCMS application under Windows?

As an experienced website operations expert, I fully understand that in managing a content system, it is not only important to be proficient in using various functions, but also to maintain and manage the application on a daily basis.AnQiCMS (AnQi CMS) brings us a convenient user experience with its efficient and lightweight features based on the Go language in the Windows environment.However, whether for the need of maintenance, upgrade, or temporary debugging, we need to know how to properly and safely stop or close the AnQiCMS application.

2025-11-06