What is the first-time installation and deployment process of AnQiCMS on a Linux server?
In the digital wave, an efficient and stable content management system (CMS) is the foundation for the success of corporate and personal website operations.AnQiCMS (AnQiCMS), this lightweight system developed based on the Go language boasts excellent performance, flexible customization capabilities, and deep SEO-friendliness, and is gradually becoming the preferred choice for many small and medium-sized enterprises and content operation teams.It is not only easy to deploy, but also has high running efficiency, and can effectively resist many security threats, protecting the website.
If you are preparing to deploy AnQiCMS on your Linux server and are curious about the process of the first installation, then this content will explain it in detail for you, helping you take the first step easily.We will take a perspective from an experienced website operations expert, breaking down each link of installation and deployment clearly, ensuring that you can complete the setup successfully.
The preparation before deployment: being solid and resolute is the key
Before we officially begin the installation, we need to do some basic preparations, which is as important as laying the foundation before building a house.
First, 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 basic operations such as SSH connections and file transfers 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 to access the AnQiCMS website.
The selection of installation path: Distinguishing between Baota Panel and Command Line
There are usually two mainstream methods for deploying AnQiCMS under Linux environments:
- Deploy visually using Baota panel (or 1Panel and other panels)This method is particularly suitable for those who are not familiar with command line operations or hope to efficiently manage servers through a graphical interface. The Baota panel greatly simplifies the configuration of the environment and the management process of websites.
- Deploy manually via command lineFor users familiar with Linux operations, or those who追求极致定制、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.
Path one: Deploy AnQiCMS easily with the Baota panel.
The Baota panel greatly reduces the threshold for server management with its friendly graphical interface.Recommend your Baota panel version to be above 7.9.3 for convenient deployment using its "Go project" feature.
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 the Baota panel, and go to
/www/wwwroot/Directory. Create a new folder for your AnQiCMS website under this directory, usually named after your domain, such asanqicms.com.Next, from the AnQiCMS official website (
https://en.anqicms.com/download) Download the latest Linux installation package (usually)anqicms-linux-vX.X.X.zip). Upload this compressed package to the directory you just createdanqicms.comInside the folder, then use the file management feature of the Baota panel, right-click on the compressed package to unzip it, make sure that all the files of AnQiCMS are correctly placed inanqicms.comdirectory.Add Go project in 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 extraction directory, for example
/www/wwwroot/anqicms.com/anqicms. - Project Name: You can name it freely, for example
AnQiCMSUsed to identify the project in the Baota panel. - Project port: Default fill
8001This is the port where the AnQiCMS program runs itself.If in the future you need to deploy multiple AnQiCMS instances on the same server, each instance needs to use a different port. - Execute the command: Same as the path to the project's executable file, for example
/www/wwwroot/anqicms.com/anqicms. - Running user: Usually select
www. - Boot up: It is recommended to check it to ensure that AnQiCMS can run automatically after the server restarts.
- Bind domain: Fill in the domain name you have prepared for AnQiCMS.
After confirming that the information is correct, click 'Submit' to complete the project addition.
- Project Execution File: Points to the executable file in the AnQiCMS extraction directory, for example
Configure Nginx's pseudo-static rulesThis step is crucial, as it determines whether your website can be accessed normally through the domain name.In the "Website" list of the Baota panel, find the site you just added, click the "Settings" button on the right.
First, in the 'Website Directory' tab, pleaseRunning directoryis modified to
public, that is/www/wwwroot/anqicms.com/publicand save.Later, switch to the "Static" tab. Clear the default content and paste the following Nginx rewrite rules:
location @AnqiCMS { proxy_pass https://en.anqicms.com; 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 role of this rule is to forward all access requests to your domain through a reverse proxy to the AnQiCMS program running
8001Port, and ensure the elegance and compatibility of the URL. After saving the rules, the Nginx configuration is complete.Initialize installation websiteNow, open your browser and enter the domain you have bound.If everything goes well, you will see the initialization installation interface of AnQiCMS.Here, you need to fill in the database connection information (including database address, port, username, and password), as well as your AnQiCMS backend administrator's account and password.Please remember the administrator account and password you have set, as they will be your credentials for managing the website in the future.Fill in the information, click install, wait a moment, and your AnQiCMS website will be successfully deployed!
Second path: manually deploy AnQiCMS via command line.
For those who prefer to operate directly in the Linux command line, manually deploying AnQiCMS is also direct and efficient.Assuming you have already installed Nginx and MySQL, and have a basic understanding of their configurations.
Download and extract the installation packageConnect to your Linux server via SSH. Use
wgetDownload the Linux version installation package from the AnQiCMS official website and place it in the root directory of your desired website, 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.zipAfter unpacking, make sure
anqicmsThe executable file and all related resources are located in this directory.Add a scheduled task to ensure the program runs continuously.To keep the AnQiCMS program running in the background and automatically recover after server restarts, we can set up a scheduled task to monitor and start it.
First, open the task scheduler editor:
crontab -eIn the opened editor, add the following command line:
*/1 * * * * /www/wwwroot/anqicms.com/start.shThe meaning of this command is to check and execute once every minute
anqicms.comUnder the directorystart.shscript.start.shThe script usually contains logic to check the AnQiCMS process and start it as needed.save and exit
crontabAfter the editor, execute once manually.start.shThe script starts AnQiCMS immediately:cd /www/wwwroot/anqicms.com ./start.shConfigure Nginx reverse proxyNext 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 https://en.anqicms.com; # 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