<?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>Ubuntu | SDT 攻城獅區</title>
	<atom:link href="https://sdt.hameba.tw/tag/ubuntu/feed/" rel="self" type="application/rss+xml" />
	<link>https://sdt.hameba.tw</link>
	<description>由Steven, Der, Ted 三位高級打字員所組成，是三位工程師(攻城獅)所維護的技術分享平台，或許偶爾會分享一些日常，有任何問題或是錯誤的部分，歡迎留言告訴我們！</description>
	<lastBuildDate>Wed, 12 Feb 2020 16:30:14 +0800</lastBuildDate>
	<language>zh-TW</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=5.3</generator>

<image>
	<url>https://sdt.hameba.tw/wp-content/uploads/2020/02/hameba_favicon-150x150.png</url>
	<title>Ubuntu | SDT 攻城獅區</title>
	<link>https://sdt.hameba.tw</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>Ubuntu 安裝 Nodejs</title>
		<link>https://sdt.hameba.tw/515/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=ubuntu-%25e5%25ae%2589%25e8%25a3%259d-nodejs</link>
				<comments>https://sdt.hameba.tw/515/#respond</comments>
				<pubDate>Wed, 12 Feb 2020 16:30:14 +0000</pubDate>
		<dc:creator><![CDATA[Li Der]]></dc:creator>
				<category><![CDATA[Software]]></category>
		<category><![CDATA[apt-get]]></category>
		<category><![CDATA[curl]]></category>
		<category><![CDATA[nodejs]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">https://sdt.hameba.tw/?p=515</guid>
				<description><![CDATA[<p>介紹 Ubuntu 18.04 環境下安裝Node.js， 會使用到的指令有 apt-get 以及 curl。 &#8230; </p>
<p class="link-more"><a href="https://sdt.hameba.tw/515/" class="more-link">閱讀全文<span class="screen-reader-text">〈Ubuntu 安裝 Nodejs〉</span></a></p>
The post <a href="https://sdt.hameba.tw/515/">Ubuntu 安裝 Nodejs</a> first appeared on <a href="https://sdt.hameba.tw">SDT 攻城獅區</a>.]]></description>
								<content:encoded><![CDATA[<p>介紹 Ubuntu 18.04 環境下安裝Node.js，</p>
<p>會使用到的指令有 apt-get 以及 curl。</p>
<p><span id="more-515"></span></p>
<p>如果是macOS或Windows的話，官方有提供安裝包 <a href="https://nodejs.org/en/download/">(官網)</a></p>
<p>先更新套件清單跟安裝curl</p><pre class="crayon-plain-tag">sudo apt-get update
sudo apt-get install curl</pre><p>接下來就可以來安裝Node.js (版本v13.x)</p><pre class="crayon-plain-tag">curl -sL https://deb.nodesource.com/setup_13.x | sudo -E bash -
sudo apt-get install -y nodejs</pre><p>安裝完成後，確認安裝版本。</p><pre class="crayon-plain-tag">node -v</pre><p>&nbsp;</p>
<p>參考資料</p>
<p><a href="https://github.com/nodesource/distributions">https://github.com/nodesource/distributions</a></p>The post <a href="https://sdt.hameba.tw/515/">Ubuntu 安裝 Nodejs</a> first appeared on <a href="https://sdt.hameba.tw">SDT 攻城獅區</a>.]]></content:encoded>
							<wfw:commentRss>https://sdt.hameba.tw/515/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
							</item>
		<item>
		<title>Ubuntu 安裝 Jenkins 並啟用</title>
		<link>https://sdt.hameba.tw/375/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=ubuntu-%25e5%25ae%2589%25e8%25a3%259d-jenkins</link>
				<comments>https://sdt.hameba.tw/375/#respond</comments>
				<pubDate>Wed, 25 Dec 2019 08:41:43 +0000</pubDate>
		<dc:creator><![CDATA[Hsu Steven]]></dc:creator>
				<category><![CDATA[Software]]></category>
		<category><![CDATA[System]]></category>
		<category><![CDATA[CD]]></category>
		<category><![CDATA[CI]]></category>
		<category><![CDATA[CI/CD]]></category>
		<category><![CDATA[Jenkins]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">https://sdt.hameba.tw/?p=375</guid>
				<description><![CDATA[<p>現在很流行CI/CD，所以作者來試試看安裝Jenkins配合ShellScript， 以前都是寫crontab &#8230; </p>
<p class="link-more"><a href="https://sdt.hameba.tw/375/" class="more-link">閱讀全文<span class="screen-reader-text">〈Ubuntu 安裝 Jenkins 並啟用〉</span></a></p>
The post <a href="https://sdt.hameba.tw/375/">Ubuntu 安裝 Jenkins 並啟用</a> first appeared on <a href="https://sdt.hameba.tw">SDT 攻城獅區</a>.]]></description>
								<content:encoded><![CDATA[<p>現在很流行CI/CD，所以作者來試試看安裝Jenkins配合ShellScript，</p>
<p>以前都是寫crontab每天定時執行ShellScript，</p>
<p>現在用bitbucket webhook Jenkins達到master push 直接更新code。</p>
<p><span id="more-375"></span></p>
<p>安裝步驟</p><pre class="crayon-plain-tag">$ sudo apt-get update

# Jenkins是java 所以需要jdk用8即可
$ sudo apt-get install openjdk-8-jdk

$ wget -q -O - https://pkg.jenkins.io/debian/jenkins-ci.org.key | sudo apt-key add -

#將Jenkins添加到系統
$ sudo sh -c 'echo deb http://pkg.jenkins.io/debian-stable binary/ &gt; /etc/apt/sources.list.d/jenkins.list'

$ sudo apt-get update

# 安裝Jenkins
$ sudo apt-get install jenkins</pre><p>完成後，可以用以下指令觀看系統狀況</p><pre class="crayon-plain-tag"># jenkins 狀況
$ sudo service jenkins status

# jenkins 啟動
$ sudo service jenkins start

# jenkins 停止
$ sudo service jenkins stop

# jenkins 重啟
$ sudo service jenkins restart

# jenkins 開機啟動
$ sudo systemctl enable jenkins</pre><p>完成後到網頁 127.0.0.1:8080，會要求輸入密碼</p><pre class="crayon-plain-tag">cat /var/lib/jenkins/secrets/initialAdminPassword</pre><p>顯示的密碼直接輸入即可</p>
<p>選擇左邊 &#8220;install suggest plugin&#8221; 標準安裝。</p>
<p>作者在安裝過程中發生安裝失敗的問題，可能是<span style="color: #ff0000">來源端Jenkins plugin Server異常</span>，可以稍後再重試，正常點擊install suggest plugin後，大概5分鐘就可以安裝完，且不會有progress lock的感覺。</p>
<p>進入Jenkins系統後，會要求輸入新的使用者及密碼。</p>
<p>大致這樣就完成Jenkins的安裝及啟用。</p>
<p>Reference</p>
<p><a href="https://easonwang01.gitbooks.io/class/jenkinsbitbucket.html">https://easonwang01.gitbooks.io/class/jenkinsbitbucket.html</a></p>
<p><a href="https://linuxhostsupport.com/blog/how-to-install-jenkins-on-ubuntu-18-04/">https://linuxhostsupport.com/blog/how-to-install-jenkins-on-ubuntu-18-04/</a></p>The post <a href="https://sdt.hameba.tw/375/">Ubuntu 安裝 Jenkins 並啟用</a> first appeared on <a href="https://sdt.hameba.tw">SDT 攻城獅區</a>.]]></content:encoded>
							<wfw:commentRss>https://sdt.hameba.tw/375/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
							</item>
		<item>
		<title>Linux crontab 直接重新讀取</title>
		<link>https://sdt.hameba.tw/354/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=linux-crontab-%25e7%259b%25b4%25e6%258e%25a5%25e9%2587%258d%25e6%2596%25b0%25e8%25ae%2580%25e5%258f%2596</link>
				<comments>https://sdt.hameba.tw/354/#respond</comments>
				<pubDate>Fri, 20 Dec 2019 14:28:14 +0000</pubDate>
		<dc:creator><![CDATA[Hsu Steven]]></dc:creator>
				<category><![CDATA[System]]></category>
		<category><![CDATA[crontab]]></category>
		<category><![CDATA[debian]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">https://sdt.hameba.tw/?p=354</guid>
				<description><![CDATA[<p>Linux的crontab排程服務， 設定完成後，可以不用重新開機直接reload，指令如下: [crayon &#8230; </p>
<p class="link-more"><a href="https://sdt.hameba.tw/354/" class="more-link">閱讀全文<span class="screen-reader-text">〈Linux crontab 直接重新讀取〉</span></a></p>
The post <a href="https://sdt.hameba.tw/354/">Linux crontab 直接重新讀取</a> first appeared on <a href="https://sdt.hameba.tw">SDT 攻城獅區</a>.]]></description>
								<content:encoded><![CDATA[<p>Linux的crontab排程服務，</p>
<p>設定完成後，可以不用重新開機直接reload，指令如下:</p>
<p><span id="more-354"></span></p><pre class="crayon-plain-tag">$ sudo service cron reload

# or

$ /etc/init.d/cron reload</pre><p>&nbsp;</p>
<p>Reference</p>
<p><a href="https://stackoverflow.com/questions/10193788/restarting-cron-after-changing-crontab-file">https://stackoverflow.com/questions/10193788/restarting-cron-after-changing-crontab-file</a></p>The post <a href="https://sdt.hameba.tw/354/">Linux crontab 直接重新讀取</a> first appeared on <a href="https://sdt.hameba.tw">SDT 攻城獅區</a>.]]></content:encoded>
							<wfw:commentRss>https://sdt.hameba.tw/354/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
							</item>
		<item>
		<title>Linux 背景執行 Screen</title>
		<link>https://sdt.hameba.tw/284/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=linux-%25e8%2583%258c%25e6%2599%25af%25e5%259f%25b7%25e8%25a1%258c-screen</link>
				<comments>https://sdt.hameba.tw/284/#respond</comments>
				<pubDate>Sat, 07 Dec 2019 15:26:57 +0000</pubDate>
		<dc:creator><![CDATA[Hsu Steven]]></dc:creator>
				<category><![CDATA[Other]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Screen]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">https://sdt.hameba.tw/?p=284</guid>
				<description><![CDATA[<p>通常系統做好後，會遠端ssh進入linux系統 假設做到更新時dist-upgrade這種，如果發生斷線後 系 &#8230; </p>
<p class="link-more"><a href="https://sdt.hameba.tw/284/" class="more-link">閱讀全文<span class="screen-reader-text">〈Linux 背景執行 Screen〉</span></a></p>
The post <a href="https://sdt.hameba.tw/284/">Linux 背景執行 Screen</a> first appeared on <a href="https://sdt.hameba.tw">SDT 攻城獅區</a>.]]></description>
								<content:encoded><![CDATA[<p>通常系統做好後，會遠端ssh進入linux系統</p>
<p>假設做到更新時dist-upgrade這種，如果發生斷線後</p>
<p><span id="more-284"></span></p>
<p>系統大概會出問題的機率都很高，所以會改成背景執行</p>
<p>Screen就是可以背景執行的好物</p><pre class="crayon-plain-tag"># 安裝Screen
$ sudo apt-get install screen</pre><p></p>
<h3><code>screen</code> 參數表</h3>
<table class="post-table">
<tbody>
<tr>
<td class="header"><code>screen</code> 參數</td>
<td class="header">說明</td>
</tr>
<tr>
<td><code>-c file</code></td>
<td>使定使用的設定檔（預設為 <code>$HOME/.screenrc</code>）</td>
</tr>
<tr>
<td><code>-d [pid.tty.host]</code></td>
<td>強制將指定的 <code>screen</code> 工作環境卸離</td>
</tr>
<tr>
<td><code>-L</code></td>
<td>開啟自動紀錄功能</td>
</tr>
<tr>
<td><code>-ls</code> 或 <code>-list</code></td>
<td>列出目前所有執行中的 <code>screen</code> 工作環境</td>
</tr>
<tr>
<td><code>-r [pid.tty.host]</code></td>
<td>重新連接執行中的 <code>screen</code> 工作環境</td>
</tr>
<tr>
<td><code>-R</code></td>
<td>重新連接最近卸離的 <code>screen</code> 工作環境</td>
</tr>
<tr>
<td><code>-U</code></td>
<td>以 UTF-8 模式執行</td>
</tr>
<tr>
<td><code>-wipe [match]</code></td>
<td>將廢棄的 <code>screen</code> 工作環境清除</td>
</tr>
</tbody>
</table>
<h3><code>screen</code> 操作指令表</h3>
<table class="post-table">
<tbody>
<tr>
<td class="header"><code>screen</code> 參數</td>
<td class="header">說明</td>
</tr>
<tr>
<td><code>Ctrl</code> + <code>a</code> 與 <code>c</code></td>
<td>建立新 <code>screen</code> 視窗</td>
</tr>
<tr>
<td><code>Ctrl</code> + <code>a</code> 與 <code>Ctrl</code> + <code>a</code></td>
<td>切換至上一個 <code>screen</code> 視窗</td>
</tr>
<tr>
<td><code>Ctrl</code> + <code>a</code> 與數字鍵 <code>0</code> 到 <code>9</code></td>
<td>切換至指定編號的 <code>screen</code> 視窗</td>
</tr>
<tr>
<td><code>Ctrl</code> + <code>a</code> 與 <code>n</code></td>
<td>切換至下一個的 <code>screen</code> 視窗</td>
</tr>
<tr>
<td><code>Ctrl</code> + <code>a</code> 與 <code>p</code></td>
<td>切換至下一個的 <code>screen</code> 視窗</td>
</tr>
<tr>
<td><code>Ctrl</code> + <code>a</code> 與 <code>w</code></td>
<td>列出目前所有的 <code>screen</code> 視窗</td>
</tr>
<tr>
<td><code>Ctrl</code> + <code>a</code> 與 <code>"</code></td>
<td>列出目前所有的 <code>screen</code> 視窗，並可用上下鍵選擇要切換的設窗</td>
</tr>
<tr>
<td><code>Ctrl</code> + <code>a</code> 與 <code>k</code></td>
<td>關閉目前的 <code>screen</code> 視窗</td>
</tr>
<tr>
<td><code>Ctrl</code> + <code>a</code> 與 <code>d</code></td>
<td>卸離 <code>screen</code> 工作環境</td>
</tr>
<tr>
<td><code>Ctrl</code> + <code>a</code> 與 <code>Esc</code> 鍵（或 <code>Ctrl</code> + <code>a</code> 與 <code>[</code>）</td>
<td>進入複製模式（copy mode），可用方向鍵操作捲軸，或用 <code>/</code> 與 <code>?</code> 來搜尋，按下空白鍵開始選取要複製的內容，選取完成後再按下第二次空白鍵，即可複製，隨後使用 <code>Ctrl</code> + <code>]</code> 可貼上複製的內容。</td>
</tr>
<tr>
<td><code>Ctrl</code> + <code>a</code> 與 <code>S</code></td>
<td>將畫面分割成上下兩個區域</td>
</tr>
<tr>
<td><code>Ctrl</code> + <code>a</code> 與 <code>Q</code></td>
<td>關閉分割畫面</td>
</tr>
<tr>
<td><code>Ctrl</code> + <code>a</code> 與 <code>Tab</code> 鍵</td>
<td>切換分割畫面</td>
</tr>
<tr>
<td><code>Ctrl</code> + <code>a</code> 與 <code>t</code></td>
<td>顯示目前系統的時間與負載狀況</td>
</tr>
<tr>
<td><code>Ctrl</code> + <code>a</code> 與 <code>a</code></td>
<td>送出 <code>Ctrl</code> + <code>a</code></td>
</tr>
<tr>
<td><code>Ctrl</code> + <code>a</code> 與 <code>?</code></td>
<td>顯示說明</td>
</tr>
<tr>
<td><code>Ctrl</code> + <code>a</code> 與 <code>v</code></td>
<td>顯示版本資訊</td>
</tr>
<tr>
<td><code>Ctrl</code> + <code>a</code> 與 <code>x</code></td>
<td>鎖定 <code>screen</code> 螢幕</td>
</tr>
<tr>
<td><code>Ctrl</code> + <code>a</code> 與 <code>H</code></td>
<td>開啟或結束 <code>screen</code> 紀錄功能</td>
</tr>
<tr>
<td><code>Ctrl</code> + <code>a</code> 與 <code>C</code></td>
<td>清除 <code>screen</code> 視窗中的內容</td>
</tr>
<tr>
<td><code>Ctrl</code> + <code>a</code>、<code>D</code> 與 <code>D</code></td>
<td>強力卸離，卸離 <code>screen</code> 工作環境之後，直接登出</td>
</tr>
<tr>
<td><code>Ctrl</code> + <code>a</code> 與 <code>Ctrl</code> + <code>g</code></td>
<td>視覺化鈴聲（visual bell）切換</td>
</tr>
<tr>
<td><code>Ctrl</code> + <code>a</code> 與 <code>i</code></td>
<td>顯示目前 <code>screen</code> 視窗的資訊</td>
</tr>
<tr>
<td><code>Ctrl</code> + <code>a</code> 與 <code>l</code></td>
<td>重繪目前 <code>screen</code> 視窗的內容</td>
</tr>
</tbody>
</table>
<p>&nbsp;</p>
<p>Reference</p>
<p><a href="https://blog.gtwang.org/linux/screen-command-examples-to-manage-linux-terminals/2/">https://blog.gtwang.org/linux/screen-command-examples-to-manage-linux-terminals/2/</a></p>
<div id="gtx-trans">
<div class="gtx-trans-icon"></div>
</div>The post <a href="https://sdt.hameba.tw/284/">Linux 背景執行 Screen</a> first appeared on <a href="https://sdt.hameba.tw">SDT 攻城獅區</a>.]]></content:encoded>
							<wfw:commentRss>https://sdt.hameba.tw/284/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
							</item>
		<item>
		<title>Ubuntu 18.04 安裝 WordPress (AMP)</title>
		<link>https://sdt.hameba.tw/135/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=ubuntu-18-04-%25e5%25ae%2589%25e8%25a3%259d-wordpress-amp</link>
				<comments>https://sdt.hameba.tw/135/#respond</comments>
				<pubDate>Thu, 28 Nov 2019 08:14:01 +0000</pubDate>
		<dc:creator><![CDATA[Li Der]]></dc:creator>
				<category><![CDATA[WordPress]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://192.168.100.203/?p=135</guid>
				<description><![CDATA[<p>環境：Ubuntu 18.04.3 安裝1 WordPress 安裝2 Apache2 安裝3 MySQL 安 &#8230; </p>
<p class="link-more"><a href="https://sdt.hameba.tw/135/" class="more-link">閱讀全文<span class="screen-reader-text">〈Ubuntu 18.04 安裝 WordPress (AMP)〉</span></a></p>
The post <a href="https://sdt.hameba.tw/135/">Ubuntu 18.04 安裝 WordPress (AMP)</a> first appeared on <a href="https://sdt.hameba.tw">SDT 攻城獅區</a>.]]></description>
								<content:encoded><![CDATA[<p>環境：Ubuntu 18.04.3<br />
安裝1 WordPress<br />
安裝2 Apache2<br />
安裝3 MySQL<br />
安裝4 PHP<br />
<span id="more-135"></span></p>
<p>先將apt升級到最新。</p><pre class="crayon-plain-tag">sudo apt-get update
sudo apt-get upgrade</pre><p>安裝 Apache (預設的位置：/var/www/html/)</p><pre class="crayon-plain-tag">sudo apt-get install apache2</pre><p>安裝 MySQL</p><pre class="crayon-plain-tag">sudo apt install mysql-server</pre><p>查看 MySQL 版本</p><pre class="crayon-plain-tag">mysql -V</pre><p>接下來設定root密碼<br />
登入MySQL</p><pre class="crayon-plain-tag">sudo mysql</pre><p>修改root密碼</p><pre class="crayon-plain-tag">ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'your_password';</pre><p>查看並確認目前的使用者</p><pre class="crayon-plain-tag">SELECT User,Host FROM mysql.user;</pre><p>刷新權限</p><pre class="crayon-plain-tag">FLUSH PRIVILEGES;</pre><p>接下來建立給WordPress的資料庫以及使用者<br />
建立資料庫</p><pre class="crayon-plain-tag">CREATE DATABASE wordpress;</pre><p>建立使用者及權限</p><pre class="crayon-plain-tag">GRANT ALL PRIVILEGES ON wordpress.* TO 'wordpress_user'@'localhost' IDENTIFIED BY 'wordpress_password';</pre><p>刷新權限</p><pre class="crayon-plain-tag">FLUSH PRIVILEGES;</pre><p>安裝 PHP</p><pre class="crayon-plain-tag">sudo apt install php php-mysql</pre><p>查看 PHP 版本</p><pre class="crayon-plain-tag">php -v</pre><p>安裝WordPress<br />
先切換到網站目錄下，等等比較方便操作。</p><pre class="crayon-plain-tag">cd /var/www/html/</pre><p>下載WordPress安裝最新版本(英文)，中文的話(https://tw.wordpress.org/wordpress-5.3-zh_TW.tar.gz)</p><pre class="crayon-plain-tag">sudo wget https://wordpress.org/latest.tar.gz</pre><p>解壓縮檔案，會有一個wordpress目錄</p><pre class="crayon-plain-tag">sudo tar -xzvf latest.tar.gz</pre><p></p>
<blockquote><p>-x 解開一個 tar 檔案<br />
-z 使用 gzip 壓縮<br />
-v 顯示建立 tar 檔案的過程<br />
-f 指定 tar 檔案的檔案名稱。</p></blockquote>
<p>切換到 /wordpress目錄</p><pre class="crayon-plain-tag">cd wordpress</pre><p>將sample的設定檔複製一份並且更名(拿掉-sample)</p><pre class="crayon-plain-tag">sudo mv wp-config-sample.php wp-config.php</pre><p>修改設定檔，將Database, user, password改成我們剛剛建立的<br />
(用vi, nano都可以，這裡用nano)</p><pre class="crayon-plain-tag">sudo nano wp-config.php</pre><p><img class="alignnone size-medium wp-image-140" src="http://192.168.100.203/wp-content/uploads/2019/11/wpConfig-300x206.png" alt="wpConfig" width="300" height="206" srcset="https://sdt.hameba.tw/wp-content/uploads/2019/11/wpConfig-300x206.png 300w, https://sdt.hameba.tw/wp-content/uploads/2019/11/wpConfig-768x528.png 768w, https://sdt.hameba.tw/wp-content/uploads/2019/11/wpConfig.png 918w" sizes="(max-width: 300px) 100vw, 300px" /></p>
<p>最後，讓我們看看成果吧～<br />
http://YOUR_IP/wordpress/wp-login.php</p>
<p>&nbsp;</p>
<p>參考資料：</p>
<p>&nbsp;</p>The post <a href="https://sdt.hameba.tw/135/">Ubuntu 18.04 安裝 WordPress (AMP)</a> first appeared on <a href="https://sdt.hameba.tw">SDT 攻城獅區</a>.]]></content:encoded>
							<wfw:commentRss>https://sdt.hameba.tw/135/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
							</item>
		<item>
		<title>Ubuntu 18.04.3  安裝  MongoDB 4.0</title>
		<link>https://sdt.hameba.tw/127/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=ubuntu-18-04-3-%25e5%25ae%2589%25e8%25a3%259d-mongodb-4-0</link>
				<comments>https://sdt.hameba.tw/127/#respond</comments>
				<pubDate>Thu, 28 Nov 2019 03:43:22 +0000</pubDate>
		<dc:creator><![CDATA[Li Der]]></dc:creator>
				<category><![CDATA[Other]]></category>
		<category><![CDATA[MongoDB]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://192.168.100.203/?p=127</guid>
				<description><![CDATA[<p>主機：Raspberry Pi 4 環境：Ubuntu 18.04.3 透過下列2個指令，皆可知道目前的作業系 &#8230; </p>
<p class="link-more"><a href="https://sdt.hameba.tw/127/" class="more-link">閱讀全文<span class="screen-reader-text">〈Ubuntu 18.04.3  安裝  MongoDB 4.0〉</span></a></p>
The post <a href="https://sdt.hameba.tw/127/">Ubuntu 18.04.3  安裝  MongoDB 4.0</a> first appeared on <a href="https://sdt.hameba.tw">SDT 攻城獅區</a>.]]></description>
								<content:encoded><![CDATA[<p>主機：Raspberry Pi 4<br />
環境：Ubuntu 18.04.3</p>
<p><span id="more-127"></span></p>
<p>透過下列2個指令，皆可知道目前的作業系統為何。</p><pre class="crayon-plain-tag">uname -a</pre><p></p><pre class="crayon-plain-tag">cat /etc/os-release</pre><p>在安裝MongoDB之前，先將apt升級到最新。</p><pre class="crayon-plain-tag">sudo apt-get update
sudo apt-get upgrade
sudo apt-get dist-upgrade</pre><p>加入 public key</p><pre class="crayon-plain-tag">sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 9DA31620334BD75D9DCB49F368818C72E52529D4</pre><p>導入 MongoDB public GPG Key</p><pre class="crayon-plain-tag">wget -qO - https://www.mongodb.org/static/pgp/server-4.0.asc | sudo apt-key add -</pre><p>建立 /etc/apt/sources.list.d/mongodb-org-4.0.list 檔案</p><pre class="crayon-plain-tag">echo "deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/4.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-4.0.list</pre><p>再更新一次</p><pre class="crayon-plain-tag">sudo apt-get update
sudo apt-get upgrade</pre><p>補足libcurl3</p><pre class="crayon-plain-tag">sudo apt-get install -y libcurl3</pre><p>開始安裝MongoDB</p><pre class="crayon-plain-tag">sudo apt-get install -y mongodb-org</pre><p>下列2個指令都可以知道MongoDB版本資訊。</p><pre class="crayon-plain-tag">mongod -version</pre><p></p><pre class="crayon-plain-tag">mongo -version</pre><p>裝好之後，記得建立MongoDB資料庫的目錄(預設為/data/db)</p><pre class="crayon-plain-tag">sudo mkdir -p /data/db</pre><p>將MongoDB 開啟</p><pre class="crayon-plain-tag">sudo service mongod start</pre><p>將 MongoDB 停止</p><pre class="crayon-plain-tag">sudo service mongod stop</pre><p>查看 MongoDB 狀態</p><pre class="crayon-plain-tag">sudo service mongod status</pre><p>將 MongoDB 重新啟動</p><pre class="crayon-plain-tag">sudo service mongod restart</pre><p>登入MongoDB</p><pre class="crayon-plain-tag">mongo</pre><p>參考資料：<br />
1. https://docs.mongodb.com/v4.0/tutorial/install-mongodb-on-ubuntu/<br />
2. https://andyfelong.com/2019/03/mongodb-4-0-6-64-bit-on-raspberry-pi-3/</p>The post <a href="https://sdt.hameba.tw/127/">Ubuntu 18.04.3  安裝  MongoDB 4.0</a> first appeared on <a href="https://sdt.hameba.tw">SDT 攻城獅區</a>.]]></content:encoded>
							<wfw:commentRss>https://sdt.hameba.tw/127/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
							</item>
		<item>
		<title>Ubuntu mysql 移除 sudo</title>
		<link>https://sdt.hameba.tw/124/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=ubuntu-mysql-%25e7%25a7%25bb%25e9%2599%25a4-sudo</link>
				<comments>https://sdt.hameba.tw/124/#respond</comments>
				<pubDate>Mon, 25 Nov 2019 13:54:08 +0000</pubDate>
		<dc:creator><![CDATA[Hsu Steven]]></dc:creator>
				<category><![CDATA[System]]></category>
		<category><![CDATA[MariaDB]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://192.168.100.203/?p=124</guid>
				<description><![CDATA[<p>RPI 4 OS : ubuntu 18.04 Server 安裝mariaDB [crayon-647f60 &#8230; </p>
<p class="link-more"><a href="https://sdt.hameba.tw/124/" class="more-link">閱讀全文<span class="screen-reader-text">〈Ubuntu mysql 移除 sudo〉</span></a></p>
The post <a href="https://sdt.hameba.tw/124/">Ubuntu mysql 移除 sudo</a> first appeared on <a href="https://sdt.hameba.tw">SDT 攻城獅區</a>.]]></description>
								<content:encoded><![CDATA[<p>RPI 4 OS : ubuntu 18.04 Server</p>
<p>安裝mariaDB</p><pre class="crayon-plain-tag">sudo apt install mariadb-server</pre><p><span id="more-124"></span></p>
<p>安裝完成後 使用mysql 都需加上sudo但會變成無密碼都可以登入，所以需改成普通可以登入方式</p>
<p>先使用sudo登入mysql(mariaDB)</p><pre class="crayon-plain-tag">sudo mysql -u root</pre><p>移除root</p><pre class="crayon-plain-tag">DROP USER 'root'@'localhost';</pre><p>新增root for 全域</p><pre class="crayon-plain-tag">CREATE USER 'root'@'%' IDENTIFIED BY '';</pre><p>授予root權限</p><pre class="crayon-plain-tag">GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' WITH GRANT OPTION;</pre><p>刷新權限</p><pre class="crayon-plain-tag">FLUSH PRIVILEGES;</pre><p>確定是否有新增root用戶</p><pre class="crayon-plain-tag">SELECT User,Host FROM mysql.user;

+------------------+-----------+
| User             | Host      |
+------------------+-----------+
| root             | %         |
| debian-sys-maint | localhost |
| mysql.session    | localhost |
| mysql.sys        | localhost |
+------------------+-----------+
4 rows in set (0.00 sec)</pre><p>測試不需要sudo即可以登入</p><pre class="crayon-plain-tag">mysql -u root -p</pre><p>&nbsp;</p>
<p>Reference:</p>
<p><a href="https://stackoverflow.com/questions/37239970/connect-to-mysql-server-without-sudo">https://stackoverflow.com/questions/37239970/connect-to-mysql-server-without-sudo</a></p>
<div id="gtx-trans">
<div class="gtx-trans-icon"></div>
</div>The post <a href="https://sdt.hameba.tw/124/">Ubuntu mysql 移除 sudo</a> first appeared on <a href="https://sdt.hameba.tw">SDT 攻城獅區</a>.]]></content:encoded>
							<wfw:commentRss>https://sdt.hameba.tw/124/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
							</item>
	</channel>
</rss>
