Manual deployment of AnQi CMS on the server

Calendar 👁️ 0

Applicable scenarios: Linux server without panel (such as CentOS / Ubuntu), suitable for users familiar with command line operations. Deployment is completed by downloading the installation package, configuring Nginx reverse proxy, and MySQL database.


Preparation

  1. A Linux server (CentOS 7+ or Ubuntu 20.04+)
  2. Nginx and MySQL 5.6.35+ installed (recommended to use)LNMP one-click installation package)
  3. A domain name has been resolved to the server
  4. AnQiCMS Linux installation package has been downloaded

Installation steps

Step 1: Download and extract

# 登录服务器
ssh root@your-server-ip

# 下载安装包(以 v3.6.2 为例)
wget https://github.com/fesiong/anqicms/releases/download/v3.6.2/anqicms-linux-v3.6.2.zip

# 创建站点目录
mkdir -p /data/wwwroot/anqicms

# 解压安装包
unzip anqicms-linux-v3.6.2.zip -d /data/wwwroot/anqicms

# 进入站点目录
cd /data/wwwroot/anqicms

# 查看文件列表
ls -la

Directory structure after extraction:

/data/wwwroot/anqicms/
├── anqicms           # 主程序(可执行文件)
├── start.sh          # 启动脚本
├── stop.sh           # 停止脚本
├── config.json       # 配置文件
├── public/           # Web 根目录
├── template/         # 模板目录
└── system/           # 后台管理界面

Step 2: Start AnQiCMS

# 启动前确保 config.json 中的端口配置正确(默认 8001)
cat config.json
# {"server":{"site_name":"","env":"production","port":8001,"log_level":"release"}}

# 执行启动脚本
./start.sh

# 检查是否启动成功
ps -ef | grep anqicms
# 如果看到 anqicms 进程,说明启动成功

Step 3: Configure Nginx reverse proxy

Create or edit the Nginx site configuration file:

vim /etc/nginx/conf.d/anqicms.conf

Write the following configuration:

server
{
    listen       80;
    server_name www.anqicms.com m.anqicms.com;
    root /data/wwwroot/anqicms/public;

    location @AnqiCMS {
        proxy_pass http://127.0.0.1:8001;
        proxy_set_header   Host             $host;
        proxy_set_header   X-Real-IP        $remote_addr;
        proxy_set_header   X-Forwarded-For  $proxy_add_x_forwarded_for;
    }

    location / {
        try_files $uri $uri/index.html @AnqiCMS;
    }

    # 静态资源直接由 Nginx 处理,不经过反向代理
    location ~ .*\.(gif|jpg|jpeg|png|bmp|swf|js|css|ico)$ {
        expires      30d;
        access_log   off;
    }

    access_log  /var/log/nginx/anqicms-access.log;
    error_log   /var/log/nginx/anqicms-error.log;
}

Note: Toserver_nameandrootReplace the path with your actual domain name and site path.

Verify the configuration and reload Nginx:

# 测试配置是否正确
nginx -t

# 重载 Nginx 使配置生效
nginx -s reload

Step 4: Add the task to keep the service alive

To make AnQiCMS run automatically after the server restart, add a crontab scheduled task:

# 编辑 crontab
crontab -e

# 添加以下行(每分钟检查一次 anqicms 进程)
*/1 * * * * /data/wwwroot/anqicms/start.sh

# 保存并退出(vim 中 :wq)

Manually execute the startup script once:

./start.sh

Step 5: Configure HTTPS (optional)

Recommended to use the free SSL certificate from Let’s Encrypt:

# 安装 certbot
# CentOS:
yum install certbot python3-certbot-nginx
# Ubuntu:
apt install certbot python3-certbot-nginx

# 获取并自动配置 SSL 证书
certbot --nginx -d www.anqicms.com -d m.anqicms.com

# 按照提示完成验证,certbot 会自动修改 Nginx 配置

Step 6: Initialize installation

  1. Access in the browserhttp://www.anqicms.com
  2. Enter the initial installation interface
  3. Fill in the database information and administrator account

Apache Reverse Proxy Configuration (optional)

If you use Apache instead of Nginx, the configuration is as follows:

<VirtualHost *:80>
    ServerName www.anqicms.com
    ServerAlias m.anqicms.com
    
    DocumentRoot /data/wwwroot/anqicms/public
    
    ProxyPass / http://127.0.0.1:8001/
    ProxyPassReverse / http://127.0.0.1:8001/
    
    <Directory /data/wwwroot/anqicms/public>
        Options FollowSymLinks
        AllowOverride All
        Require all granted
    </Directory>
    
    ErrorLog /var/log/apache2/anqicms-error.log
    CustomLog /var/log/apache2/anqicms-access.log combined
</VirtualHost>

You need to enable Apache's proxy module:

a2enmod proxy proxy_http
systemctl restart apache2

Common management commands

# 启动
cd /data/wwwroot/anqicms && ./start.sh

# 停止
cd /data/wwwroot/anqicms && ./stop.sh

# 查看运行状态
ps -ef | grep anqicms

# 查看运行日志
tail -f /data/wwwroot/anqicms/running.log

# 查看启动检测日志
tail -f /data/wwwroot/anqicms/check.log

# 修改端口(编辑 config.json 后重启)
vim /data/wwwroot/anqicms/config.json
# 修改 "port": 8001 为其他端口

Verify Installation

# 1. 检查进程是否运行
ps -ef | grep anqicms | grep -v grep

# 2. 检查端口是否监听
netstat -tlnp | grep 8001

# 3. 浏览器访问域名,应看到网站首页或安装界面

# 4. 访问 域名/system/ 进入后台

❓ I installed MySQL but don't know what the root password is, what should I do?

If MySQL is installed using the LNMP one-click installation package, the root password is usually saved in the following location:

# LNMP 安装包
cat /root/.mysql_root_password
# 或
cat /usr/local/mysql/root.txt

# 宝塔面板安装的 MySQL
cat /www/server/mysql/default.pass

If the above does not work, you can bypass MySQL authentication to reset the password (for Ubuntu):

# 1. 停止 MySQL
systemctl stop mysql

# 2. 以跳过权限检查的方式启动
mysqld_safe --skip-grant-tables &

# 3. 无密码登录 MySQL
mysql -u root

# 4. 在 MySQL 命令行中重置密码
ALTER USER 'root'@'localhost' IDENTIFIED BY '你的新密码';
FLUSH PRIVILEGES;
EXIT;

# 5. 重启 MySQL
systemctl restart mysql

❓ After configuring Nginx, why does the domain access show the Nginx default welcome page instead of the installation interface?

This is the most common mistake made by beginners.The reasons are usually the following two:

Reason one: The Nginx root path points to the default website directory.

# 检查默认网站配置文件中是否还有 server 块
ls /etc/nginx/conf.d/default.conf
# 如果有,暂时将其重命名禁用
mv /etc/nginx/conf.d/default.conf /etc/nginx/conf.d/default.conf.bak
nginx -s reload

Reason two: The root in the Nginx configuration does not point to the public subdirectory.

# ❌ 错误
root /data/wwwroot/anqicms;

# ✅ 正确
root /data/wwwroot/anqicms/public;

Reason three: DNS has not taken effect.

The domain name resolution just added may take a few minutes to a few hours to take effect globally. You can use the following command to test:

# 直接通过服务器 IP 测试(如果 AnQiCMS 监听在 8001 端口)
curl -I http://127.0.0.1:8001
# 如果返回 200 或 302,说明 AnQiCMS 正常运行,是 Nginx 或 DNS 的问题

❓ I changed the port in the config. to 8080. Do I need to synchronize any modifications?

After changing the port,The following two must be synchronized.:

Position Modification content
In the Nginx configurationproxy_pass proxy_pass http://127.0.0.1:8080;(not 8001)
Restart AnQiCMS After changing config., the process must be restarted for it to take effect

If you do not modify Nginx'sproxy_pass, Nginx will still try to forward requests to the 8001 port, while AnQiCMS is already listening on the 8080 port, and the user will see 502 Bad Gateway.

Related articles

Installation of Anqi CMS - Deployment with PHPStudy (Xiao Pi panel)

The application scenario: Windows local development environment or Windows server. PHPStudy (Xiao Pi panel) integrates components such as Nginx, MySQL, PHP, and AnQiCMS runs through Nginx reverse proxy.Preparation has been completed PHPStudy (Xiaopi Panel) software running mode has been switched to Nginx + MySQL package A local test domain (such as dev.anqicms.com) or access using IP + port AnQiCMS Windows installation package has been downloaded Installation steps Step 1: Create a site Open PHPStudy

2026-07-18

Installation of Anqi CMS - Baota panel deployment

2.2 Tower Panel Deployment Applicable Version: Tower Panel 7.9.3+. Tower Panel Deployment is divided into two methods: traditional deployment (uploading installation packages, configuring reverse proxy) and Docker one-click deployment. This chapter will introduce the traditional deployment method first.Preparation A Linux server with Baota panel installed (CentOS / Ubuntu / Debian are all okay) A domain name resolved to the server (such as www.anqicms.com) MySQL 5.6.35+ installed (recommended 5.7+ or 8.0) Download AnQiCMS Linux package from the official website or GitHub Method one: Baota 7

2026-07-18

Download and install AnQi CMS

Introduce the various download channels of AnQi CMS installation package (official website, GitHub, mirror site), the method of version selection for different operating systems and architectures, and the file verification method of the installation package to ensure that the correct and complete version is downloaded.

2026-07-10

Understand AnQi CMS - Official Resources and Support Channels

Summarize the technical resources and support channels such as the official website of AnQiCMS, online demos, development documentation, template manuals, API documentation, GitHub repository, and user communication groups. When encountering issues, you can quickly find the corresponding help according to your needs.

2026-07-05

Docker deployment of AnQi CMS

Docker deployment is the fastest installation method for AnQiCMS, suitable for quick experience and testing environments. Docker image address: https://hub.docker.com/r/anqicms/anqicms Method one: Docker command line deployment Suitable for environments where Docker is already installed (any operating system).Quick Start # Pull the latest image docker pull anqicms/anqicms:latest # Run the container docker run -d --name anqicms -p 8001:8001

2026-07-18

Source code compilation installation of AnQi CMS

Target audience: Developers who need secondary development, customization features, or whose needs cannot be met by the official binary packages. Difficulty: ⭐⭐⭐⭐ (requires familiarity with GoLang and command line operations) Prerequisites Software version requirements Description GoLang 1.13+ (recommended 1.25+) Compile Go source code Git any version Clone code repository MySQL 5.6.35+ Run database If GoLang has not been installed, please visit https://go.dev/dl/ to download and install.Clone from GitHub (recommended) git clone https://github

2026-07-18

Deployment of multiple sites on the same server for AnQi CMS

The AnQiCMS supports running multiple independent sites on the same server, each with its own domain name, database, template, and administrator. This chapter details the complete steps and注意事项 for multi-site configuration.Plan one: Multi-site management (recommended) Eligibility: A main AnQiCMS site that is already installed and running. This plan uses the built-in multi-site management feature of AnQiCMS, where all sites share the same AnQiCMS program but run independently.Do not copy the code multiple times. Preparations Have deployed and run a AnQiCMS main site (port 8001) The main station background has Multi-site management Menu permissions (default installed sites have it)

2026-07-18

Installation guide and initialization of AnQi CMS

When you first start AnQiCMS, you need to complete the initial installation, including configuring database connection information, setting up the administrator account password, specifying the site name, and other key steps, which are essential before the system can be officially used.When do you need to initialize The following situations require initialization installation: Scenario Description First deployment Fresh installation AnQiCMS Restore factory settings Clear data and reinstall If installed through Baota Docker or aaPanel Docker, the system will automatically complete the initialization (default account admin / password 123456), no manual initialization process is required.Initialization step Step 1: Ensure AnQiCMS is started

2026-07-18