我們在幫基隆市消防局製作安全防災深耕計畫網站時遇到主機安裝問題,由於安裝webmin過程中有可能聯到中國大陸部份學校的mirror下載rpm檔,而基隆市消防局機房是行政院研究發展考核委員會網段,無法連上中國,我們需要將yum與wget加上proxy,經查是由中華電信規劃線路,可以設定proxy.hinet.net,不過我們還是依政府網路慣例,採用proxy.gsn.gov.tw主機。 To use yum with proxy you have to configure 3 files: /etc/yum.conf: add the line proxy=http://proxy.gsn.gov.tw:80 where 80 is the port. /etc/wgetrc: There are 2 lines that you have to edit: http_proxy = http://proxy.gsn.gov.tw:80/ ftp_proxy = http://proxy.gsn.gov.tw:80/ /root/.bash_profile export http_proxy=http://proxy.gsn.gov.tw:80 export ftp_proxy=http://proxy.gsn.gov.tw:80 Regards 會允許下面通訊協定 Allowing traffic on TCP port: ftp Allowing traffic on TCP port: ftp-data Allowing traffic on TCP port: pop3 Allowing traffic on TCP port: pop3s Allowing traffic on TCP port: imap Allowing traffic on TCP port: imaps Allowing traffic on TCP port: http Allowing traffic on TCP port: https Allowing traffic on TCP port: 10000 Allowing traffic on TCP port: 20000 Allowing traffic on UDP port: domain Allowing traffic on UDP port: ftp Allowing traffic on UDP port: ftp-data
相關VI編輯器操作筆記在putty下輸入
vi test.txt
會打開test.txt檔
此時是處於 c-mode 模式下,無法輸入文字,按「a」鍵,轉為 i-mode模式,即可開始進行修改,同時可以看到左下角提示「INSERT」,表示現在正在 i-mode 可修改模式下。
改完按「Esc」鍵,由i-mode修改模式回到c-mode指令模式,接著按冒號「:」進入命令列模式,此時左下角會出現冒號與閃爍游標,此時可以在冒號後輸入以下指令:
w: 存檔(write)。注意在編輯過程中所有內容只存在暫存器裡,必須在 c-mode 下了這個「:w」指令才會存檔。
e: 重新編輯(edit)。
q: 退出(quit),如果檔案經過修改而沒有存檔,會出現錯誤訊息:鍵入「:q!」強制退出 (此次作的修改會流失)
|