Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

The method of changing the name of data directory in DEDECMS website

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/02 Report--

This article is about how to change the name of the data directory on DEDECMS. The editor thought it was very practical, so I shared it with you as a reference. Let's follow the editor and have a look.

How does the DEDECMS website change the data directory name?

Now there is a security check in the background of both the latest version 5.7 of DEDECMS and the version of 5.7SP1. If the data directory uses the default name, then the security of the DEDE system will be greatly reduced. I'm sure you all see this tip: it is strongly recommended to move the data directory outside the Web root directory to see how to move.

But for virtual hosts, some virtual hosts are not allowed to move outside the web directory, so in order to minimize the possibility of website attacks, we can rename the data directory, which further reduces the possibility of attacks. The specific operations are as follows:

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

Define ('DEDEDATA', DEDEROOT.'/data'); change data to the name of the directory you want to change, such as asdfg, then change it to:

Define ('DEDEDATA', DEDEROOT.'/asdfg'); 2. Use FTP to rename the data directory to asdfg, which is the same as the file name changed in the first step.

3, in the background of the website, system-system basic parameters-performance options, "template cache directory:" change to: / asdfg/tplcache.

This is basically completed, but there are still some problems. Open the website directory and you will find that you have skipped to the installation file. Don't worry, modify the index.php file in the root directory of the website and comment out the first few lines of the file, as follows, that is, add / / in front of the code:

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. In the background update, there is still a problem, the site map with RSS, JS these updates have problems, then we just need to create a new data directory under the root directory of the site, and then create a new rss and js directories under the data directory, so that it will be OK, and then update to see if all are normal?

Note: the above-mentioned change directory is asdfg, where asdfg can be freely changed to the directory name you want.

Thank you for reading! On the DEDECMS website to change the data directory name method to share here, I hope the above content can be of some help to you, so that you can learn more knowledge. If you think the article is good, you can share it and let more people see it.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report