惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Attack and Defense Labs
Attack and Defense Labs
The GitHub Blog
The GitHub Blog
C
Check Point Blog
博客园_首页
MongoDB | Blog
MongoDB | Blog
N
Netflix TechBlog - Medium
F
Full Disclosure
Microsoft Security Blog
Microsoft Security Blog
爱范儿
爱范儿
Recent Announcements
Recent Announcements
阮一峰的网络日志
阮一峰的网络日志
G
GRAHAM CLULEY
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
T
Threat Research - Cisco Blogs
C
Cybersecurity and Infrastructure Security Agency CISA
V
Vulnerabilities – Threatpost
K
Kaspersky official blog
博客园 - 司徒正美
S
Schneier on Security
T
The Exploit Database - CXSecurity.com
Project Zero
Project Zero
云风的 BLOG
云风的 BLOG
Cisco Talos Blog
Cisco Talos Blog
Know Your Adversary
Know Your Adversary
雷峰网
雷峰网
V
V2EX - 技术
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
Spread Privacy
Spread Privacy
罗磊的独立博客
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
S
Security Affairs
SecWiki News
SecWiki News
Schneier on Security
Schneier on Security
O
OpenAI News
Jina AI
Jina AI
PCI Perspectives
PCI Perspectives
Cyberwarzone
Cyberwarzone
Y
Y Combinator Blog
Apple Machine Learning Research
Apple Machine Learning Research
B
Blog RSS Feed
I
InfoQ
D
Docker
P
Palo Alto Networks Blog
Recorded Future
Recorded Future
M
MIT News - Artificial intelligence
博客园 - Franky
B
Blog
Scott Helme
Scott Helme
博客园 - 叶小钗
D
DataBreaches.Net

博客园 - 沧海依粟

针对IE6,IE7,Firefox设置不同的CSS 关于笔记本的CPU和显卡 5460 PPM眼中合格的程序员,欢迎大家添加自己的看法 hi, Provence! Google的Picasa相册提供Blog嵌入功能 几个著名的Windows “伪”优化技巧 快来看看 WindowsVista中的新增命令 前几天在群里看到的很牛的关于Spring的一些介绍了...太牛8了... 香港回归十周年,纪念下. - 沧海依粟 呵呵,今天下了新版的Live Writer..插个地图玩下! - 沧海依粟 在IE中像迅雷那样通过右击链接打开程序 - 沧海依粟 第一贴:恭喜 - 沧海依粟 使用Firebug修改博客的样式(皮肤),并让Google Adsence美观的放在网页的顶端 - 沧海依粟 P2P的超简单例子,仅做纪念. - 沧海依粟 Outlook Express 后继有人啦!!Windows Live Mail Beta介绍. - 沧海依粟 域名DNS解析过程及原理 - 沧海依粟 世界上最乖的狗 - 沧海依粟 Vista下安装Adobe Reader 8.0(中文版)出错的解决办法 - 沧海依粟
Ubuntu Server 安装 WordPress MU 时遇到的问题总结
沧海依粟 · 2007-07-29 · via 博客园 - 沧海依粟

WordPressMU 安装时的问题:
  1. 发送邮件的问题.
     由于 WordPressMU 部置的服务一般不是邮件服务器, 所以需要通过外部 SMTP 服务器来发送邮件. WordPressMU 好像并不提供这样的功

能, 我们得先修改其代码, 要不然我们安装之前得先修改代码, 要不然我们将收不到管理员的密码.呵呵.
     这个问题的解决参考:http://blog.csdn.net/Redecor/archive/2007/06/07/1641553.aspx
     如果你觉得下面的东东比较麻烦,你可以点这里直接下载修改后的文章, 下载后解压至 /wp-includes/ 目录下, 记得要修改 mail-inc.php 文件中的邮件信息哦.
     1) 打开 /wp-includes/ 目录下的 class-phpmailer.php, 查找 class.smtp.php 将其替换成 class-smtp.php;

     2) 在 /wp-includes/ 新建 mail-inc.php 文件(这个文件主要是设置 SMTP 服务器的信息), 代码如下:
        <?php
          require("class-phpmailer.php");
 
          class MyMailer extends PHPMailer {
            // Set default variables for all new objects
            var $Mailer = "smtp"; // Alternative to IsSMTP()
            var $CharSet = "utf-8";
            var $From = "你的邮件地址";
            var $FromName = "name,你想起什么名字都可以";
            var $Host = "smtp服务器地址";
            var $Port = 25; //smtp server port
            var $SMTPAuth = true;
            var $Username = "你邮件的帐号";
            var $Password = "你邮件的密码";
            var $WordWrap = 75;
          }
       ?>

     3) 打开 /wp-includes/pluggable.php, 查找 function wp_mail($to, $subject, $message, $headers = '') { global $phpmailer;

在 global $phpmail; 其前面添加如下代码:
        require("mail-inc.php");  
        $mail = new MyMailer;
        $mail->AddAddress($to);
        $mail->Subject = $subject;
        $mail->Body = $message;  
     
        return $mail->Send();

     4) 继续在此文件中查找 wp_new_user_notification 函数, 把:
        wp_mail($user_email, sprintf(__('[%s] Your username and password'), get_settings('blogname')), $message);
        修改为:
        @wp_mail($user_email, sprintf(__('[%s] Your username and password'), get_settings('blogname')), $message);
        好像就是在前面加上一个@而已.

     5) 在文结尾(?>)前添加如下代码:
        if ( !function_exists('wp_mail_attachment') ) :
        function wp_mail_attachment($to, $subject, $message, $string, $filename, $encoding, $type) {
          require("mail.inc.php");
 
          $mail = new MyMailer;
          $mail->AddAddress($to);
          $mail->Subject = $subject;
          $mail->Body = $message;
          $mail->AddStringAttachment($string, $filename, $encoding, $type);
   
          return $mail->Send();
        }
        endif;

  2. 文章URL重定向的问题:
     修改 /etc/apache2/apache2.conf 文件, 让其加载 mod_rewrite 和 mod_deflate 模块.
     加载 mod_rewrite 模块, 在文件[底部]加入:
     LoadModule rewrite_module /usr/lib/apache2/modules/mod_rewrite.so
     加载 mod_deflate 模块, 在文件[底部]加入:
     LoadModule deflate_module /usr/lib/apache2/modules/mod_deflate.so
     除了加载模块以外,还需要修改虚拟主机的配置文件.
     默认的配置文件为:
     /etc/apache2/sites-available/default
     将文件中代表网站的节点,如放在 /var/www 的网站为:
     <Directory /var/www/>
        Options Indexes FollowSymLinks MultiViews
        AllowOverride All
        Order allow,deny
        allow from all
        # This directive allows us to have apache2's default start page
        # in /apache2-default/, but still have / go to the right place
        #RedirectMatch ^/$ /apache2-default/
     </Directory>
     将其 AllowOverride None 中的 None 改成 All
  3. 中文乱码的问题:
     1) 在 MySQL 创建数据库的时修, 用 CREATE DATABASE <数据库名> default character set utf8 collate utf8_general_ci; 创建.
     2) 修改 wp-includes/wp-db.php 文件.
        找到:
        $this->dbh = @mysql_connect($dbhost, $dbuser, $dbpassword);
        在下面加上:
        $this->query("SET NAMES 'utf8'" );

  • 安全快速不中毒的浏览器:
  • 写博客也能赚钱: