Thursday, October 18, 2012

Changing Time zone in OpenVz vps

Changing Time zone in CentOS server/ Cpanel/WHM Servers

Option :1
Main >> Service Configuration >> PHP Configuration Editor [Date and Time] we can change
Changing the time in VPS via  WHM  Main >> Server Configuration >> Server Time,

Option 2:

Editing the configuration Files

#cat /etc/sysconfig/clock
date.timezone="US/Chicago"
date.timezone="America/Chicago"

 [~]# cat /etc/sysconfig/clock
ZONE="US/Central"
UTC=false
ARC=false

Option 3:

# ls -la  /etc/localtime

# cp /etc/localtime /etc/localtime.bkp
# cp /usr/share/zoneinfo/America/Chicago /etc/localtime
Or
#  ln -s /usr/share/zoneinfo/America/Chicago /etc/localtime

And then update the time zone value in your php.ini file 

date.timezone="America/Chicago" 
Restart the apache and check your server time.

Option 3:
Sometimes if your server is vps then the above options will not be work , for that time you can do the following steps.

1. Directly set the time using the date command, You can get the right time from your other server.

 date --set="2012-10-17 21:34 am"

and if it throws  "step-systime operation not permitted" error please fix this issue from your Hardware Node.

 # vzctl stop VEID

# vzctl set --capability sys_time:on --save

 # vzctl restart VEID

 date --set="2012-10-17 21:34 am"

Another fix:

 yum -y install ntp

Identify time zone from http://www.pool.ntp.org/

# vi /etc/ntp.conf

select a server.

eg: 0.centos.pool.ntp.org

# ntpdate servername
That is ntpdate clock.rethat.com


While doing the ntpupdate you may receive the following error:  "step-systime operation not permitted"

Suggested Fix

# vzctl stop VEID

# vzctl set --capability sys_time:on --save

needs to be replaced by your container’s ID
After executing the command above, your container’s configuration file needs to be reloaded. Thus, use ‘vzctl‘ to restart it.

# vzctl restart


7 comments:

  1. Thanks for sharing,get an affordable vps hosting in india at best prices.

    ReplyDelete
  2. What a thrilling post, you have pointed out some excellent points, I as well believe this is a superb website. I have planned to visit it again and again. VPS

    ReplyDelete
  3. Mmm.. good to be here in your article or post, whatever, I think I should also work hard for my own website like I see some good and updated working in your site. offshore streaming servers

    ReplyDelete
  4. Backed by enterprise-grade hardware, PalexWeb takes brand name, premium components like SSD’s, CPU’s, RAM and network related equipment and designing systems which take advantage of the strengths of each component. Providing a route-optimized network for the least latency to utilizing SSD’s for the fastest response. Always ensuring that our firmware always up to date - new hardware is constantly replacing any aging equipment. Beyond our enterprise-grade hardware of offshore vps, we offer software such as Litespeed and LSCache to help take your website to the next level. Providing all the options to give you every possible speed advantage.

    ReplyDelete
  5. It is defined as an Internet based service being offered online. The web hosting in the internet offers online arrangements to storing data and utilizing the web in providing virtual presence for any body who would want this sort of service. There are a lot of companies that offer web hosting services. You can find free web hosting and some are with a reasonable fee. https://onohosting.com/

    ReplyDelete