<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>地區 &#8211; 記下來</title>
	<atom:link href="https://noter.tw/tag/%E5%9C%B0%E5%8D%80/feed/" rel="self" type="application/rss+xml" />
	<link>https://noter.tw</link>
	<description>一路上踩到的坑、遇到的問題，一點一滴記下來，希望能幫助到需要的人~</description>
	<lastBuildDate>Tue, 02 Jul 2019 05:23:54 +0000</lastBuildDate>
	<language>zh-TW</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.6.3</generator>

<image>
	<url>https://noter.tw/wp-content/uploads/cropped-old-1130742_1920-1-32x32.jpg</url>
	<title>地區 &#8211; 記下來</title>
	<link>https://noter.tw</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>Ubuntu &#8211; 調整系統時間與時區設定</title>
		<link>https://noter.tw/1693/ubuntu-%e8%aa%bf%e6%95%b4%e7%b3%bb%e7%b5%b1%e6%99%82%e9%96%93%e8%88%87%e6%99%82%e5%8d%80%e8%a8%ad%e5%ae%9a/</link>
					<comments>https://noter.tw/1693/ubuntu-%e8%aa%bf%e6%95%b4%e7%b3%bb%e7%b5%b1%e6%99%82%e9%96%93%e8%88%87%e6%99%82%e5%8d%80%e8%a8%ad%e5%ae%9a/#respond</comments>
		
		<dc:creator><![CDATA[黃小蛙]]></dc:creator>
		<pubDate>Thu, 22 Dec 2011 06:16:03 +0000</pubDate>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[地區]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[時間]]></category>
		<category><![CDATA[date]]></category>
		<category><![CDATA[dpkg-reconfigure tzdata]]></category>
		<category><![CDATA[ntp]]></category>
		<category><![CDATA[ntpdate]]></category>
		<guid isPermaLink="false">http://wazai.net/?p=1693</guid>

					<description><![CDATA[<p>(2012-03-07 更新)小蛙在這篇文章會介紹怎麼在Ubuntu環境下設定時區以及透過網路更新時間。小蛙最近在試著透過crontab設定讓vps可以定期備份資料庫及WordPress，shell &#46;&#46;&#46;</p>
<p>這篇文章 <a rel="nofollow" href="https://noter.tw/1693/ubuntu-%e8%aa%bf%e6%95%b4%e7%b3%bb%e7%b5%b1%e6%99%82%e9%96%93%e8%88%87%e6%99%82%e5%8d%80%e8%a8%ad%e5%ae%9a/" data-wpel-link="internal">Ubuntu &#8211; 調整系統時間與時區設定</a> 最早出現於 <a rel="nofollow" href="https://noter.tw" data-wpel-link="internal">記下來</a>。</p>
]]></description>
										<content:encoded><![CDATA[<p>(2012-03-07 更新)小蛙在這篇文章會介紹怎麼在Ubuntu環境下設定時區以及透過網路更新時間。小蛙最近在試著透過crontab設定讓vps可以定期備份資料庫及WordPress，shell script不熟悉讓小蛙卡了好久&#8230;到了要測試crontab的時候卻發現怎麼crontab都沒運行，查了一下才發現系統時間是有問題的。<br />
<span id="more-1693"></span><br />
在還沒有發現時區的問題時(sense不夠)，一直在設定crontab，想說先測試一兩分鐘後跑起來的情況，結果過了三分鐘卻一動也不動，google了一下，在ubuntu下看系統時間的指令是</p>
<pre># date
Thu Dec 22 13:38:05 CST 2011</pre>
<p>但是現在時間是2011-12-22 14:01:00才對，用「Ubuntu系統時間校正」當關鍵字google了一下，得到一些校正時間的方法，馬上來試一下</p>
<pre># ntpdate time.stdtime.gov.tw
-bash: ntpdate: command not found
# apt-get install -y ntpdate ntp
...
# ntpdate time.stdtime.gov.tw
22 Dec 05:22:19 ntpdate[8132]: the NTP socket is in use, exiting</pre>
<p>好吧，看來問題不是「系統時間校正」，確定系統時間沒問題後，接著小蛙朝著「Ubuntu設定時區」尋找。在<a href="https://www.acsite.net/tw/forum/index.php?topic=1900.0" target="_blank" rel="noopener noreferrer nofollow external" data-wpel-link="external" class="wpel-icon-right">VPS 主機：基礎設定<span class="wpel-icon wpel-image wpel-icon-6"></span></a>這篇文章中看到</p>
<pre>3. 重設時區 (請選 Asia - Taipei)
# dpkg-reconfigure tzdata
Current default time zone: 'Asia/Taipei'
Local time is now:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Thu Dec 22 13:24:48 CST 2011.
Universal Time is now:&nbsp; Thu Dec 22 05:24:48 UTC 2011.</pre>
<p>時區正確，時間正確！真的揪甘心！<br />
2012-03-07<br />
昨天小蛙不小心把VPS給搞壞了，重開機之後就再也見不到美麗的歡迎訊息了「Welcome to Ubuntu」，令人感到難過，花了一天的時間慢慢把軟體裝回去、設定回去，目前大致上是都可以跑了，幸好平常有寫一隻shell script來定期打包wordpress及mysqldump，厲害的是這支shell script在這次的災難中也遺失了&#8230;(千備萬備，竟然忘了把home目錄備份下來&#8230;)，重灌的過程中遇到我的股票精算師有一支php專門去抓取大盤指數，全部設定都就緒後，在塞進資料庫<span style="color: #ff0000;"><strong>SET update_time = now()</strong></span>的時候，出現的時間竟然是有問題的&#8230;找了一下才發現只要修改<span style="color: #ff0000;"><strong>php.ini</strong></span>這個檔案中的<span style="color: #ff0000;"><strong>timezone</strong></span>就可以了。</p>
<pre class="brush: text; gutter: true">vim /etc/php5/cgi/php.ini
[Date]
; Defines the default timezone used by the date functions
; http://php.net/date.timezone
// 找到 timezone = 把前面的註解取消，後面加上地區位置
date.timezone=Asia/Taipei</pre>
<p>在網路上查到的資料是說把apache2重新啟動即可(先stop再start，不要用restart)，但小蛙用的是lighttpd不管restart或是stop再start都還是一樣不行，把機器reboot之後就可以了^__^</p>
<p>這篇文章 <a rel="nofollow" href="https://noter.tw/1693/ubuntu-%e8%aa%bf%e6%95%b4%e7%b3%bb%e7%b5%b1%e6%99%82%e9%96%93%e8%88%87%e6%99%82%e5%8d%80%e8%a8%ad%e5%ae%9a/" data-wpel-link="internal">Ubuntu &#8211; 調整系統時間與時區設定</a> 最早出現於 <a rel="nofollow" href="https://noter.tw" data-wpel-link="internal">記下來</a>。</p>
]]></content:encoded>
					
					<wfw:commentRss>https://noter.tw/1693/ubuntu-%e8%aa%bf%e6%95%b4%e7%b3%bb%e7%b5%b1%e6%99%82%e9%96%93%e8%88%87%e6%99%82%e5%8d%80%e8%a8%ad%e5%ae%9a/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
