Setting your Virtual Private Server Timezone
The default timezone on your server is set to be the same as the System Time. System time is
the timezone that the operating system uses, in this case, GMT.
You can change the timezone on your Virtual Private Server by connecting to your server via
SSH or Telnet and following the instructions below.
-
-
Select the Timezone you want to use from the /usr/share/zoneinfo/ directory:
% cd /usr/share/zoneinfo
% ls
-
p>Copy the time zone file onto your Virtual Private Server. This example uses the
America/Los_Angeles timezone:
% cp /usr/share/zoneinfo/America/Los_Angeles ~/etc/localtime
-
Create the following directory on your virtual server and copy the appropriate file:
%mkdir ~/usr/share/zoneinfo
% mkdir ~/usr/share/zoneinfo/America
% cp /usr/share/zoneinfo/America/Los_Angeles ~/usr/share/zoneinfo/America/
-
Add the following new line to the ~/.cshrc file.
setenv TZ America/Los_Angeles
After editing the ~/.cshrc file, be sure to run:
% source ~/.cshrc
-
To configure cron to use the same timezone,
add the following line to the beginning of your cronfile:
TZ=America/Los_Angeles
-
Finally, restart apache so that it will
use your new timezone for it's log files.
-
-
Select the Timezone you want to use from the /usr/share/lib/zoneinfo/ directory:
% cd /usr/share/lib/zoneinfo
% ls
-
Copy the /etc/default/init file onto your Solaris Virtual Private Server.
% mkdir ~/etc/default
% cp /etc/default/init ~/etc/default
% chmod 755 ~/etc/default/init
-
Edit the TZ line in the new ~/etc/default/init file to use the timezone
you want. This example uses the US/Pacific timezone:
TZ=US/Pacific
-
Copy the /usr/share/lib/zoneinfo/US/Pacific file onto your Solaris Virtual Private Server.
% mkdir ~/usr/share/lib/zoneinfo/US
% cp /usr/share/lib/zoneinfo/US/Pacific ~/usr/share/lib/zoneinfo/US/
-
Add the following new line to the ~/.cshrc file.
setenv TZ US/Pacific
After editing the ~/.cshrc file, be sure to run:
% source ~/.cshrc
-
To configure cron to use the same timezone,
add the following line to the beginning of your cronfile:
TZ=US/Pacific
-
Finally, restart apache so that it will
use your new timezone for it's log files.
To make sure you set the time zone correctly, do the following:
% date
% virtual date
These should both show the timezone you set your server to use.
|