作者:reistlin
发布时间:September 30, 2011
分类:随写随意

作者:
卡尔·保罗·雷茵霍尔德·尼布尔(英语:Karl Paul Reinhold Niebuhr,1892年6月21日-1971年6月1日),是一位美国神学家。他最出名的工作是试图将基督信仰和现代政治外交联系起来。他为现代“正义战争”思想做了很大贡献。著有《道德的人与不道德的社会》、《人的本性与命运》等。(来源:维基百科)

中文版(片段):
愿上帝赐予我平静,能接纳我无法改变的事;
愿上帝赐予我勇气,能改变我可以改变的事;
并赐予我智慧,让我能分辨这两者的不同。
英文(原文):
The Serenity Prayer
Reinhold Niebuhr
God grant me the serenity
to accept the things I cannot change;
courage to change the things I can;
and wisdom to know the difference.
Living one day at a time;
Enjoying one moment at a time;
Accepting hardships as the pathway to peace;
Taking, as He did, this sinful world
as it is, not as I would have it;
Trusting that He will make all things right
if I surrender to His Will;
That I may be reasonably happy in this life
and supremely happy with Him
Forever in the next.
Amen.
作者:reistlin
发布时间:September 30, 2011
分类:随写随意
哭李商隐(其二)
作者:崔珏
字梦之,祁州人。晚唐诗人。《全唐诗》有对他的介绍:“尝寄家荆州,登大中进士第,由幕府拜秘书郎,为淇县令,有惠政,官至侍御。诗一卷。” 与李商隐交谊甚厚,故有人称其诗“分有义山余艳”。
虚负凌云万丈才,一生襟抱未曾开。
鸟啼花落人何在,竹死桐枯凤不来。
良马足因无主踠,旧交心为绝弦哀。
九泉莫叹三光隔,又送文星入夜台。
作者:reistlin
发布时间:September 27, 2011
分类:原创文章
作者: reistlin
来源: http://www.reistlin.com/blog/362
更新时间: 2011.09
版权声明: 原创文章.转载请保留作者信息和原文完整.谢绝任何方式的摘要

一,环境:
Red Hat Enterprise Linux 5.4 x64
Nginx 0.8.55 (nginx-0.8.55.tar.gz)
PHP 5.2.17 (php-5.2.17.tar.gz)
PHP-FPM 5.2.17 (php-5.2.17-fpm-0.5.14.diff.gz)
APC 3.1.9 (APC-3.1.9.tgz)
用户信息:
用户:www-data
组:www-data
主目录:/home/www-data
目录结构:
app:应用程序安装目录
pkgs:源代码包目录
pkgs/build:源代码包编译目录
二,安装:
1,下载,解压缩
cd /home/www-data/pkgs/
wget http://pecl.php.net/get/APC-3.1.9.tgz
tar zxvf APC-3.1.9.tgz -C build
2,编译,安装
编译参数:
--enable-apc
--enable-apc-mmap
PHP 安装路径:
/home/www-data/app/php-5.2.17/
php-config 文件路径:
/home/www-data/app/php-5.2.17/bin/php-config
注意:需要在编译安装目录执行:phpize 脚本
cd /home/www-data/pkgs/build/APC-3.1.9
/home/www-data/app/php-5.2.17/bin/phpize
./configure \
--enable-apc \
--enable-apc-mmap \
--with-php-config=/home/www-data/app/php-5.2.17/bin/php-config \
make
make install
三,配置:
1,配置 APC 目录结构,新建 Symbolic Link 标准化调用方法
cd /home/www-data/app/php-5.2.17/lib/php/extensions
mv no-debug-non-zts-20060613 PECL
ln -s PECL/apc.so .
2,编辑 php.ini 文件,配置 extension_dir 目录
vim /home/www-data/app/php-5.2.17/etc/php.ini
; Directory in which the loadable extensions (modules) reside.
extension_dir = "/home/www-data/app/php-5.2.17/lib/php/extensions"
3,配置 APC PHP Extensions 参数
[apc]
extension = "apc.so"
apc.enabled = 1
apc.cache_by_default = On
apc.shm_segments = 1
apc.shm_size = 64M
apc.ttl = 3600
apc.user_ttl = 3600
apc.num_files_hint = 0
apc.write_lock = On
4,重新启动 php-fpm
/home/www-data/app/php-5.2.17/sbin/php-fpm restart

四,补充信息:
关于 [PECL]
关于 [APC] (Alternative PHP Cache)
作者:reistlin
发布时间:September 7, 2011
分类:自由点击

Apache,Nginx 非 root 用户下启动 HTTP 80 端口(端口范围小于1024)
方法一:
所有用户都可以运行(因为是755权限,文件所有者:root,组所有者:root)
chown root:root nginx
chmod 755 nginx
chmod u+s nginx
方法二:
仅 root 用户和 reistlin 用户可以运行(因为是750权限,文件所有者:root,组所有者:reistlin)
chown root:reistlin nginx
chmod 750 nginx
chmod u+s nginx