User-Profile-Image
hankin
  • 5
  • 首页
  • 分类
    • Windows
    • Web
    • VoIP
    • Virtualization
    • Trading
    • Smart Home
    • SEO
    • Security
    • Python
    • Program
    • PHP
    • OSX
    • OS
    • OpenSource
    • Nginx
    • MySQL
    • Mood
    • Linux
    • Life
    • Injection
    • Hosting
    • Finance
    • Exploits
    • CDN
  • 页面
    • About
  • 友链
    • 维酷科技
Help?

Please contact us on our email for need any support

Support
  • 首页
    首页   ›   OS   ›   Linux   ›   正文
Linux

SSH修改调整美国Linux VPS 时间和时区

2012-09-12 19:11:56
3184  0 0

大部分朋友都喜欢用美国的 VPS 主机,原因嘛,大家懂的。美国的vps大多都是国外的时间,让我们的程序总是不适应。那么如何调整linux的时间为北京时间?修改linux vps的时间和时区,有什么办法?

首先,需要ssh登录vps或服务器。 date 命令可以查看时间和时区。然后输入以下命令:
rm -rf /etc/localtime
ln -s /usr/share/zoneinfo/Asia/Shanghai /etc/localtime

再date查看下时间和时区,时间是否正确了。如果已经正确,那么OK搞定。 SSH操作范例:
root@prodigyu.com~]# date
Thu May 6 02:01:52 UTC 2010
[root@prodigyu.com~]# rm -rf /etc/localtime
[root@prodigyu.com~]# ln -s /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
[root@prodigyu.com~]# date
Thu May 6 10:02:32 CST 2010

如果还是有些不对,那么需要用命令 ntpdate stdtime.sinica.edu.tw 来校准时间。ntpdate stdtime.sinica.edu.tw 如果提示无此命令,那么需要先安装 ntpdate

CentOS 安装方法:
yum -y install ntpdate ntp
Ubuntu安装方法:
sudo apt-get install -y ntpdate ntp

WordPress › Error

Error establishing a Redis connection

To disable Redis, delete the object-cache.php file in the /wp-content/ directory.