In the digital wave, an efficient and stable content management system (CMS) is the cornerstone for the success of enterprise and personal website operations.English CMS (EnglishCMS), this lightweight system developed based on Go language is gradually becoming the preferred choice for many small and medium-sized enterprises and content operation teams with its excellent performance, flexible customization capabilities, and deep SEO-friendliness.It is not only simple to deploy and highly efficient in operation, but also effective in resisting many security threats, safeguarding the website.

If you are preparing to deploy AnQiCMS to your Linux server and are curious about the process of the first installation, this article will provide a detailed explanation to help you easily take the first step.We will break down each link of the installation and deployment process from the perspective of an experienced website operation expert, ensuring that you can complete the setup smoothly.

Preparation before deployment: Steadfastness is the key

Before we formally begin the installation, we need to do some basic preparation work, which is as important as laying a solid foundation before building a house.

Firstly, you need a server running a Linux operating system, such as Ubuntu, CentOS, Red Hat, or Debian, etc.At the same time, ensure that your server has a stable network connection, and that you are familiar with the basic operations such as SSH connection and file transfer on the server.

Secondly, as AnQiCMS requires a database to store content, you need to ensure that the MySQL database service is installed and running on the server.If you choose a graphical management tool like Baota Panel, you can usually install and manage the database directly on the panel, saving a lot of command line operations.

Finally, don't forget to prepare a domain name for your website and correctly resolve it to your server's IP address. This will be the entry point for you to access the AnQiCMS website.

The selection of installation path: The difference between Baota Panel and Command Line

There are usually two mainstream methods for deploying AnQiCMS under the Linux environment:

  1. Deploy visually using Baota Panel (or 1Panel and other panels)This method is especially suitable for users who are not familiar with command line operations or who hope to efficiently manage servers through a graphical interface. The Baota panel will greatly simplify the process of environment configuration and website management.
  2. Deploy manually via command line:For users familiar with Linux operations, or those who pursue ultimate customization and hope to have a deeper control over the server environment, command-line deployment is a more direct choice.

Next, we will respectively introduce these two deployment methods in detail.

Path one: Deploy AnQiCMS easily with the Baota panel.

The panel greatly reduces the threshold for server management with its friendly graphical interface.Recommend your Baota panel version to be above 7.9.3 to use its 'Go project' feature for convenient deployment.

  1. Create the site directory and upload the installation package.First, log in to your server via SSH, or navigate directly to the file management interface of Baota panel./www/wwwroot/Table of contents. Create a new folder under this directory for your AnQiCMS website, usually named after your domain, such asanqicms.com.

    Next, from the AnQiCMS official websitehttps://en.anqicms.com/download)Download the latest Linux installation package(usuallyanqicms-linux-vX.X.X.zip)。Upload this compressed package to the one you just createdanqicms.comIn the folder, then use the file management feature of Baota panel, right-click on the compressed package to unzip it, and ensure that all files of AnQiCMS are correctly placed inanqicms.comthe directory.

  2. Add Go project in the Baota panelIn the left menu of the Baota panel, click the "Website" option, then select "Go project" (if your Baota version is older, it may be "Other projects" or "General projects"). Click the "Add Go project" button, and in the pop-up configuration window, you need to fill in the following information:

    • Project Execution File: Points to the executable file in the AnQiCMS unpacked directory, for example/www/wwwroot/anqicms.com/anqicms.
    • Project Name: You can name it freely, for exampleAnQiCMS,used to identify this project in the Baota panel.
    • Project port:Default8001.This is the port where AnQiCMS program runs itself.If you need to deploy multiple AnQiCMS instances on the same server in the future, each instance must use a different port.
    • Execute command:Same as the path to the project's execution file, for example/www/wwwroot/anqicms.com/anqicms.
    • Run User: Typically selectedwww.
    • Boot up: It is recommended to check it to ensure that AnQiCMS can run automatically after the server restarts.
    • Bind DomainFill in the domain name you prepared for AnQiCMS.

    After confirming that the information is correct, click 'Submit' to complete the project addition.

  3. Configure Nginx pseudo-static rulesThis step is crucial, as it determines whether your website can be accessed normally through the domain name.In the " Websites

    First, in the "Website Directory" tab, selectExecution DirectoryChange topublic, which is/www/wwwroot/anqicms.com/publicAnd save.

    Next, switch to the "URL Rewrite" tab. Clear the default content and paste the following Nginx URL rewrite rules:

    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;
    }
    

    The function of this rule is to forward all access requests to your domain to the AnQiCMS program running in English8001Port, and ensure the elegance and compatibility of the URL. After saving the rules, the Nginx configuration is complete.

  4. Initialize the installation of the websiteNow, open your browser and enter the domain you have bound.If everything goes well, you will see the AnQiCMS initial installation interface.Here, you need to fill in the database connection information (including database address, port, username, and password), as well as the account and password of the AnQiCMS backend administrator.Please make sure to remember the administrator account and password you set, as they will be your credentials for managing the website in the future.Fill in the details, click Install, wait a moment, and your AnQiCMS website will be successfully deployed!

路径二:Command Line Manual Deployment of AnQiCMS

For developers or system administrators who prefer to operate directly in the Linux command line, deploying AnQiCMS manually is straightforward and efficient.Here it is assumed that you have already installed Nginx and MySQL, and are familiar with their basic configuration.

  1. Download and Extract the Installation PackageConnect to your Linux server via SSH. UsewgetThe command downloads the installation package of the Linux version from the AnQiCMS official website and places it in the root directory of the website you wish to use, for example,/www/wwwroot/anqicms.com.

    cd /www/wwwroot/anqicms.com
    wget https://en.anqicms.com/download/anqicms-linux-vX.X.X.zip # 请替换为最新版本链接
    unzip anqicms-linux-vX.X.X.zip
    

    After unpacking, make sureanqicmsThe executable file and all related resources are located in this directory.

  2. Add a scheduled task to ensure the program runs continuously.To ensure that the AnQiCMS program runs continuously in the background and recovers automatically after server restarts, we can set up a scheduled task to monitor and start it.

    First, open the task scheduler editing interface:

    crontab -e
    

    In the opened editor, add the following line of command:

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

    The meaning of this command is to check and execute once a minuteanqicms.comthe directory.start.shscript.start.shThe script usually contains logic to check the AnQiCMS process and start it as needed.

    Save and exitcrontabExecute it manually once after the editor.start.shThe script starts AnQiCMS immediately:

    cd /www/wwwroot/anqicms.com
    ./start.sh
    
  3. Configure Nginx reverse proxy.The next step is to configure Nginx, forwarding external requests to the port where AnQiCMS is running. You need to edit the Nginx site configuration file, usually located/etc/nginx/conf.d/or/etc/nginx/sites-available/./www/wwwroot/anqicms.comAs the root directory of the site,dev.anqicms.comFor example, your Nginx configuration may be as follows:

    server
    {
        listen       80; # 监听80端口
        server_name  dev.anqicms.com; # 替换为您的域名
        root         /www/wwwroot/anqicms.com/public; # 网站运行目录指向AnQiCMS的public文件夹
    
    
        location @AnqiCMS {
            proxy_pass http://127.0.0.1:8001; # 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; # 确保404页面也能被AnQiCMS处理
        location / {
           try_files $uri $uri/index.html @AnqiCMS; # 优先查找静态文件,否则转发给AnQiCMS
        }
        access_log /var/log/nginx/dev.anqicms.com_access.log; # 配置访问日志
        error_log /var/log/nginx/dev.anqicms.com_error.log; # 配置错误日志
    }
    

    Configuration