Deploy multiple AnQiCMS sites on a Linux server: A practical guide to efficient operation and maintenance
As a senior website operations manager, I fully understand the importance of efficiently and flexibly managing multiple websites in an increasingly complex network environment for both enterprises and content operations teams.AnQiCMS as an enterprise-level content management system developed based on the Go language, with its high performance and easy extensibility, provides strong support for multi-site management.This article will detail how to deploy and manage multiple AnQiCMS sites on a single Linux server, helping you to achieve efficient and unified content management.
Preparation for deployment
Before starting the deployment, please ensure that your Linux server meets the following basic requirements:
- Operating systemSupports mainstream Linux distributions such as CentOS, Ubuntu, Debian, etc.
- Web server: Nginx, Apache, or OpenResty have been installed and configured as reverse proxy servers.
- Database: The MySQL or MariaDB database service is installed and running.
- Domain resolutionAll the AnQiCMS site domain names scheduled for deployment have been correctly resolved to your server IP address.
- Server management tool (optional)As panel software like Baota, 1Panel, or aaPanel, etc., it can greatly simplify the deployment and management process.
Core deployment concept: one instance, multiple sites
AnQiCMS is built with powerful multi-site management features.This means you do not need to copy a set of AnQiCMS program code for each site.On the contrary, you can run an AnQiCMS application instance on the server (usually listening on a specific port, such as 8001), and create and manage multiple independent websites through its management backend.The web server (Nginx/Apache) will act as a reverse proxy, forwarding requests to this AnQiCMS instance based on the different domain names accessed by users, and AnQiCMS will then identify and respond with the corresponding site content according to the domain name.This way not only saves server resources, but also greatly simplifies the later maintenance and upgrade work.
Detailed deployment process
The process of deploying multiple AnQiCMS sites mainly consists of three core steps: installing and initializing the first AnQiCMS instance, configuring the web server reverse proxy for new sites, and adding new sites in the AnQiCMS backend.
Step 1: Install and initialize the first AnQiCMS instance
If you have not installed AnQiCMS on the server yet, please complete the deployment and initialization of the first (main) site first. Here, we briefly illustrate the method of Baota panel Docker and manual command line as an example:
Install using the Taobao Panel Docker method (recommended)
- Install Taobao Panel and DockerEnsure your Baota panel version is above 9.2.0 and install Docker from the Baota panel app store.
- Install MySQL databaseIn the Docker app store, search for and install MySQL (recommended version 5.7 or above), and note the database root password.
- Install AnQiCMS applicationIn the Docker app store, search for 'anqicms', click to install. Fill in the main site domain and a unique database name (such as
anqicms_main) MySQL's root password, and specify a port (for example)8001) - Initialize installationAfter installation, access your main site domain through a web browser, enter the AnQiCMS initial installation interface, and complete the database connection and administrator account settings.
Install using the manual command line
Download and extract: Download the Linux-compatible installation package from the AnQiCMS official website and extract it to the specified directory, for example
/www/wwwroot/anqicms_main.Configure and run AnQiCMS: Enter the extracted directory and run
./start.shScript starts AnQiCMS service. It is recommended to configure to ensure that AnQiCMS runs continuously and automatically starts after server restart.crontabTask, check and start AnQiCMS every minute.# 编辑crontab任务 crontab -e # 添加以下行,确保路径正确 */1 * * * * /www/wwwroot/anqicms_main/start.shConfigure Nginx reverse proxyConfigure Nginx for your main site domain:
serverBlock. Reverse proxy the request to the port listened by AnQiCMS (for examplehttp://127.0.0.1:8001),androotCommand points to the main instance of AnQiCMSpublicdirectory. “`nginx server {listen 80; server_name your-main-domain.com; # 替换为主站点域名