How to manually deploy AnQiCMS on a Linux server?

Calendar 👁️ 66

As an experienced website operations manager, I am well aware of the importance of a stable and efficient content management system for the development of a company.AnQiCMS with its excellent performance in Go language and many enterprise-level features has become an ideal choice for many small and medium-sized enterprises and content operation teams.Deploy AnQiCMS on a Linux server to fully utilize its high performance and security advantages.Below, I will elaborate on the steps and key points of manually deploying AnQiCMS on a Linux server, aiming to help you successfully set up and run your content platform.

Manual deployment of AnQiCMS on Linux server

Deploy AnQiCMS on a Linux server requires a series of detailed steps to ensure stable operation and maximize its performance.We will explain step by step from environmental preparation, file processing, core service configuration, to the final reverse proxy setup.

Preparation: Deployment Environment and Necessary Components

Before starting to deploy AnQiCMS, your Linux server needs to be configured with some basic environments and software components.Firstly, your server should be based on a Linux distribution with X86 architecture, such as Ubuntu, CentOS, Debian, etc.At the same time, ensure that you have SSH access privileges to operate the server via the command line, and be prepared with an FTP or SCP tool for file transfer.

The database is the core of any content management system, AnQiCMS requires the backend database to be MySQL 5.6.35 or higher version.Please make sure to install and configure the MySQL service in advance, and prepare a MySQL user with database creation and management permissions (usually the root user or a user specifically created for AnQiCMS).

In order to expose the AnQiCMS service to internet users, you also need a web server as a reverse proxy.Nginx and Apache are excellent choices, they can forward requests coming from port 80 (HTTP) or port 443 (HTTPS) to the internal ports where AnQiCMS is running.Ensure that one of the web servers is installed and running.

Obtain AnQiCMS Installation Package

The first step in deployment is to download the latest Linux installation package from the AnQiCMS official website. Please visit the official download page.https://en.anqicms.com/downloadSelect the distribution package suitable for the Linux system (usuallyanqicms-linux-vX.X.X.zipor.tar.gzformat). Download this package to your local computer.

File upload and extraction

After the download is complete, you need to upload the AnQiCMS installation package to the Linux server. It is recommended that you/www/wwwroot/Create a dedicated directory for your AnQiCMS site under the directory/www/wwwroot/yourdomain.com. Upload the installation package to this newly created directory using SCP tools or an FTP client.

After the file upload is complete, log in to your server via SSH, enter the directory, and use the appropriate command to unzip the installation package. If the.zipfile can be usedunzip anqicms-linux-vX.X.X.zipcommand; if it is.tar.gzfile, then usetar -xzvf anqicms-linux-vX.X.X.tar.gzcommand. After unpacking, you will see the core files of AnQiCMS, includinganqicmsexecutable files and related scripts and template files.

Database configuration and initialization

The initialization process of AnQiCMS will automatically guide you when you visit the browser for the first time.When you complete the subsequent web server configuration and first open the AnQiCMS site, the system will prompt you to enter the database connection information.Here, you need to fill in the previously prepared MySQL database host (usually127.0.0.1)、Port(default as)3306) database name, and the MySQL username and password with corresponding permissions.In addition, you will also set up the admin account and password for the website backend, as well as the website access address.Ensure that all information is accurate and correct, as incorrect database credentials or insufficient permissions may cause the installation to fail.

AnQiCMS process guardian

To ensure that the AnQiCMS service can run continuously and stably, even if the server restarts or the program exits unexpectedly, we need to set up a process guard mechanism. The AnQiCMS installation package providesstart.shandstop.shScript to start and stop the service.

First, you need to add the executable file path of AnQiCMS to your.start.shscript. Assuming AnQiCMS has been extracted to/www/wwwroot/anqicms.com/The directory and the executable file name isanqicmsthenstart.shThe script should be configured as follows:

#!/bin/bash
### check and start AnqiCMS
# author fesion
# the bin name is anqicms
BINNAME=anqicms
BINPATH=/www/wwwroot/anqicms.com  # 请替换为您的AnQiCMS实际安装路径

# check the pid if exists
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"
if [ $exists -eq 0 ]; then
    echo "$BINNAME NOT running"
    cd $BINPATH && nohup $BINPATH/$BINNAME >> $BINPATH/running.log 2>&1 &
fi

Next, use Linux'scrontabtools to execute periodicallystart.shScript to achieve process guardianship. Open the crontab editor:

crontab -e

In the open editor interface, add the following line to check every minute and start AnQiCMS (if it is not running):

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

save and exitcrontabEditor. After adding a scheduled task, to start the AnQiCMS service immediately, you can manually execute it once.start.shScript:

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

Configure Web Server Reverse Proxy

AnQiCMS runs on the default internal port (usually8001To allow external users to access your website through a domain name, you need to configure a web server (Nginx or Apache) as a reverse proxy to forward external requests to the internal port of AnQiCMS.At the same time, the web server'srootThe directory points to the installation directory of AnQiCMSpublicfolder to provide static resources.

Nginx configuration example:

Create a new site configuration file in the Nginx configuration directory (for example/etc/nginx/conf.d/yourdomain.com.conf),and add the following content:

server {
    listen 80;
    server_name www.yourdomain.com; # 替换为您的域名
    root /www/wwwroot/anqicms.com/public; # 替换为您的AnQiCMS public目录

    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;
    }
    error_page 404 =200 @AnqiCMS; # 确保所有请求都经过AnQiCMS处理
    location / {
       try_files $uri $uri/index.html @AnqiCMS;
    }
    access_log /var/log/nginx/yourdomain.com.access.log; # 访问日志路径
    error_log /var/log/nginx/yourdomain.com.error.log;   # 错误日志路径
}

After the configuration is complete, please check the syntax of the Nginx configuration file:nginx -t. If there are no errors, then reload the Nginx service to make the configuration take effect:systemctl reload nginxorservice nginx reload.

Apache configuration example:

If you choose to use Apache as a web server, make sure it is enabledmod_proxyandmod_proxy_httpModule. Then add the reverse proxy rule in your virtual host configuration file. First, add the virtual host'sDocumentRootpointing to AnQiCMSpublicDirectory.

`apache

ServerName www.yourdomain.com # 替换为您的域名
DocumentRoot /www/wwwroot/anqicms.com/public # 替换为您的AnQiCMS public目录

<Directory /www/wwwroot/anqicms.com/public>
    Options Indexes FollowSymLinks
    AllowOverride All
    Require all granted
</Directory>

ProxyRequests Off
ProxyPreserveHost On
ProxyPass / https://en.anqicms.com/

Related articles

Which operating systems does AnQiCMS support for installation?

AnQiCMS is an enterprise-level content management system developed based on the Go language, dedicated to providing efficient, customizable, and easily scalable content management solutions for small and medium-sized enterprises, self-media operators, and those who need to manage multiple sites.Its lightweight architecture and excellent performance make AnQiCMS highly compatible in deployment and operation.As an experienced website operator, I am well aware of the importance of choosing a system with strong compatibility to ensure the stable operation of the website.Next, we will discuss AnQiCMS in detail

2025-11-06

What is the difference between the `safe` and `escape` template filters in AnQiCMS and when should they be used?

As an experienced website operator for AnQiCMS, I am well aware that the correct use of templates is crucial for the safety and display effect of the website during content creation and publishing.AnQiCMS's powerful template engine provides rich features, among which the `safe` and `escape` filters play a key role in handling HTML special characters during content output.Understanding the differences and proper application is the foundation for ensuring website content security and enhancing user experience.###

2025-11-06

How to implement pagination display of document list in AnQiCMS template using `pagination` tag?

As a senior Anqi CMS website operator, we fully understand that it is crucial to efficiently display a large amount of content in a content management system and ensure a user-friendly browsing experience.For a document list, pagination is the core function to achieve this goal.In the AnQiCMS template system, the `pagination` tag plays a key role in connecting the document list with page navigation, allowing a large number of documents to be presented to the user in a structured manner while maintaining flexibility and customizability.

2025-11-06

How to get the contact information configured in the `contact` tag of AnQiCMS template?

As an experienced website operator for Anqi CMS, I am well aware of the core position of content in website construction and user interaction.Effectively and conveniently displaying contact information is an indispensable part of a website's functionality, directly affecting the efficiency and willingness of users to communicate with the company.In AnQiCMS, we provide a simple and powerful template tag——`contact`, allowing you to easily display the contact information configured in the background on the website front-end.--- ###

2025-11-06

How to quickly install AnQiCMS on Baota panel?

Hello!As an expert in AnQiCMS operation, I fully understand your need for a quick and efficient website construction.AnQiCMS with its excellent performance brought by the Go language and enterprise-level features is becoming a new choice for more and more operators.BtPanel is a widely popular server management tool that greatly simplifies the deployment process of AnQiCMS.

2025-11-06

What are the specific steps for deploying AnQiCMS on Baota panel?

As an experienced website operator proficient in AnQiCMS, I fully understand the importance of an efficient and stable content management system for enterprises and content creators.AnQiCMS with its powerful performance in Go language, flexible content model, and excellent SEO-friendliness, has won the favor of many users.In daily operations, the ease of deployment is also very important, especially for users accustomed to using Baota panel to manage servers.

2025-11-06

What are the configuration points for installing AnQiCMS using the BaotaGo project features?

As a long-term深耕 content operator with a deep understanding of AnQiCMS (AnQiCMS), I am well aware of the importance of a stable and efficient content management system for website operation.AnQiCMS with its high performance, security, and ease of scalability based on the Go language, has become our powerful assistant for managing content, optimizing SEO, and expanding multi-site business.When it comes to installing AnQiCMS using the Go project feature on the Baota panel, there are several key configuration points that we need to pay special attention to in order to ensure that the system can be smoothly deployed and run efficiently. First

2025-11-06

How to deploy AnQiCMS on the old Baota panel (non-Go project)?

AnQiCMS is an enterprise-level content management system developed based on the Go language, known for its high efficiency, security, and customizable features, making it an ideal choice for many small and medium-sized enterprises and content operation teams.As a long-term website operator dealing with AnQiCMS, I am well aware of the importance of the convenience of system deployment to operational efficiency.

2025-11-06