Home  >  Article  >  Backend Development  >  Detailed explanation of the steps for modifying the data directory name of DEDECMS website security guide

Detailed explanation of the steps for modifying the data directory name of DEDECMS website security guide

黄舟
黄舟Original
2017-04-01 10:06:112047browse

This article mainly introduces the Dreamweaver DEDECMS websiteSecurity Strategy and steps for modifying the name of the data directory. There are many loopholes in dedecms. It is relatively safer to modify the name of the default data directory. Some friends in need can refer to it Recently, dedecms vulnerabilities have appeared frequently, and DreamWeaver officials have also provided many corresponding measures. What I will tell you today is that dedecms officially recommends users to modify the data file name. For Virtual Host, some virtual host restrictions do not allow moving outside the web directory. In order to minimize the possibility of the website being attacked, we can rename the data directory, which further reduces attacks. possible.

1. Modify the common.inc.php file in the include directory. Open the file and find line 16:

The code is as follows:

define('DEDEDATA', DEDEROOT.'/data');

Change data to the directory name you want to change, for example: to 22badata, then change it to:

The code is as follows:

define('DEDEDATA', DEDEROOT.'/22badata');

2. Use FTP to rename the data directory to 22badata, which is the same as the file name changed in the first step.

3. In the background of the website, go to System-Basic System Parameters-Performance Options, and change "Template Cache Directory:" to: /22badata/tplcache.

The change is basically completed, but there are still some problems. Open the website directory and you will find that you have jumped to the Installation file. Don’t worry, modify the index.php file in the root directory of the website, remove the first few lines of the file comment , and comment as follows, that is, add // in front of the code, the code is as follows:

The code is as follows:

//
if
(!
file_exists
(
dirname
(FILE).'/data/common.inc.php'))
//{
// header('Location:install/index.php');
// exit();
//}

In this way, your website can be opened normally. When updating in the background, there are still problems. There are problems with the website map, RSS, and JS. Then we only You need to create a new data directory in the root directory of the website, and then create two new rss and js directories under the data directory. That's it. Update it again and see if everything is normal?

dedecms template download address: www.php.cn/xiazai/code/dedecms

Note: The change directory mentioned above is 22badata, and 22badata can be freely replaced with the directory you want. name.


The above is the detailed content of Detailed explanation of the steps for modifying the data directory name of DEDECMS website security guide. 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