Linux VPS时间和时区修改方法

2012年08月5日

转自:https://www.kwx.gd/CentOSApp/Cent … he-system-time.html
此方法只针对XEN的VPS服务器,其他的没试过.
因为对Linux的Vi命令使用方法不懂,所以有部份操作我是在Kloxo面板里进行更改的.
步骤如下:
首先要登录Kloxo管理面板和putty远程工具
1:编辑/etc/sysctl.conf (Kloxo面板/默认主页/服务器/服务器主页/文件管理器 在这里找到这个路径下的这个文件,打开并转到编辑状态)
2:在该文件底部加入 xen.independent_wallclock = 1 按“SAV”按钮保存
3:在putty工具中运行 sysctl -p
4:依次执行以下命令

rm -rf /etc/localtime
ln -s /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
yum install -y ntp
ntpdate us.pool.ntp.org
date

 
即可替换默认时区,更新为上海时间。若执行“date”后时间恢复正常,则表示修改成功。
为了保证时间的准确性和或防止VPS和母机时间再一次同步,请设置开机时自动同步最新的时间。
5:编辑 /etc/rc.d/rc.local 文件 (Kloxo面板/默认主页/服务器/服务器主页/文件管理器 在这里找到这个路径下的这个文件,打开并转到编辑状态)
在文件尾添加 /sbin/ntpdate us.pool.ntp.org 按“SAV”按钮保存
6:运行 reboot 重启


sicnature ---------------------------------------------------------------------
Your current IP address is: 35.171.22.220
Your IP address location: 美国弗吉尼亚阿什本
Your IP address country and region: 美国 美国
Your current browser is:
Your current system is:
Original content, please indicate the source:
同福客栈论坛 | 蟒蛇科普海南乡情论坛 | JiaYu Blog
sicnature ---------------------------------------------------------------------
Welcome to reprint. Please indicate the source http://myzhenai.com.cn/post/731.html

没有评论

发表回复

您的电子邮箱地址不会被公开。 必填项已用*标注