Linode VPS 使用記錄

最近從QuickWeb VPS搬到了Linode VPS,選的是日本線路,環境直接用了LNMP一鍵安裝。

讓lnmp能用mail()函數來發郵件
LNMP0.9默認安裝完,是不能用mail()函數來發郵件的,需手動安裝。

1
2
3
4
apt-get install sendmail
chkconfig sendmail
/etc/init.d/sendmail start
/root/lnmp restart

如果還是不行,可以試試修改php.ini,找到mail部分的設置,將下面這個參數設置下即可:

1
sendmail_path = /usr/sbin/sendmail -t -i

LNMP 0.9禁用了部分存在危險的PHP函數
如果引起DiscuzX 通信失敗或通過Socket連接SMTP無法發送郵件或wordpress Akismet 無法工作,則可以/usr/local/php/etc/php.ini 查找disable_functions,將這pfsockopen、fsockopen scandir 3個函數從禁用列表里刪除。

如果想完全刪掉禁用列表里的函數可以執行:

1
sed -i 's/disable_functions =.*/disable_functions =/g' /usr/local/php/etc/php.ini

然后執行

1
/etc/init.d/php-fpm restart

重啟后即可。
繼續閱讀

ThinkSAAS Nginx 的偽靜態(Rewrite)規則

ThinkSAAS是一個輕量級的開源社區系統,是一個可以用來搭建討論組,bbs和圈子的社區系統。

江陰人就是采用的ThinkSAAS程序。

把下面代碼存為thinksaas.conf,然后在域名配置文件(jyr.me.conf)中嵌入(include thinksaas.conf)就行了。

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
location /
{
    if (-f $request_filename/index.html)
    {
        rewrite (.*) $1/index.html break;
    }

    if (-f $request_filename/index.php)
    {
        rewrite (.*) $1/index.php;
    }

    if (!-f $request_filename)
    {
        rewrite (.*) /index.php;
    }
}