What are the correct steps to 'save and exit' after modifying the 'config.' file in AnQiCMS, and do you need to restart the service?

Calendar 👁️ 59

As a professional who is deeply familiar with AnQiCMS operation, I know the importance of modifying the configuration file for system stability and function implementation. When you are dealing with AnQiCMS'sconfig.jsonWhen modifying files, the correct operation process and understanding of service restarts are crucial to ensure that changes take effect and to avoid potential issues.

In most cases, what we refer to isconfig.jsonThe file is located in the root directory of the AnQiCMS installation and is the core configuration file. This file carries the basic settings for the AnQiCMS application to run, such as the system port it listens on (such as the default port mentioned in the document).8001Port). These settings directly affect the network behavior and startup parameters of the application, and any modification to it requires a rigorous "save and exit" procedure.

config.jsonThe 'Save and Exit' step after file modification

While in progressconfig.jsonWhen modifying a file, the primary task is to locate the file. For most users, this file is located at the top level of your AnQiCMS installation directory. For example, if you are in/www/wwwroot/anqicmsThe AnQiCMS is installed in the directory, soconfig.jsonthe files should be in this path.

After finding the file, you need to open it with a text editor (such as Vim, Nano, Notepad++, VS Code, etc.).Under Linux server environments, command-line editors are usually used via SSH connections;In the local Windows testing environment, you can directly find and open with your favorite editor through the file manager.

In the editor, you can modify the corresponding configuration items according to your needs. For example, if you need to change the listening port of AnQiCMS, you can findportField and change its value to a new port number. After the modification is complete, be sure to perform the editor's 'Save' operation and write the changes to disk.Then, you can safely close the text editor and complete the "exit" process.

Do you need to restart the service?

Forconfig.jsonThe modification of the file, the answer is clear:The AnQiCMS service needs to be restarted for the configuration changes to take effect.

This is becauseconfig.jsonThe configuration items in the file are read and loaded when the AnQiCMS application starts.The application will not monitor the changes of this file in real time while running.Therefore, when you modify the port, database connection, or other core parameters, the running AnQiCMS instance will still follow the old configuration.Only by restarting the service, let AnQiCMS reloadconfig.jsonFile, the new configuration must be recognized and applied by the application.

The method of restarting the service will be different according to your AnQiCMS deployment method:

  • Manual deployment or command line deployment of a Linux server:You usually need to stop the currently running AnQiCMS process and then restart it. As mentioned in the document:start.shandstop.shThe script is designed for this purpose. You can execute./stop.shTo stop the service, then execute./start.shTo start the service
  • Baota panel/1Panel/aaPanel Docker deployment:If you have deployed AnQiCMS through the Docker feature of these panels, you usually need to enter the Docker management interface of the panel, find the corresponding AnQiCMS container, and then perform the 'restart' operation.
  • PanelGo project deployment:If running as a Go project on the Baota panel, you can find the AnQiCMS project under 'Website' -> 'Go Projects' on the Baota panel, and then click 'Stop', then 'Start', or directly click the 'Restart' button.
  • Windows Local Test:In Windows environment, since there is no resident service script, you need to find and end the process through Task Manageranqicms.exeand then double-clickanqicms.exeRestart the application with a file.

After restarting the service, you should visit your website or admin interface to verify that the new configuration has been successfully applied.For example, if you change the port, please try to access your AnQiCMS website through the new port.

In summary, concerning the AnQiCMS coreconfig.jsonAny modification to the file requires you to manually save the changes and completely restart the AnQiCMS application to ensure that these changes are correctly read and applied by the system.


Frequently Asked Questions (FAQ)

1. Modifyconfig.jsonWhat are the consequences of not restarting the service?

If you have modified the AnQiCMS coreconfig.jsonIf the service is not restarted after the file, then the configuration changes you have made will not take effect.The application will continue to run using the old configuration it loaded at startup.This could lead to the application not behaving as expected, such as not being able to access through the new port, or database connection failures and other issues, but it usually will not lead to data loss or system crashes.

2. Does AnQiCMS require a service restart for other configuration changes?

Yes, besidesconfig.jsonIn addition, many configuration changes involving the core functionality or global behavior of the application typically require restarting the AnQiCMS service to take effect.This includes but is not limited to: database connection information, file storage paths, certain security settings, or third-party service API keys, etc.In general, for any underlying configuration that cannot be directly modified and take effect immediately in the background management interface, it should be considered to restart the service after manually modifying its configuration file.And through the configuration changes made through the backend interface (such as website name, SEO settings, navigation, etc.), AnQiCMS usually performs real-time updates or automatically clears the cache, without the need to manually restart the service.

3. The template directory underconfig.jsonDo you also need to restart the AnQiCMS service after the modification?

The template directory underconfig.jsonFor example,/template/default/config.json) Mainly used to define template metadata (name, version, author, etc.) and enable status (template_type/status)。Modify this information usually does not require restarting the entire AnQiCMS application. AnQiCMS reads template files and theirconfig.jsonOr its configuration change can be refreshed through the "Update Cache" function in the background management interface. Therefore, for the templateconfig.jsonThe modification, usually only needs to be reselected in the AnQiCMS background template or execute the 'update cache' operation, no need to restart the AnQiCMS service.

Related articles

How to verify that the AnQiCMS service can automatically start after saving and exiting the `start.sh` script added to crontab?

The automatic startup verification method of AnQiCMS is crucial to ensure that core services can run stably and automatically in website operations.For AnQiCMS, configuring the `start.sh` script to the `crontab` is to automatically restore its running state after system startup or accidental service termination, ensuring the continuous availability of the website.Complete the configuration of the `start.sh` script and add it to `crontab`, and the detailed verification steps are crucial to ensure that this automation mechanism works as expected.

2025-11-06

If the "ws save and exit" mentioned in the AnQiCMS document is a typo for `wq`, what is the difference between `wq` and `x` in Vim for saving and exiting?

As an experienced security CMS operator in the field of content management for many years, I fully understand the importance of every detail to the efficiency of content work, whether it is the content creation itself or the technical operations behind it.When dealing with template files, optimizing content snippets, or configuring system scripts, we often deal with various command-line tools, and Vim editor is one of them.

2025-11-06

How to correctly execute 'Save and Exit' after modifying the scheduled task of AnQiCMS on a Linux server to ensure the task takes effect?

As an experienced CMS website operation personnel of an information security company, I am well aware of the importance of managing scheduled tasks on Linux servers for system stability and automated operation and maintenance.When you need to adjust the Anqin CMS schedule task, whether it is to schedule the application to start, execute the data backup script, or handle other custom automation processes, ensuring that the modified task takes effect correctly is crucial.This process usually involves the Linux system's `crontab` tool and the correct operation of its built-in editor.###

2025-11-06

What is the Vim/Vi operation referred to by "ws save and exit" in the `crontab -e` command?

## Parsing the "ws save and exit" operation in the `crontab -e` command When deploying and maintaining AnQi CMS, the `crontab -e` command is a common command used to edit system scheduled tasks to ensure the continuous operation of the website service and the automation of maintenance tasks.In the AnQiCMS deployment document, we noticed that when editing the `crontab` task, the prompt information appeared with the text "# ws save and exit".This may confuse some users who are new to or not familiar with Vim/Vi editors

2025-11-06

What is the complete procedure for saving and exiting the configuration and making the new port effective after modifying the `port` port of each site in the multi-site configuration?

As an experienced CMS website operation personnel of AnQi, I fully understand the importance of multi-site management for efficient operation.When you need to deploy multiple independent AnQiCMS instances on the same server and want each instance to listen on a different port, it indeed requires a clear operation process.Let's go through it in detail on how to modify the port for each AnQiCMS site and make it effective.### Understanding the differences between multi-site and multi-instance Before we begin, we need to clarify the two types of "multi-site" modes supported by AnQiCMS

2025-11-06

Does clicking 'Save' in the AnQiCMS backend after modifying system settings or content settings equivalent to 'Save and Exit' at the file level and take effect immediately?

As an experienced CMS website operation person in the security industry, I know that an accurate understanding of system behavior is crucial for efficient operation when performing operations in the background.About the issue you raised, "AnQiCMS" background modification of system settings or content settings, after clicking "Save", is it equivalent to "Save and Exit" at the file level and take effect immediately?This issue can be explored in detail from several aspects.In the daily operation of Anqi CMS, the "Save" button on the backend usually executes the operation of writing data to the database.Whether we updated the content of an article or adjusted the description of a category

2025-11-06

How does the 'save and exit' mechanism ensure service persistence after checking 'start on boot' in the 'Go project' on the Baota panel and configuring AnQiCMS?

As a website manager who deeply understands the operation of Anqi CMS, I understand your concerns about service persistence and website stability.In the "Go projectAnQiCMS as an enterprise-level content management system developed based on the Go language has laid a solid foundation for the stability of the service.

2025-11-06

How to replace the manual 'save and exit' with the container restart rules (such as 'restart on failure') when deploying AnQiCMS with Docker to ensure high availability?

As a professional who is well-versed in the operation of AnQiCMS, I understand the importance of the stable operation of a content management system, which directly relates to the efficiency of content publishing, user experience, and the overall business performance of the website.In modern website architecture, Docker has become a powerful tool for deploying AnQiCMS, and one of its core advantages is the container restart strategy, which not only replaces the繁琐 of traditional manual operations but also is the foundation for high availability.### From manual operation to intelligent restart: The innovation of operation and maintenance mode Before the popularity of Docker technology

2025-11-06