As an experienced website operation expert, I am more than happy to provide a detailed explanation of how to perform the correct stop and restart operations after configuration changes (especially port changes) for AnQiCMS.This is not only a key link in daily maintenance, but also the foundation for ensuring the stable and efficient operation of the website.
The robust restart path after AnQiCMS configuration change in English
When using AnQiCMS for website operation and management, we often encounter scenarios where we need to adjust the system settings, such as modifying the running port of AnQiCMS for security considerations or multi-site deployment needs.When we modify the configuration of AnQiCMS, especially core parameters like port, the system will not immediately perceive these changes and apply them automatically.At this moment, a standard and thorough shutdown and restart process is indispensable for the new configuration to take effect.
To understand this process, we first need to clarify how AnQiCMS obtains its runtime configuration. In the AnQiCMS deployment directory, there is usually a file namedconfig.jsonthe core configuration file, it carries a variety of system-level parameters including the port number. When we change theconfig.jsonofportparameter (for example, from the default8001Change to8002After that, the AnQiCMS service process must be completely terminated before it can be restarted in a way that loads new configuration.If the old service process cannot be stopped correctly, the new configuration will not take effect, and it may even cause the new service to fail to start due to port conflicts.
Stop AnQiCMS service: Ensure the graceful exit of old processes
Stopping the AnQiCMS service is the first step in the restart process and a crucial step.An “clean” stop operation can avoid potential problems such as data corruption, resource contention, and so on.
1. On Linux servers (via startup script or manual operation):
In many Linux deployment environments, for the convenience of managing AnQiCMS, we usually set up a set ofstart.shandstop.shscripts, andcrontabschedule tasks to monitor and manage the start and stop of services.
- Use
stop.shScript stopped:If your AnQiCMS is deployed in the recommended way and configuredstop.shScript, then you just need to run the script in the installation directory of AnQiCMS.This script will usually look for the PID (Process ID) of the running AnQiCMS process and then send a termination signal to stop it../stop.sh - Manually find and terminate the process:If not
stop.shScript, or the script failed to stop the process successfully (for example, because the process is a zombie), you can manually locate and terminate it.- Use
lsof -i:{端口号}Command to find the process occupying the specified port. For example, if the old port is 8001, you will enter:
The command will display information about the process using port 8001, including its PID.lsof -i:8001 - After obtaining the PID, use
kill -9 {PID}Command forces the termination of the process. For example, if the found PID is 12345:
This ensures that the AnQiCMS service originally occupying the old port is completely closed.kill -9 12345
- Use
2. In Windows system (for testing or local development):
For users who test or develop locally on Windows, AnQiCMS is usually run as an executable file (anqicms.exe). The method to stop it is relatively simple:
- Use the Task Manager:Open Windows Task Manager (you can use the Ctrl+Shift+Esc shortcut key), switch to the "Processes" or "Details" tab. Find the process named
anqicms.exeThe process, select it, and then click the 'End Task' button. This will force close the AnQiCMS service.
3. In T塔、1Panel、aaPanel and other panel environments:
If you have deployed AnQiCMS in visual management tools such as Baota panel, 1Panel, or aaPanel, these panels usually provide an intuitive interface to manage Docker containers or Go projects.
- Through panel UI operation:Enter the corresponding panel management interface, find your AnQiCMS deployment item (which may be a Docker container, Go project, or other general project), and there will be a clear "stop" button or similar operation on the panel.Click to stop the service, the panel will automatically handle the termination of the underlying processes.
Start AnQiCMS service: load new configuration and resume operation
Successfully stopped the old service, then we can start AnQiCMS and let it load and apply the new configuration.
1. On Linux servers (via startup script or manual operation):
- Use
start.shScript start:Similarly, if your deployment environment is configuredstart.shScript, execute it in the AnQiCMS installation directory. This script will usually check if the AnQiCMS process is running, and if not, it will usenohupCommand starts the AnQiCMS main program in the background and redirects the output to the log file../start.sh - Manual start:If you choose to start manually, you can directly execute the main program of AnQiCMS, which is usually named
anqicms. The executable file. To keep it running in the background and logging, you can usenohupCommand:
Make sure you have already setnohup ./anqicms >> running.log 2>&1 &config.jsonto update the port parameter to the new value.
2. In Windows system:
- Double-click the executable file:In the Windows environment, just double-click the AnQiCMS installation directory:
anqicms.exeFile. The program will start in the background and loadconfig.jsonThe latest configuration in.
3. In T塔、1Panel、aaPanel and other panel environments:
- Through panel UI operation:In the corresponding panel management interface, find the AnQiCMS deployment item, click the "Start" button or similar function.Panel will restart the AnQiCMS service according to the configuration at this time, it will read the new configuration (including the port you have modified).
Verify if the new configuration takes effect.
The service must be verified after startup to ensure that the new configuration (such as the port) has been successfully applied:
- Access the new URL:In the browser, try to access your AnQiCMS website using a new port