西米巷 發表於 2023-10-24 00:00:00

浅析织梦(dedecms)三个最重要的安全设置

<p>
        <strong style='font-family: tahoma, arial, "Microsoft YaHei"; font-size: 14px;'><font color="#ff0000">1、 改变织梦data目录位置。 </font><br>
        data目录用于存放织梦系统一些重要的配置文件与数据,应该予以重点保护。具体操作步骤为: </strong><br><br><span style='font-family: tahoma, arial, "Microsoft YaHei"; font-size: 14px;'>1) 新建一目录用于存放data目录,如mydataabc,将DATA目录移动到该目录下。这样data的完整目录变成/mydataabc/data </span><br style='font-family: tahoma, arial, "Microsoft YaHei"; font-size: 14px;'><br style='font-family: tahoma, arial, "Microsoft YaHei"; font-size: 14px;'><span style='font-family: tahoma, arial, "Microsoft YaHei"; font-size: 14px;'>2) 修改配置文件include/common.inc.php,找到语句define('DEDEDATA', DEDEROOT.'/data'); 修改为 define('DEDEDATA', DEDEROOT.'/mydataabc/data'); </span><br style='font-family: tahoma, arial, "Microsoft YaHei"; font-size: 14px;'><br style='font-family: tahoma, arial, "Microsoft YaHei"; font-size: 14px;'><span style='font-family: tahoma, arial, "Microsoft YaHei"; font-size: 14px;'>3) 调整验证码<u>图片</u>位置:修改文件/include/vdimgck.php(红色部分是修改过的代码) </span><br style='font-family: tahoma, arial, "Microsoft YaHei"; font-size: 14px;'><br style='font-family: tahoma, arial, "Microsoft YaHei"; font-size: 14px;'><strong style='font-family: tahoma, arial, "Microsoft YaHei"; font-size: 14px;'><font color="#ff0000">将相关代码修改为 </font></strong></p>
<div class="msgheader" style='margin: 3px auto 0px; padding: 0px 3px; outline: none; line-height: 21.6px; clear: both; border-width: 1px; border-style: solid; border-color: rgb(0, 153, 204); background: rgb(246, 251, 255); overflow: hidden; font-family: tahoma, arial, "Microsoft YaHei";'>
        <p class="right">
                <span><u>复制代码</u></span></p>
        <p>
                代码如下:</p>
</div>
<p class="msgborder" style='margin: 0px auto 3px; padding: 0px 3px; outline: none; line-height: 25.2px; font-size: 14px; clear: both; border-right: 1px solid rgb(0, 153, 204); background: rgb(221, 237, 251); overflow: hidden; border-left: 1px solid rgb(0, 153, 204); word-break: break-all; border-bottom: 1px solid rgb(0, 153, 204); word-wrap: break-word; font-family: tahoma, arial, "Microsoft YaHei";'>
        <br>
        require_once (dirname(__FILE__).'/../mydataabc/data/safe/inc_safe_config.php'); <br>
        require_once (dirname(__FILE__).'/../mydataabc/data/config.cache.inc.php'); <br>
        $config = array( <br>
        'font_size' =&gt; 14, <br>
        'img_height' =&gt; $safe_wheight, <br>
        'word_type' =&gt; (int)$safe_codetype, // 1:数字 2:英文 3:单词 <br>
        'img_width' =&gt; $safe_wwidth, <br>
        'use_boder' =&gt; TRUE, <br>
        'font_file' =&gt; dirname(__FILE__).'/data/fonts/ggbi.ttf', <br>
        'wordlist_file' =&gt; dirname(__FILE__).'/data/words/words.txt', <br>
        'filter_type' =&gt; 5); <br>
        $sessSavePath = dirname(__FILE__)."/../mydataabc/data/sessions/"; </p>
<p>
        <br style='font-family: tahoma, arial, "Microsoft YaHei"; font-size: 14px;'><strong style='font-family: tahoma, arial, "Microsoft YaHei"; font-size: 14px;'><font color="#ff0000">2、 删除不必要的系统文件: </font></strong><br><span style='font-family: tahoma, arial, "Microsoft YaHei"; font-size: 14px;'>在Plus目录下,织梦系统提供了很多可以使用的系统程序。这些系统文件可以进行适当简化。 </span><br style='font-family: tahoma, arial, "Microsoft YaHei"; font-size: 14px;'><br style='font-family: tahoma, arial, "Microsoft YaHei"; font-size: 14px;'><span style='font-family: tahoma, arial, "Microsoft YaHei"; font-size: 14px;'>例如,我的网站建设中,只保留了这样几个文件,mytag_js.php ad_js.php(广告显示)、count.php(文章访问次数统计)、search.php(文章搜索)、feedback.php feedback_ajax.php feedback_js.php(评论用)、list.php(频道动态页),而plus目录中的其他php文件全部删除。 </span><br style='font-family: tahoma, arial, "Microsoft YaHei"; font-size: 14px;'><br style='font-family: tahoma, arial, "Microsoft YaHei"; font-size: 14px;'><span style='font-family: tahoma, arial, "Microsoft YaHei"; font-size: 14px;'>在dede目录下,可以删除用于后台文件管理的几个文件:file_manage_control.php、 file_manage_main.php、file_manage_view.php、media_add.php、media_edit.php、 media_main.php。 </span><br style='font-family: tahoma, arial, "Microsoft YaHei"; font-size: 14px;'><br style='font-family: tahoma, arial, "Microsoft YaHei"; font-size: 14px;'><span style='font-family: tahoma, arial, "Microsoft YaHei"; font-size: 14px;'>不需要会员系统的网站,可以删除member文件夹。 </span><br style='font-family: tahoma, arial, "Microsoft YaHei"; font-size: 14px;'><span style='font-family: tahoma, arial, "Microsoft YaHei"; font-size: 14px;'>不需要专题的网站,可以删除special文件夹。 </span><br style='font-family: tahoma, arial, "Microsoft YaHei"; font-size: 14px;'><br style='font-family: tahoma, arial, "Microsoft YaHei"; font-size: 14px;'><strong style='font-family: tahoma, arial, "Microsoft YaHei"; font-size: 14px;'><font color="#ff0000">3、 合理设置敏感目录权限 </font></strong><br><span style='font-family: tahoma, arial, "Microsoft YaHei"; font-size: 14px;'>禁止data与upload目录的执行权限:即在ftp里右击目录,选择属性,将权限设置为666。 </span><br style='font-family: tahoma, arial, "Microsoft YaHei"; font-size: 14px;'><span style='font-family: tahoma, arial, "Microsoft YaHei"; font-size: 14px;'>以上织梦设置对织梦系统的安全相当重要,而很多站长朋友对这些操作则不够熟悉。希望本文能对广大站长朋友的织梦网站安全有所帮助! </span></p>
頁: [1]
查看完整版本: 浅析织梦(dedecms)三个最重要的安全设置