Deploy multiple AnQiCMS sites on a Linux server: A practical guide to efficient operation and maintenance
As an experienced website operator, I am well aware of the importance of efficiently and flexibly managing multiple websites for enterprises and content operation teams in an increasingly complex network environment.AnQiCMS is an enterprise-level content management system developed based on the Go programming language. It provides strong support for multi-site management with its high performance and easy scalability.This article will detail how to deploy and manage multiple AnQiCMS sites on a single Linux server, helping you achieve efficient and unified content management.
Preparation before 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 is installed and configured as a reverse proxy server.
- Database:MySQL or MariaDB database service is installed and running.
- Domain resolutionAll the AnQiCMS site domains scheduled for deployment have been correctly resolved to your server IP address.
- Server management tool (optional): Such as the panel of Baota, 1Panel, or aaPanel, etc., which can greatly simplify the deployment and management process.
Core deployment concept: One instance, multiple sites.
AnQiCMS built-in powerful multi-site management function.This means you do not need to copy a set of AnQiCMS program code for each site.On the contrary, you can run an instance of the AnQiCMS application 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. AnQiCMS then identifies and responds to the corresponding site content based on the domain name.This method not only saves server resources, but also greatly simplifies the later maintenance and upgrade work.
Detailed explanation of the deployment process.
The process of deploying multiple AnQiCMS sites is mainly divided into three core steps: installing and initializing the first AnQiCMS instance, configuring 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 explain with the Baota panel Docker method and manual command line method as examples:
Install using the Docker method of Baota Panel (recommended)
- Install Baota Panel and DockerEnsure that your Baota panel version is above 9.2.0, and install Docker from the Baota panel app store.
- Install MySQL databaseSearch for and install MySQL (recommended version 5.7 or above) in the Docker app store and note down the database root password.
- Install AnQiCMS applicationSearch for 'anqicms' in the Docker app store, click to install. Fill in the main site domain and a unique database name (such as
anqicms_mainSet the root password for MySQL and specify a port (for example)8001). - Initialize the installationAfter installation, access your main site domain through a browser, enter the AnQiCMS initial installation interface, and complete the database connection and administrator account setup.
Install using manual command line
Download and extract: Download the Linux 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. To ensure AnQiCMS runs continuously and starts automatically after server restart, it is recommended to configurecrontabTask, check and start AnQiCMS every minute.# 编辑crontab任务 crontab -e # 添加以下行,确保路径正确 */1 * * * * /www/wwwroot/anqicms_main/start.shConfigure Nginx reverse proxy.: Configure Nginx for your main site domain.
serverblock. Reverse proxy the request to the port AnQiCMS is listening on (for example)http://127.0.0.1:8001), and willrootthe instruction points to the main instance of AnQiCMSpublicdirectory. “`nginx server {listen 80; server_name your-main-domain.com; # 替换为主站点域名