分类 LINUX 下的文章

第一步:vim ~/.profile TZ='Asia/Shanghai'; export TZ
第二步:rm /etc/localtime cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
第三步:apt-get install -y ntp 一般情况下/etc/ntp.conf里面包含如下内容:
server 0.debian.pool.ntp.org iburst dynamic
server 1.debian.pool.ntp.org iburst dynamic
server 2.debian.pool.ntp.org iburst dynamic
server 3.debian.pool.ntp.org iburst dynamic
然后查看时间去吧,如果还和本地时间差8个钟头,就重启系统。
over。

一直用的0.7.x的版本,今天升级到最新版1.0.14,记录如下

首先下载二进制文件 wget http://nginx.org/download/nginx-1.0.14.tar.gz

解压 tar -zxvf nginx-1.0.14.tar.gz 同目录下产生同名文件夹

cd nginx-1.0.14.tar.gz

察看原来的配置 /usr/local/nginx/sbin/nginx -V 注意是大写的V

nginx version: nginx/0.7.6.x

built by gcc 4.1.2 20080704 (Red Hat 4.1.2-48)

TLS SNI support disabled

configure arguments: --prefix=/usr/local/nginx --with-http_ssl_module --with-http_stub_status_module 这里省去两个参数

拷贝你的红色字体的安装配置参数

安装配置:# ./configure --prefix=/usr/local/nginx --with-http_ssl_module --with-http_stub_status_module

中途提示缺少pcre配置,图省事,直接yum安装

yum -y install pcre-devel

yum -y install pcre-devel openssl openssl-devel

然后make但是不要make install

编译完,在objs目录下有一个nginx执行文件,备份下原来老的nginx文件:

mv /usr/local/nginx/sbin/nginx /usr/local/nginx/sbin/nginx.old

复制新文件

cp objs/nginx /usr/local/nginx/sbin/nginx

检测一下是否正常读取配置文件

/usr/local/nginx/sbin/nginx -t

nginx: the configuration file /usr/local/nginx/conf/nginx.conf syntax is ok

nginx: configuration file /usr/local/nginx/conf/nginx.conf test is successful

显示没有问题。

执行命令完成升级: make upgrade 会有如下输出

nginx: the configuration file /usr/local/nginx/conf/nginx.conf syntax is ok

nginx: configuration file /usr/local/nginx/conf/nginx.conf test is successful

kill -USR2 cat /usr/local/nginx/logs/nginx.pid

sleep 1

test -f /usr/local/nginx/logs/nginx.pid.oldbin

kill -QUIT cat /usr/local/nginx/logs/nginx.pid.oldbin

检查版本是否已经更新:/usr/local/nginx/sbin/nginx -V

nginx version: nginx/1.0.14

TLS SNI support disabled

还有一行是你的编译参数

至此,升级完成.

这里的MDS是指“黑莓断续膏”所需的MDS服务器。

先说明情况,自己是1036混刷的900的中文语言包,1036对于我的机器来说有个好处,就是再也不随便重启了,但是经常断网

于是有了软件“黑莓断续膏”,并且提供了客户端和服务端的所有源代码(java)【RAiN】,紧接着再有了linux下C语言的源代码【zengbo】

看在BB一点断几次网的情况下,一个稳定的MDS服务器是非常重要滴,于是翻了“感触黑莓”里面的几个帖子,将我的VPS后台

开设了一个MDS常驻服务,以下代码及步骤都是整理以及记录,源码及知识产权归原作者!

//////////////////

1:首先下载MDS源代码(下载),解压后里面有3个文件:mds.c,mds,Makefile 。其中mds是一个linux下的命令文件,是由mds.c经由gcc编译而来的

编译命令在Makefile里面:gcc -o mds mds.c

我是放在/data/mds 目录下面

2:vim 编辑 开机启动脚本文件 vim /etc/rc.d/rc.local,加入以下命令:/data/mds/mds 19781 >/dev/null 2>&1 & 其中19781是端口号

可自定义其他数字,然后esc ,shift+wq保存退出,这样vps再重启也会自动开始服务了

3:开启mds服务,执行以下命令:/data/mds/mds 19781 >/dev/null 2>&1 & ,收工!

最后,如果你安装了黑莓断续膏,MDS服务器就可以填写VPS的IP啦,如果有防火墙规则,则可能需要执行以下命令

iptables -A INPUT -p udp --dport 19781 -j ACCEPT

刚 转 完 ubuntu10.0.4升级完 之后 ,系统有两个linux内核,删除起中 一个

dpkg --get-selections|grep linux 此命 令列出 所 有 在 用 的 内 核文件

然 后 sudo apt-get remove linux 2.6.32-21-generic

如果同一电脑装了两个系统,进到不同的系统,会发现时间错乱。可以择一方法解决: 修改 Windows 去使用时区,或是修改 ubuntu 不使用格林威治标准时间 UTC。

修改 Windows 使用时区方法如下:
HKEY_LOCAL_MACHINESYSTEMCurrentControlSetControlTimeZoneInformation 中加一项类型为 REG_DWORD 的机码,名称为 RealTimeIsUniversal,值设为 1。

修改 ubuntu 不使用格林威治标准时间 UTC (启用本地时间) 方法如下:
修改 /etc/default/rcS 原来的设定 UTC=yes 为 UTC=no。