As a website operator familiar with AnQiCMS, I am well aware of the importance of an efficient, stable, and easy-to-manage content system for website operations.AnQiCMS is a modern enterprise-level content management system developed based on the Go language, with its high concurrency, high security, easy deployment, and excellent SEO-friendly features, it has become an ideal choice for many small and medium-sized enterprises and content operation teams.This article will detail how to install and deploy AnQiCMS's Go project on a Linux server, aiming to help you smoothly set up your own website.

Introduction and environment preparation of AnQiCMS

AnQiCMS is positioned to provide services for small and medium-sized enterprises, self-media operators, and multi-site managers.It is developed in Go language, which endows the system with excellent performance and stability, making it capable of effectively handling high concurrency access.Moreover, AnQiCMS is built with multi-site management, flexible content models, multilingual support, and a series of advanced SEO tools, aimed at improving content management efficiency and the search engine performance of websites.

Before starting the installation, please make sure your Linux server is ready.AnQiCMS supports Ubuntu, Centos, Red Hat, Debian, and other Linux distributions based on the X86 architecture.The core dependencies include a MySQL database (recommended version 5.6.35 or higher) and a web server (such as Nginx or Apache) for reverse proxying.Ensure that these basic environments are correctly installed and running, which will lay a solid foundation for the smooth deployment of AnQiCMS.

Method one: Deploy quickly through Baota panel (recommended)

The Baota panel provides a graphical interface for Linux server management, greatly simplifying the deployment process of AnQiCMS.It is recommended that your Baota panel version be 7.9.3 or higher to get more convenient deployment support for Go projects.

First, you need to create a new directory in Baota panel to store AnQiCMS files. Usually, this will be/www/wwwroot/Name it under your domain (for example/www/wwwroot/anqicms.com)。Then, download the latest Linux installation package from the AnQiCMS official website (usuallyanqicms-linux-v3.x.x.zip),and upload it to the directory you just created. After uploading, right-click the installation package in the Baota panel's file management interface and select extract to the current directory.

It is very straightforward to deploy AnQiCMS as a Go project for Potain Panel 7.9.3 and above.Select "Website/www/wwwroot/anqicms.com/anqicms),Project name can be filled in with "AnQiCMS", the default port is8001(If multiple AnQiCMS are deployed on the same server, please allocate different ports), run the command again to fill in the project execution file path, user selection runningwwwCheck the 'Boot up' option, then bind your domain and click submit.

If your Baota panel is an old version, it does not support the direct deployment of Go projects, you can select 'Other Projects' in the 'Website' menu, click 'Add General Project', and the configuration items are basically consistent with the above Go project deployment.

After completing the project deployment, visit the domain you have bound in the browser.AnQiCMS will guide you to the initial installation interface, where you need to configure MySQL database information, set the background administrator account password, and confirm the website address.Please make sure to check the account permissions and password correctness of the database, and set a sufficiently complex administrator password to ensure security.

Install multiple AnQiCMS sites on a server

AnQiCMS supports multi-site management and does not require copying multiple copies of code for each site, which greatly saves resources. If you need to deploy multiple AnQiCMS sites on a single server, you can follow the steps below:

First, add a "PHP project" in the Baota panel, fill in your new site domain, keep the root directory default, and record it.FTP and database are not created, PHP version is selected as 'Static', then submit.

Next, log in to the admin interface of the AnQiCMS site you have installed by default.Find the "Multi-site Management/app/Adding the domain name replaced by underscores, for example/app/dev_anqicms_comTo ensure data is stored independently), enter the complete URL of the new site and set the administrator account and password for the new site.The database name should be a new, unused database. If you have installed using the root account, you can choose to 'Reuse default database account information', AnQiCMS will create a new database for you.After selecting the appropriate template for the new site, click "OK" to complete the creation.

Go back to the Baota panel, find the newly created PHP project, click "Settings". In the "Website Directory", change the running directory to/publicSave it. Then configure the pseudo-static rules. For Nginx, enter the following rules in the 'Pseudo-static' menu and save:

location @AnqiCMS {
    proxy_pass http://127.0.0.1:8001; # 注意:这里的端口应是您Go项目主服务的端口
    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;
location / {
   try_files $uri $uri/index.html @AnqiCMS;
}

If you are using Apache, leave the pseudo-static column blank, select "reverse proxy", and fill in the target URLhttp://127.0.0.1:8001. After completing these steps, the new site can be accessed through its domain and managed independently.

Method two: Deploy manually through the command line.

For users who do not have the Baota panel or prefer manual configuration, AnQiCMS also supports deployment through the command line. This guide uses the LNMP environment as an example.

First, download the Linux version package from the AnQiCMS official website and upload it to your server (for example/www/wwwroot/anqicms.comdirectory). Usetar -xzvf anqicms-linux-v3.x.x.zipCommand to unzip the installation package and enter the directory after extraction.

To ensure that the AnQiCMS service can automatically run after the server restarts and continue to monitor its running status, you need to add a scheduled task. Executecrontab -eCommand to edit the cron job and add a line:

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

Save and exit. This command will make the system check and start the AnQiCMS service every minute. Make sure/www/wwwroot/anqicms.com/start.shThe path correctly points to the extraction directorystart.shExecute manually once./start.shTo start the service immediately.

Next, configure Nginx as the reverse proxy for AnQiCMS. You need to configure the Nginx site'srootdirectory to the AnQiCMS installation directory.publicSubdirectory, and set up reverse proxy to forward traffic to the default port of AnQiCMS8001The following is an example of a complete Nginx configuration:

server
{
    listen       80;
    server_name your_domain.com; # 替换为您的域名
    root /www/wwwroot/anqicms.com/public; # 替换为您的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;
    }
    error_page 404 =200  @AnQiCMS;
    location / {
       try_files $uri $uri/index.html @AnQiCMS;
    }
    access_log /var/log/nginx/your_domain.com.access.log; # 自定义日志路径
}

After the configuration is complete, restart the Nginx service to make the configuration effective.

When manually deploying multiple sites, you just need to repeat the above Nginx site configuration steps to configure different sites for each new site.server_nameandrootDirectory (make sure these directories have been created and are accessible).Then, add the corresponding site information in the "Multi-site Management" section of the AnQiCMS backend, AnQiCMS will automatically manage the data and configuration of the new site.

Post-installation first configuration and subsequent management

Whether through the Baota panel or command line deployment, when you visit the AnQiCMS website for the first time, the system will guide you to complete the database configuration and create an administrator account.Please fill in the relevant information as prompted.您的域名/system/Access the backend management interface to start content creation and website operations.

The AnQiCMS backend provides rich features including content publishing, category management, tag settings, SEO optimization tools, multi-site management, and data statistics.With these tools, you can efficiently manage website content, enhance user experience, and improve search engine visibility.Regularly check for system updates and upgrade them in a timely manner to ensure that your AnQiCMS always runs in the latest and safest state.

Frequently Asked Questions (FAQ)

Q1: After installing AnQiCMS, the website cannot be opened or displays '502 Bad Gateway', what should you do? A1:This is usually caused by the AnQiCMS Go project service not starting or incorrect Nginx/Apache reverse proxy configuration.First, check the running status of the AnQiCMS Go project. If using the Baota panel, you can check its status under "Go Project" or "Other Projects" and try to start it manually.start.shDid it execute successfully, or uselsof -i:8001(or the port you have configured) Check if the port is occupied or if the service is listening. Next, carefully check the Nginx/Apache reverse proxy configuration to ensureproxy_passThe IP address and port pointed to are consistent with the actual listening address and port of the AnQiCMS Go project, and the pseudo-static rules are correct.

Q2: How to install multiple AnQiCMS sites on the same Linux server? Do you need to install multiple copies of the code? A2:AnQiCMS supports managing multiple sites under a single Go project instance, without the need to install multiple copies of AnQiCMS for each site.You can add a new site by using the "Multi-site Management" feature in the backend of the main site.Each new site needs to be configured with a separate domain, site root directory (used to store each site's cache and uploaded files) and a separate database.