tag:blogger.com,1999:blog-16300790106007853762024-02-08T05:27:10.589-08:004Ki LinuxAnonymoushttp://www.blogger.com/profile/00163583408634752872noreply@blogger.comBlogger3125tag:blogger.com,1999:blog-1630079010600785376.post-49558092439012628772016-03-29T20:05:00.005-07:002016-03-29T20:05:51.028-07:003/30 職訓中心課程今天的課程,首先是進行Samba Server的安裝,<br />
<b style="color: #6aa84f; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: large;">基本設定流程: </b><br /><span style="color: blue; font-family: Trebuchet MS, sans-serif;">安裝 Samba Server 套件:</span><br />
<span style="font-family: Trebuchet MS, sans-serif;"><span style="background-color: honeydew; color: #880000; font-size: 11pt; line-height: 1.2em;">#yum -y install samba</span><br /><span style="color: blue;">設定欲分享目錄:</span><br /><span style="background-color: honeydew; color: #880000; font-size: 11pt; line-height: 1.2em;">#mkdir /sharedpath</span><br /><span style="color: blue;">設定 SELinux 限定規則:</span><br /><span style="color: #880000; font-size: 11pt; line-height: 1.2em;">#semanage fcontext -a -t samba_share_t '/sharedpath(/.*)?'</span><br /><span style="color: #880000; font-size: 11pt; line-height: 1.2em;">#restorecon -RFvv /sharedpath</span><br /><span style="font-size: 14.6667px; line-height: 17.6px; white-space: pre;"><br /></span><span style="color: blue;">設定 Samba Server 設定檔:</span><br /><span style="color: #880000; font-size: 11pt; line-height: 1.2em;">#vim /etc/samba/smb.conf</span><br /><b><span class="pun" style="color: #666600; font-size: 11pt; line-height: 1.2em;">[</span><span class="kwd" style="color: #000088; font-size: 11pt; line-height: 1.2em;">global</span><span class="pun" style="color: #666600; font-size: 11pt; line-height: 1.2em;">]</span></b><br /><b><span class="pln" style="font-size: 11pt; line-height: 1.2em;">workgroup </span><span class="pun" style="color: #666600; font-size: 11pt; line-height: 1.2em;">=</span><span class="pln" style="font-size: 11pt; line-height: 1.2em;"> WORKGROUP</span><br /><span class="pln" style="font-size: 11pt; line-height: 1.2em;">interfaces </span><span class="pun" style="color: #666600; font-size: 11pt; line-height: 1.2em;">=</span><span class="pln" style="font-size: 11pt; line-height: 1.2em;"> lo eth0 </span><span class="lit" style="color: #006666; font-size: 11pt; line-height: 1.2em;">192.168</span><span class="pun" style="color: #666600; font-size: 11pt; line-height: 1.2em;">.</span><span class="lit" style="color: #006666; font-size: 11pt; line-height: 1.2em;">1.1</span><span class="pun" style="color: #666600; font-size: 11pt; line-height: 1.2em;">/</span><span class="lit" style="color: #006666; font-size: 11pt; line-height: 1.2em;">24</span><br /><span class="pln" style="font-size: 11pt; line-height: 1.2em;">hosts allow </span><span class="pun" style="color: #666600; font-size: 11pt; line-height: 1.2em;">=</span><span class="pln" style="font-size: 11pt; line-height: 1.2em;"> </span><span class="lit" style="color: #006666; font-size: 11pt; line-height: 1.2em;">127.</span><span class="pln" style="font-size: 11pt; line-height: 1.2em;"> </span><span class="lit" style="color: #006666; font-size: 11pt; line-height: 1.2em;">192.168</span><span class="pun" style="color: #666600; font-size: 11pt; line-height: 1.2em;">.</span><span class="lit" style="color: #006666; font-size: 11pt; line-height: 1.2em;">1.</span><br /><span class="pun" style="color: #666600; font-size: 11pt; line-height: 1.2em;">[</span><span class="pln" style="font-size: 11pt; line-height: 1.2em;">myshare</span><span class="pun" style="color: #666600; font-size: 11pt; line-height: 1.2em;">]</span><br /><span class="pln" style="font-size: 11pt; line-height: 1.2em;">path </span><span class="pun" style="color: #666600; font-size: 11pt; line-height: 1.2em;">=</span><span class="pln" style="font-size: 11pt; line-height: 1.2em;"> </span><span class="pun" style="color: #666600; font-size: 11pt; line-height: 1.2em;">/</span><span class="pln" style="font-size: 11pt; line-height: 1.2em;">sharedpath</span><br /><span class="pln" style="font-size: 11pt; line-height: 1.2em;">writable </span><span class="pun" style="color: #666600; font-size: 11pt; line-height: 1.2em;">=</span><span class="pln" style="font-size: 11pt; line-height: 1.2em;"> </span><span class="kwd" style="color: #000088; font-size: 11pt; line-height: 1.2em;">no</span><br /><span class="pln" style="font-size: 11pt; line-height: 1.2em;">valid users </span><span class="pun" style="color: #666600; font-size: 11pt; line-height: 1.2em;">=</span><span class="pln" style="font-size: 11pt; line-height: 1.2em;"> fred</span><span class="pun" style="color: #666600; font-size: 11pt; line-height: 1.2em;">,</span><span class="pln" style="font-size: 11pt; line-height: 1.2em;"> </span><span class="lit" style="color: #006666; font-size: 11pt; line-height: 1.2em;">@management</span></b><span style="font-size: 14.6667px; line-height: 17.6px; white-space: pre;"><br /></span><span style="color: blue;">開啟 SELinux 存取規則:</span><span style="color: #880000; font-size: 11pt; line-height: 1.2em;">#setsebool -P samba_enable_home_dirs=on</span><br /><span style="color: #880000; font-size: 11pt; line-height: 1.2em;">#restorecon -RFvv /sharedpath</span><br /><span style="color: blue;"><span style="font-size: 14.6667px; line-height: 17.6px; white-space: pre;"><br /></span>在 Samba Server 上,検查設定項目是否正確:</span><br /><span style="background-color: honeydew; color: #880000; font-size: 11pt; line-height: 1.2em;">#testparm</span><br /><span style="color: blue;">在 Samba Server 上,新增一般的使用者帳號與密碼:</span><br /><span style="background-color: honeydew; color: #880000; font-size: 11pt; line-height: 1.2em;">#useradd -s /sbin/nologin fred</span><br /><span style="color: blue;">在 Samba Server 上,安裝管理使用者的套件:</span><br /><span style="background-color: honeydew; color: #880000; font-size: 11pt; line-height: 1.2em;">#yum -y install samba-client</span><br /><span style="color: blue;">在 Samba Server 上,設定可存取 Samba Server的使用者帳號與密碼:</span><br /><span style="background-color: honeydew; color: #880000; font-size: 11pt; line-height: 1.2em;">#smbpasswd -a fred</span><br /><span style="color: blue;">啟動 Samba Server:</span><br /><span style="color: #880000; font-size: 11pt; line-height: 1.2em;">#systemctl start smb nmb</span><br /><span style="color: #880000; font-size: 11pt; line-height: 1.2em;">#systemctl enable smb nmb</span><br /><span style="font-size: 14.6667px; line-height: 17.6px; white-space: pre;"><br /></span><span style="color: blue;">在 Samba Server 上,開啟防火牆設定:</span><br /><span style="color: #880000; font-size: 11pt; line-height: 1.2em;">#firewall-cmd --permanent --add-service=samba</span><br /><span style="color: #880000; font-size: 11pt; line-height: 1.2em;">#firewall-cmd --reload</span><br /><span style="font-size: 14.6667px; line-height: 17.6px; white-space: pre;"><br /></span><span style="color: blue;">在 client 端,掛載 Samba Server 所分享目錄:</span><br /><span style="color: #880000; font-size: 11pt; line-height: 1.2em;">#mkdir /mnt/myshare</span><br /><span style="color: #880000; font-size: 11pt; line-height: 1.2em;">#mount -t cifs -o username=fred //server/myshare /mnt/myshare</span></span><div>
可是在最後一個步驟 <span style="color: #880000; font-size: 14.6667px; line-height: 17.6px;">mount -t cifs -o username=fred //server/myshare /mnt/myshare </span><span style="font-size: 14.6667px; line-height: 17.6px;">的時候出現mount error的狀態出來,不知道發生了什麼問題?</span></div>
<div>
<span style="font-size: 14.6667px; line-height: 17.6px;"><br /></span></div>
<div>
<span style="font-size: 14.6667px; line-height: 17.6px;"><br /></span></div>
Anonymoushttp://www.blogger.com/profile/00163583408634752872noreply@blogger.com0tag:blogger.com,1999:blog-1630079010600785376.post-17490862517916687102016-03-21T22:06:00.000-07:002016-03-21T22:06:22.856-07:003/22 職訓中心課程今日的課程是使用Linux架設各種Server,<br />
<br />
前兩個看著老師的Blog邊做邊看一步一步操作起來,<br />
<br />
一開始是架設web Server,沒什麼難度,可是遇到一些障害看不懂英文感到很無力,但還是架設完成了。<br />
<br />
第二個架設的則是nfs Server,檢查是顯示綠燈,不過因為看不懂英文也不確定是否正確?<br />
<br />
在第二個架設的server之後,老師要求我們使用PuTTy進行mount的動作,可是不知道為何,老師抓的指令,cp iso檔的指令無法使用,於是就斷在這裡了。<br />
<br />
再來是MariaDB的安裝:<br />
<ul>
<li><span style="background-color: black; font-size: 13.2px; line-height: 18.48px;"><span style="color: white;">安裝 MySQL/MariaDB 套件:</span></span></li>
<li><span style="background-color: black; font-family: 'Courier New'; font-size: 11pt; line-height: 1.2em;"><span style="color: white;">#yum -y install mariadb mariadb-server mariadb-bench</span></span></li>
<li><span style="background-color: black; font-size: 13.2px; line-height: 18.48px;"><span style="color: white;">啟動 MySQL Server :</span></span></li>
<li><span style="background-color: black; font-size: 11pt; line-height: 1.2em;"><span style="color: white;">#systemctl start mariadb.service</span></span></li>
<li><span style="background-color: black; font-size: 11pt; line-height: 1.2em;"><span style="color: white;">#systemctl enable mariadb.service</span></span></li>
<li><span style="color: white; font-family: Courier New;"><span style="background-color: black; font-size: 14.6667px; line-height: 17.6px; white-space: pre;"><br /></span></span></li>
<li><span style="background-color: black; font-size: 13.2px; line-height: 18.48px;"><span style="color: white;">查詢預設 root 密碼:</span></span></li>
<li><span style="background-color: black; font-size: 11pt; line-height: 1.2em;"><span style="color: white;">#systemctl status mariadb -l</span></span></li>
<li><span style="background-color: black; font-size: 11pt; line-height: 1.2em;"><span style="color: white;">#less /var/log/messages</span></span></li>
<li><span style="color: white; font-family: Courier New;"><span style="background-color: black; font-size: 14.6667px; line-height: 17.6px; white-space: pre;"><br /></span></span></li>
<li><span style="background-color: black; font-size: 13.2px; line-height: 18.48px;"><span style="color: white;">設定 root 密碼:</span></span></li>
<li><span style="background-color: black; font-size: 11pt; line-height: 1.2em;"><span style="color: white;">#/usr/bin/mysqladmin -u root password 'a123456!'</span></span></li>
<li><span style="background-color: black; font-size: 11pt; line-height: 1.2em;"><span style="color: white;">#/usr/bin/mysqladmin -u root -h localhost.localdomain password 'a123456!'</span></span></li>
<li><span style="color: white; font-family: Courier New;"><span style="background-color: black; font-size: 14.6667px; line-height: 17.6px; white-space: pre;"><br /></span></span></li>
<li><span style="background-color: black; font-size: 13.2px; line-height: 18.48px;"><span style="color: white;">開通防火牆設定:</span></span></li>
<li><span style="background-color: black; font-size: 11pt; line-height: 1.2em;"><span style="color: white;">#firewall-cmd --permanent --add-service=mysql</span></span></li>
<li><span style="background-color: black; font-size: 11pt; line-height: 1.2em;"><span style="color: white;">#firewall-cmd --reload</span></span></li>
<li><span style="color: white; font-family: Courier New;"><span style="background-color: black; font-size: 14.6667px; line-height: 17.6px; white-space: pre;"><br /></span></span></li>
<li><span style="background-color: black; font-size: 13.2px; line-height: 18.48px;"><span style="color: white;">測試 MariaDB:</span></span></li>
<li><span style="background-color: black; font-size: 11pt; line-height: 1.2em;"><span style="color: white;">#mysql -u root -p</span></span></li>
</ul>
<span style="font-size: 14.6667px; line-height: 17.6px;"><span style="background-color: white;">照著老師的順序操作,很快便安裝成功。</span></span><div>
<span style="font-size: 14.6667px; line-height: 17.6px;"><br /></span></div>
<div>
<span style="font-size: 14.6667px; line-height: 17.6px;">安裝PHP </span></div>
<div>
<span style="font-size: 14.6667px; line-height: 17.6px;"><br /></span></div>
<div>
<span style="font-size: 14.6667px; line-height: 17.6px;">輸入yum install php-*的指令後會跳出很多可安裝的PHP檔案,之後照老師所說刪刪減減再安裝即可。</span></div>
<div>
<span style="font-size: 14.6667px; line-height: 17.6px;"><br /></span><pre class="codeblock prettyprint prettyprinted" style="background-attachment: initial; background-clip: initial; background-image: url("data:image/gif; background-origin: initial; background-position: 0% 0%; background-repeat: repeat-y; background-size: initial; border: 1px solid rgb(204, 204, 204); font-family: 'Courier New'; font-size: 11pt; line-height: 1.2em; max-height: 1000px; overflow: auto; padding: 10px 10px 10px 21px;"></pre>
</div>
Anonymoushttp://www.blogger.com/profile/00163583408634752872noreply@blogger.com0tag:blogger.com,1999:blog-1630079010600785376.post-42948231918306507312016-02-22T21:22:00.002-08:002016-02-22T21:22:01.838-08:00Test<strike>Test</strike><br />
<u>Test</u><br />
<i>Test</i><br />
<b>Test</b>Anonymoushttp://www.blogger.com/profile/00163583408634752872noreply@blogger.com0