月度归档:2010年03月

把apache换成lighttpd了

NAS的硬件不是很强悍,跑apache2比较占用系统资源,决定还是换用lighttpd来做http服务。lighttpd比较轻量级,运行在NAS里面再合适不过了。

先卸载之前的安装:root@LINKSTATION:~# apt-get remove php5 apache2 mysql-server mysql-client php5-mysql php5-curl php5-gd apache2-mpm-prefork

然后安装lighttpd及其需要的组件:

root@LINKSTATION:~# apt-get install lighttpd php5-cgi php5-mysql mysql-server php5-gd

哦,对了 php5-gd是绘图库,最好安装,php图文操作时需要,否则可能会有验证码之类的可能无法显示的问题。

配置一下文件:/etc/php5/cgi/php.ini中,找到”cgi.fix_pathinfo=0″改为”cgi.fix_pathinfo=1″,同时记得把前面的注释去掉。

更改网站目录:server.document-root =”/home/hu/www/discuz7”

server.modules项增加一行,内容为:
"mod_fastcgi”


更改网站端口
:## bind to port (default: 80)
server.port               = 88
把/etc/lighttpd/conf-available/10-fastcgi.conf里面的内容全干掉,替换为下面内容:
server.modules += ( "mod_fastcgi" )

fastcgi.server = ( ".php" =>

( "localhost" =>

( "socket" => "/tmp/php5-fcgi.socket",

"bin-path" => "/usr/bin/php5-cgi" )))

OK,现在开启 fastCGI

root@LINKSTATION:~# lighty-enable-mod fastcgi
Available modules: auth cgi fastcgi proxy rrdtool simple-vhost ssi ssl status userdir
Already enabled modules:
Enabling fastcgi: ok
Run /etc/init.d/lighttpd force-reload to enable changes
重启服务器
/etc/init.d/lighttpd force-reload

搞定收工

点击查看原图

阳光灿烂的日子

偶然又看了一遍姜文的老电影。

影片的结尾,加长卡迪拉克转上建国门立交桥,长大了的混混们喝着人头马XO,儿时的傻子骑着棍子走过,傻子对他们的评价依旧是:傻逼。

日子是过出来的,时间是混过去的,人都一样,活着活着,就死了

Installing php+mysql+apache on LS2(Debian;MIPS)

周末折腾一下Linkstation~~~ 打算装个web服务器,弄个博客放上去跑跑,看看400MHZ的CPU,64MB RAM性能如何。

放狗搜了一下,N多论坛和博客都是基于php环境的,那偶就顺应潮流,安装php+mysql+apache吧。~~

OK,开工,安装Apache2/PHP/Mysql服务器:

apt-get install php5

apt-get install apache2

apt-get install mysql-server mysql-client

apt-get install php5-mysql php5-curl php5-gd

dpkg -l ‘php5-*’

aptitude install libapache2-mod-php5 php5-mysql

/etc/apache2/httdpd.conf 添加:

AddType application/x-httpd-php .php

AddType application/x-httpd-php-source .phps

ln -s /etc/apache2/mods-available/php5.* /etc/apache2//mods-enabled

apt-get install apache2-mpm-prefork

/etc/init.d/apache2 restart

点击查看原图

习惯用winscp来编辑文件了,vi的界面偶实在用不好 

嗯,现在环境已经搞定了,登陆webmin,选择mysql模块,添加一个新的数据库boblog。

点击查看原图

root@LINKSTATION:~# /etc/init.d/apache2 stop 停止apache2,默认的WEB程序是放在/var/www下面的,定义在/etc/apache2/sites-enabled/000-default中,我要改到/mnt/hda/www下面去,把DocumentRoot /var/www/改为 DocumentRoot /mnt/hda/www/,然后把网站上传到/mnt/hda/www/,重启apache2:root@LINKSTATION:~# /etc/init.d/apache2 start

在IE的地址栏输入
http://IP/install/install.php

回车,就进入整站安装界面:

点击查看原图


下面过程就简单了,根据提示next即可。
 


点击查看原图


吼吼,搞定了!
 


点击查看原图


看看CPU的占用情况,还好还好~~
 


点击查看原图


在LS1上编译安装transmission

之前曾经尝试用apt-get安装transmission,(


http://wifizoo.3322.org/post/109.asp

)安装完毕不能正常运行;尝试一下在optware下安装,可以正常运行,看来是软件版本问题,只有自己动手编译一个较高版本的在debian下运行了。

先下载编译需要的套件:LSPPC-Lenny:~$ apt-get install libcurl4-openssl-dev gettext libtool intltool openssl libcurl3

开始编译过程:LinkStation:~$ cd /usr/src
LSPPC-Lenny:~$ wget


http://mirrors.m0k.org/transmission/files/transmission-1.75.tar.bz2


LSPPC-Lenny:~$ tar -jxvf transmission-1.34.tar.bz2
LSPPC-Lenny:~$ cd transmission-1.75
LSPPC-Lenny:~$ ./configure
LSPPC-Lenny:~$ make
LSPPC-Lenny:~$ make install

漫长的等待之后,终于安装成功。

运行一下程序,让它先生成配置文件:LSPPC-Lenny:~# transmission-daemon -f
[17:39:32.715] RPC Server: Adding address to whitelist: 127.0.0.1
[17:39:32.727] RPC Server: Serving RPC and Web requests on port 9091
[17:39:32.729] RPC Server: Whitelist enabled
[17:39:32.731] Transmission 1.75 (9117) started
[17:39:32.837] DHT: Generating new id
[17:39:33.023] Port Forwarding (NAT-PMP): initnatpmp succeeded (0)
[17:39:33.024] Port Forwarding (NAT-PMP): sendpublicaddressrequest succeeded (2)
[17:39:35.085] Port Forwarding (UPnP): Found Internet Gateway Device "


http://192.168.2.1:1491/ctl/IPConn

"
[17:39:35.086] Port Forwarding (UPnP): Local Address is "192.168.2.118"
[17:39:35.101] Port Forwarding (UPnP): Port forwarding through "


http://192.168.2.1:1491/ctl/IPConn

", service "urn:schemas-upnp-org:service:WANIPConnection:1".  (local address: 192.168.2.118:51413)
[17:39:35.103] Port Forwarding (UPnP): Port forwarding successful!
[17:39:35.104] Port Forwarding: State changed from "Not forwarded" to "Forwarded

好了,等待一分钟左右,ctrl+c杀死进程,现在在默认的目录里面已经有config文件了。

点击查看原图

手工修改下配置文件:{
"alt-speed-down": 50,
"alt-speed-enabled": false,
"alt-speed-time-begin": 540,
"alt-speed-time-day": 127,
"alt-speed-time-enabled": false,
"alt-speed-time-end": 1020,
"alt-speed-up": 50,
"bind-address-ipv4": "0.0.0.0",
"bind-address-ipv6": "::",
"blocklist-enabled": false,
"dht-enabled": true,
"download-dir": "\/mnt\/downloads", (下载的目录)
"encryption": 1,
"lazy-bitfield-enabled": true,
"message-level": 2,
"open-file-limit": 32,
"peer-limit-global": 240,
"peer-limit-per-torrent": 60,
"peer-port": 51413, (端口配置,自己改,别和其他程序冲突就成)
"peer-port-random-high": 65535,
"peer-port-random-low": 49152,
"peer-port-random-on-start": false,
"peer-socket-tos": 0,
"pex-enabled": true,
"port-forwarding-enabled": true,
"preallocation": 1,
"proxy": "",
"proxy-auth-enabled": false,
"proxy-auth-password": "",
"proxy-auth-username": "",
"proxy-enabled": false,
"proxy-port": 80,
"proxy-type": 0,
"ratio-limit": 2.0000, (分享率限制)
"ratio-limit-enabled": false,
"rpc-authentication-required": false, (开启密码管理)
"rpc-bind-address": "0.0.0.0",
"rpc-enabled": true,
"rpc-password": "{4d34f26f2e604efff77afa7daa6ba749a5a62026CVC3a94C",
"rpc-port": 9091, (端口)
"rpc-username": "", (用户名)
"rpc-whitelist": "*.*.*.*", (管理主机的IP地址白名单限制)
"rpc-whitelist-enabled": true,
"speed-limit-down": 100,
"speed-limit-down-enabled": false,
"speed-limit-up": 100,
"speed-limit-up-enabled": false,
"umask": 18,
"upload-slots-per-torrent": 14
}
搞定运行,限速100KB/S,跑PT满速。  

点击查看原图

没项目奖了,哎

新年新气象,公司新规定,以后做项目一律没有项目奖。

悲哀,做技术本来就不易,天天公司和家两点一线,没加班费,社交圈子单一,捞外快的机会更是没有,现在又取消项目奖,这日子不好混啊。

悲剧,PSP升级到6.20了

PSP借给朋友玩,那哥们居然稀里糊涂把PSP升级到最新版了!

发现PSP被升级到6.20了,我第一反应是想冲上去揍他!悲剧啊,这下只能玩正版游戏,想玩ISO的游戏只能等国外破解小组的进度了。

PSP2000,V3的板子,放上神电power灯亮,屏幕无显示,无法强行降级。除非拆机吹下flash上编程器才能恢复到低版本,哭死,只好暂时先当个MP4使。