How to solve the problem of port occupation or incorrect pseudo-static rules during the installation of AnqiCMS?

Calendar 👁️ 80

As an experienced CMS website operation personnel in an information security enterprise, I know that some common but critical issues during the system deployment process can lead to installation obstacles.Among the common problems encountered by new users are occupied ports and incorrect configuration of pseudo-static rules.Correctly identify and solve these problems is the basis for ensuring the smooth operation of AnQiCMS and giving full play to its content management advantages.

During the installation and deployment of AnQiCMS, we may encounter some annoying problems, such as server ports being occupied by other programs, or the pseudo-static rules of web servers (such as Nginx, Apache) not working properly, leading to the website pages not being accessible.These issues, if not handled properly, not only will delay our deployment progress, but may also affect the subsequent stable operation of the website and the search engine optimization performance.Next, I will elaborate on how to effectively investigate and solve these two common problems.

How to investigate and solve port occupation problems

When installing AnQiCMS, if you encounter a prompt indicating that the port is occupied, it usually means that the port (default is 8001) you are trying to use to start AnQiCMS is already being listened to by another application on the server.AnQiCMS as an independent Go language application needs to occupy the port specified by its runtime.

First, we need to confirm which process is using the port. In a Linux server environment, you can uselsofEnter the command to view the port usage. For example, to check port 8001, you can enter in the terminallsof -i:8001If the command returns a result, it will display the process ID (PID) and related information that occupies the port.

Once we find the PID of the process occupying the port, the next step is to terminate the process. Similarly, in the Linux environment, you can usekill -9 PIDCommand to force terminate the process. For example, if the PID is 7621, you will executekill -9 7621After the process is terminated, AnQiCMS can successfully bind and use the port to start.

For users deploying AnQiCMS through Docker or panel tools (such as Baota Panel, 1Panel, aaPanel), the configuration and conflict handling of the port is slightly different.In these environments, you usually specify a 'container port' (the port that AnQiCMS actually listens to, usually 8001) and a 'server port' or 'host port' when creating a container or adding a Go project.If the host port is occupied, you just need to modify this host port to a new port that is not occupied, without concerning about the port inside the container.For example, when adding a Go project in the Baota panel, the project port can be changed to an unoccupied port such as 8002, 8003, and so on.The benefit of this approach is that even when deploying multiple AnQiCMS instances on a single server, each instance can be mapped to a different host port, thereby running without interference.

The incorrect handling method of pseudo-static rules.

The pseudostatic rules are an important part of web applications, which can convert dynamic URLs into more aesthetic and SEO-friendly static URLs.AnQiCMS has good built-in support for pseudo-static, but incorrect configuration at the web server level can cause the website pages to display 404 errors or style loading exceptions.

Configure the rule of pseudo-static mainly depends on the type of web server you use, common ones are Nginx and Apache.

For Nginx servers, the correct pseudo-static configuration is crucial. First, you need to make sure that the website's 'runtime directory' (known as 'website directory' in Baota panel) is correctly set to the AnQiCMS deployment directory underpublicfolder. thispublicThe directory contains all the static files that need to be directly exposed to the web server, such as CSS, JS, images, and the entry points used by AnQiCMS to process requests.

Next, in the Nginx configuration file (usually the one corresponding to the site's.confFile, or in the "URL Rewrite" settings of Baota panel), you need to add specific rewrite rules. An example of a typical Nginx rewrite rule is as follows:

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 logic of this configuration is: when a user's request arrives at Nginx,location /the command will first try to find out if the requested file or directory exists inpublicthe directory (try_files $uri $uri/index.htmlIf not found, forward the request to the AnQiCMS application@AnqiCMS)proxy_pass https://en.anqicms.com;The command is responsible for proxying the request to the local port that AnQiCMS is listening on.error_page 404 =200 @AnqiCMS;Ensure that even if Nginx handles requests as 404, AnQiCMS can also handle them to achieve custom 404 pages or pseudo-static routing.After configuration is complete, be sure to restart the Nginx service to make the changes take effect.

If you are using an Apache server, the implementation of pseudo-static is slightly different, usually achieved through reverse proxy.In the Baota panel, if you have selected Apache as the web server, you can add a rule in the "reverse proxy" settings.https://en.anqicms.com。Apache will forward all requests to the AnQiCMS for this site. Make sure Apache'smod_proxymodule is enabled, which is necessary for the reverse proxy function.

Regardless of which web server is used, the core goal of the pseudo-static rules is to route all frontend requests correctly to the AnQiCMS application, while allowing the web server to directly provide static resources, thus achieving URL beautification and improving performance.After the configuration is complete, be sure to visit your website through the browser, test that the URLs for all pages and features are normal, and ensure that the pseudo-static rules have been correctly applied.

Summary

When deploying AnQiCMS, incorrect port occupation and pseudo-static rules are two common 'roadblocks'.By following the above detailed troubleshooting and resolution steps, including using system tools to check and manage ports, and configuring the correct pseudo-static rules according to the characteristics of Nginx or Apache, you will be able to successfully complete the installation of AnQiCMS and provide a stable, efficient running environment for your website.As a website operator, mastering these basic skills is essential, as they will help us better manage and optimize our Anqin CMS site.


Frequently Asked Questions (FAQ)

Q1: What should I do if the website page shows blank or CSS is messed up after AnQiCMS is installed?

A1:If the website page displays a blank page or messy styles, this is usually due to incorrect configuration of the pseudo-static rules or incorrect settings of the website running directory. Please first check whether the pseudo-static rules of the web server (Nginx/Apache) have been correctly configured according to the documentation, especially for Nginx'stry_filescommands andproxy_passtarget address, as well as the target address of Apache's reverse proxy. Next, confirm that the website's running directory points to the deployment path of AnQiCMS.publicfolder.If all these are correct, please try clearing your browser cache and the website CDN cache (if used).If the problem persists, check if the AnQiCMS program has started normally and is listening on the correct port, as well as whether the server firewall is blocking access to the AnQiCMS port.

Q2: How to safely upgrade AnQiCMS version?

A2:The recommended method for safely upgrading AnQiCMS is: first,Make sure to perform a complete backup of the database and all AnQiCMS files before upgrading.Then, log in to the AnQiCMS backend, navigate to the 'System Upgrade' feature, the system usually detects new versions and provides an online upgrade option.Follow the prompts to perform the upgrade operation.config.jsonHandle your customized template file with caution to avoid being overwritten, and finally restart the AnQiCMS process.After the upgrade, it is recommended to clear the system cache and check whether the website functions are normal.For users deploying through Docker, it is usually sufficient to update the Docker image.

Q3: How to reset if you forget the admin password of the background?

A3:If you forget the password for the AnQiCMS backend administrator, there is no direct "password recovery" feature available on the backend.You need to reset the password by directly modifying the database.The specific steps are as follows: Log in to your MySQL database management tool (such as phpMyAdmin, Navicat, or via command line).usersOr a table with a similar name. Find your administrator user record in this table, and change the password field (usuallypasswordorpasswd)Modify the MD5 value of the new password (or the hash value corresponding to the AnQiCMS backend encryption method, which may require referring to the latest AnQiCMS documentation or code).The simplest method is to create a new admin account, note down its default MD5 password, then log in to the backend with this new account, and then change the password of your original admin account.admin/123456), and change the password of the existing administrator immediately after logging in.

Related articles

How to configure domain names for AnqiCMS multi-sites using the Baota reverse proxy feature?

As an experienced person who is proficient in AnqiCMS and website operation, I fully understand the need for efficient management of multiple websites, especially on how to use the reverse proxy function of Baota panel to configure domain names for your AnqiCMS multi-site.The strength of AnqiCMS lies in its multi-site management capabilities, while Baota panel provides convenient graphical interface support for this process.Now, let's delve deeper into how to implement this configuration step by step.

2025-11-06

How to install and manage multiple AnqiCMS sites on the same server?

As an experienced CMS website operation person in the Anqi company, I know that efficient management of multiple websites is crucial for small and medium-sized enterprises and content operation teams in the increasingly fierce online environment.Aqie CMS provides an elegant and efficient solution with its powerful multi-site management capabilities to address this pain point.Below, I will elaborate on how to install and manage multiple Aanque CMS sites on the same server.Understanding Anqi CMS's Multi-site Architecture Anqi CMS has always considered the need for multi-site management since its design.

2025-11-06

How to deploy AnqiCMS with one-click through aaPanel (International Edition)?

HelloAs an experienced website operator, I am very happy to give you a detailed explanation of how to conveniently deploy AnQi CMS on aaPanel (Baota International Edition).AnQi CMS is becoming the preferred choice for an increasing number of small and medium-sized enterprises and content operation teams with its high-performance architecture based on the Go language, SEO-friendly design, and powerful multi-site management capabilities.Through the one-click deployment function of Docker in aaPanel, the whole process becomes extremely simple and efficient, allowing you to quickly set up and engage in content operation.

2025-11-06

How to quickly deploy AnqiCMS application through Docker on Panel panel?

As an experienced website operations manager, I know the importance of an efficient and secure content management system for enterprises and self-media.AnQiCMS, with its lightweight and high-performance features based on the Go language, is our preferred choice for content deployment.In daily operations, we often need to quickly launch new sites, and Docker combined with the 1Panel panel provides an extremely convenient solution.Next, I will elaborate on how to quickly deploy the AnqiCMS application using Docker technology through the 1Panel panel.

2025-11-06

How to smoothly upgrade AnqiCMS 2.x to 3.x version?

**AnqiCMS 2.x version upgrade to 3.x detailed guide** As an experienced AnqiCMS operations personnel, I know that each version upgrade is crucial for the stable operation of the website and the efficiency of content management.AnqiCMS upgraded from version 2.x to 3.x, not only brought performance optimization and functional enhancement, but also innovated in system deployment and multi-site management, especially through the "Go project" management method, making system maintenance simpler and more efficient.

2025-11-06

How to add and edit document content and its recommended attributes in the AnqiCMS backend?

As an experienced CMS website operation personnel, I know that content is the lifeline of the website, and an efficient content management system is the key to our successful operation.AnQi CMS, with its simple and efficient features, provides us with powerful content creation, publishing, and optimization tools.Next, I will give a detailed introduction on how to add and edit document content in the Anqi CMS backend, and effectively utilize its recommended attributes.In AnQi CMS, document content is the core of website information display.

2025-11-06

What input methods and delimiter specifications does document keyword management support?

As an expert in the operation of AnQiCMS, I am well aware of the importance of keyword management for website content optimization and search engine visibility.In AnQi CMS, the system provides users with a flexible and standardized keyword input method to ensure the structurization of content and the friendliness of search engines.Manage keywords in AnQi CMS, mainly supporting two core input methods to meet the operational needs of different scenarios.The first is **manual input**, which is the most direct and most commonly used method.Whether it is creating new articles, editing product information

2025-11-06

What rich content editing features does the AnqiCMS document editor support?

As an experienced security CMS website operator, I am well aware of the core position of content in website operation.The Anqi CMS is designed to meet the content publishing needs of various websites, its document editor integrates a variety of practical functions, aiming to provide operators with an efficient, flexible, and feature-rich creative environment.These features not only cover basic text processing, but also extend to the management of multimedia content, the improvement of structured data, and the support of cutting-edge editing modes, greatly enhancing the efficiency and expressiveness of content production.In the core link of content creation

2025-11-06