Home  >  Article  >  CMS Tutorial  >  How to migrate the system's data directory to a directory other than web in dedecms

How to migrate the system's data directory to a directory other than web in dedecms

藏色散人
藏色散人Original
2019-12-09 10:00:382171browse

How to migrate the system's data directory to a directory other than web in dedecms

How to migrate the system's data directory to a directory other than web in dedecms?

The data directory is the directory for the system cache and configuration files. It generally has read and write permissions. As long as the directory can be written, there may be security risks. Many webmasters even allow this directory to be accessible. Execute permissions are even more dangerous, so we recommend moving this data directory out of the Web-accessible directory. This article will introduce how to move the data directory out of the web access directory.

Recommended learning: 梦Weavercms

This operation requires the user to have a high understanding of the DedeCMS system. If you feel that you are not very familiar with it, you can consider choosing the official security Related Services.

1. Transfer the data directory to a non-Web directory

Our example here is "D:\dedecms\v57" as the root directory of our system. We need to move the data folder under the directory ( As shown in Figure 1) The migration requires the upper-level directory (non-Web directory). You can simply cut or copy it directly.

How to migrate the systems data directory to a directory other than web in dedecms

We move to the upper level directory and pay attention to the file path.

How to migrate the systems data directory to a directory other than web in dedecms

2. Modify the configuration constants of the DEDEDATA directory

Find the /include/common.inc.php file in the system directory and modify it The DEDEDATA constant is your system directory.

How to migrate the systems data directory to a directory other than web in dedecms

3. Configure the tplcache cache file directory

Enter the system background and modify the tplcache directory in the configuration to the directory you want. (System> Basic System Parameters> Performance Options> Template Cache Directory)

How to migrate the systems data directory to a directory other than web in dedecms

##Okay, so we can successfully migrate the data directory out .

This operation is currently only valid for testing in the V57 system. Other versions of the system may need to be adjusted.

If the virtual host you purchased has general permissions set, make sure that the directory where the data is located has read and write permissions (the same permissions as the web directory).

Test passed.

The above is the detailed content of How to migrate the system's data directory to a directory other than web in dedecms. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn