As an experienced website operation expert, I am willing to give you a detailed explanation of how to perform the correct shutdown and restart operations after configuration changes (especially port changes) in AnQiCMS.This is not only the key link in daily maintenance, but also the foundation to ensure the stable and efficient operation of the website.


The robust restart path after AnQiCMS configuration change

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 requirements.After modifying the configuration of AnQiCMS, especially parameters such as port, the system will not immediately recognize these changes and apply them automatically.At this time, a standardized and thorough shutdown and restart process is essential for the new configuration to take effect.

To understand this process, we first need to clarify how AnQiCMS obtains its runtime configuration. In the deployment directory of AnQiCMS, there is usually a file namedconfig.jsonThe core configuration file, which carries many system-level parameters including the port number. When we change theconfig.jsonofportparameters (such as from the default 8001is modified to8002After that, the AnQiCMS service process must be completely terminated before it can be restarted with the 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 graceful exit of old processes

Stop the AnQiCMS service is the first step in the restart process and is also a crucial step.A "clean" stop operation can avoid potential problems such as data corruption, resource occupation conflicts, and so on.According to the AnQiCMS deployment environment, the shutdown method will be different:

1. On Linux server (via startup script or manual operation):

In many Linux deployment environments, to facilitate the management of AnQiCMS, we usually set up a set ofstart.shandstop.shscripts, andcrontabschedule tasks to monitor and manage the start and stop of services.

  • Usestop.shScript stopped:If your AnQiCMS is deployed in the recommended way and configuredstop.shScript, then just execute the script in the AnQiCMS installation directory.This script usually searches for the PID (Process ID) of the running AnQiCMS process and then sends a termination signal to stop it.
    
    ./stop.sh
    
  • Manually search and terminate the process:If notstop.shScript, or the script failed to stop the process successfully (for example, due to a zombie process), you can manually locate and terminate it.
    1. Uselsof -i:{端口号}Command to find the process occupying a specified port. For example, if the old port is 8001, you would enter:
      
      lsof -i:8001
      
      This command will display the process information occupying port 8001, including its PID.
    2. After obtaining the PID, usekill -9 {PID}Command to force the termination of the process. For example, if the found PID is 12345:
      
      kill -9 12345
      
      This ensures that the AnQiCMS service occupying the old port is completely closed.

2. On Windows system (for testing or local development):

For users testing or developing locally on Windows, AnQiCMS is usually run as an executable file (anqicms.exe). The method to stop it is relatively simple:

  • Use Task Manager:Open Windows Task Manager (you can use the Ctrl+Shift+Esc shortcut), switch to the "Processes" or "Details" tab. Find the process namedanqicms.exeProcess, select it, and then click the "End Task" button. This will force close the AnQiCMS service.

3. In Baota, 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 for managing Docker containers or Go projects.

  • Operate through the panel UI: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

After successfully stopping the old service, we can start AnQiCMS and let it load and apply the new configuration.

1. On Linux server (via startup script or manual operation):

  • Usestart.shScript start:Similarly, if your deployment environment is configuredstart.shScript, run it in the AnQiCMS installation directory. This script will usually check if the AnQiCMS process is running, and if not, it will usenohupThe command 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 namedanqicmsan executable file. To run it in the background and log the output, you can usenohupCommand:
    
    nohup ./anqicms >> running.log 2>&1 &
    
    make sure you have updated theconfig.jsonport parameters to the new value.

2. On Windows system:

  • Double-click the executable file:In the Windows environment, simply double-click the AnQiCMS installation directory under:anqicms.exeFile. The program will start in the background and loadconfig.jsonThe latest configuration in.

3. In Baota, 1Panel, aaPanel and other panel environments:

  • Operate through the panel UI:In the corresponding panel management interface, find the AnQiCMS deployment item, click the "Start" button or similar function.The panel will restart the AnQiCMS service according to the configuration, at which point it will read the new configuration (including the port you have changed).

Verify that the new configuration is effective

After the service starts, be sure to perform verification to ensure that the new configuration (such as the port) has been successfully applied:

  1. Access the new URL:In the browser, try to access your AnQiCMS website using a new port