Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Introduction Infrastructure - Linode 入門
Search
chph
February 24, 2017
Technology
0
220
Introduction Infrastructure - Linode 入門
chph
February 24, 2017
Tweet
Share
More Decks by chph
See All by chph
Chrome Dev Tools 基礎技巧
chph
0
89
DevOpsDays Taipei 2017 敏捷思維分享
chph
0
100
在 Google Cloud Platform 架設你的網站伺服器並撰寫 Node.js 應用程式
chph
0
690
Intro to Progressive Web Apps
chph
1
63
淺談 Gzip
chph
0
130
Install WordPress on Linode
chph
0
160
高速傳愛~三小時進化 PWA
chph
0
290
Optimize JavaScript execution and parse time using optimize-js
chph
0
150
Modern Web 2016 議程分享: 網站自動化測試 - 以 PIXNET 搜尋 & 美妝口碑大賞為例
chph
0
120
Other Decks in Technology
See All in Technology
Unlocking the Power of AI Agents with LINE Bot MCP Server
linedevth
0
130
「何となくテストする」を卒業するためにプロダクトが動く仕組みを理解しよう
kawabeaver
0
440
まずはマネコンでちゃちゃっと作ってから、それをCDKにしてみよか。
yamada_r
2
120
バイブスに「型」を!Kent Beckに学ぶ、AI時代のテスト駆動開発
amixedcolor
3
590
メルカリIBISの紹介
0gm
0
830
「Linux」という言葉が指すもの
sat
PRO
4
150
これでもう迷わない!Jetpack Composeの書き方実践ガイド
zozotech
PRO
0
1.1k
プラットフォーム転換期におけるGitHub Copilot活用〜Coding agentがそれを加速するか〜 / Leveraging GitHub Copilot During Platform Transition Periods
aeonpeople
1
250
品質視点から考える組織デザイン/Organizational Design from Quality
mii3king
0
220
Autonomous Database - Dedicated 技術詳細 / adb-d_technical_detail_jp
oracle4engineer
PRO
4
10k
要件定義・デザインフェーズでもAIを活用して、コミュニケーションの密度を高める
kazukihayase
0
120
初めてAWSを使うときのセキュリティ覚書〜初心者支部編〜
cmusudakeisuke
1
290
Featured
See All Featured
Art, The Web, and Tiny UX
lynnandtonic
303
21k
The MySQL Ecosystem @ GitHub 2015
samlambert
251
13k
It's Worth the Effort
3n
187
28k
The Invisible Side of Design
smashingmag
301
51k
GitHub's CSS Performance
jonrohan
1032
460k
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
46
7.6k
Building Adaptive Systems
keathley
43
2.7k
Keith and Marios Guide to Fast Websites
keithpitt
411
22k
Understanding Cognitive Biases in Performance Measurement
bluesmoon
29
1.9k
Imperfection Machines: The Place of Print at Facebook
scottboms
268
13k
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
333
22k
Learning to Love Humans: Emotional Interface Design
aarron
273
40k
Transcript
styleMe 會議室∘2017.02.24 afu @ 研發中⼼前端組 @afutseng Introduction Infrastructure
Virtual Private Server VPS 虛擬專⽤主機
在講 VPS 之前...
共享主機 (Shared Hosting) • 也有 Web Hosting / Virtual Hosting
等名稱 • ⼀台伺服器放多個網站,只有⼀個是⾃⼰的 • 共⽤基礎設施:IP, CPU, 記憶體, 硬碟, 頻寬 • 背包客旅館 / 分租套房概念
共享主機 (Shared Hosting) • 優勢 • 費⽤便宜 • 專⼈維運機器等基礎設施,因此有代管稱呼 •
劣勢 • 其他⽤⼾網站使⽤較多資源時被連累 • ⾃主權低,通常不能⾃⼰裝軟體 • 例如升級作業系統 / Node.js / PHP / Apache
專屬主機 (Dedicated Server) • 擁有⼀台實體主機 • 獨佔所有主機的硬體資源 • ⼀台主機可以放 N
個⾃⼰的網站 • 獨棟透天厝概念
專屬主機 (Dedicated Server) • 優勢 • 完全獨⽴,不會被別⼈網站影響 (除⾮遇到機房災害) • ⾃主權最⾼,可以裝軟體、當⼆房東分租他⼈皆可
• 適合⼤型網站使⽤,專屬主機越多就會⾃建機房 (PIXNET) • 劣勢 • 費⽤昂貴 • 難以 Scale up / Scale out,硬體資源已被固定
虛擬專⽤主機 (Virtual Private Server) • ⾼檔的虛擬主機 • 專屬基礎設施:IP, CPU, 記憶體,
硬碟, 頻寬 • 可以放 N 個⾃⼰的網站 • 獨⽴套房概念,專屬衛浴/冷氣/電錶 • ⼀台實體主機裡會有多個 VPS,但彼此完全隔 離,不會佔⽤他⼈的 CPU 記憶體等資源
Why Linode?
None
試開⼀台 $5/mo 的機器
選擇地區 • 根據你的使⽤者決定機器開在哪個地區 • 服務對象是台灣則選東京最適合 • 距離越近延遲 (latency) 越低
機器建⽴完成
佈署偏好的映像檔 • 點選 Deploy an image • 選擇偏好的 OS,推薦 Ubuntu
16.04 LTS • Ubuntu 的⽣態圈步調較快,更新較勤 • LTS 為⻑期⽀援版本,Server 版有五年的更新⽀援
作業系統佈署完成 • 初始為關機狀態 • 接下來按 Boot 開機
開機完成 • 按 Boot 開機
找到 IP 並 ssh 連⼊機器 • ⽤剛才佈署機器時的密碼登⼊
注意!允許 root 登⼊是⾼⾵險 * 駭客只要猜中密碼就可以侵⼊機器! * 實務作法會關閉 root 的 ssh
權限,開 sudo 權限給 ⾃⼰的帳號 ! ! !
以 iTerm ⽰範 ssh 登⼊ • Windows ⽅案:putty
連⼊伺服器後的前置作業?
幾件⾸要⼯作 • 安裝 vim (除⾮你喜歡⽤ nano … ) • 替⾃⼰建⼀個帳號開
sudo,確認可以 ssh 連上 • ⽤ ssh-keygen 產⽣ SSH key • 關閉 root 的 ssh 權限 • 跑系統更新 • 替機器取名字 • 設定時區,確認時間
系統更新 • apt-get update # 更新套件資訊 • apt-get upgrade #
升級所有套件 • 可以寫成⼀⾏ • apt-get update && apt-get upgrade • 應定期更新系統套件以免累積技術債
替機器命名 • hostname # 顯⽰⺫前機器名稱 • 機器命名原則:描述⽤途、具備唯⼀性 • homepage-web-1 •
panel-api-2 • staging-db-3
替機器命名 (續) • 暫時改名,重開機後復原 • hostname afu-demo • 永久改名 •
vim /etc/hosts • vim /etc/hostname
設定時區 • dpkg-reconfigure tzdata
檢查時區 • ⽤ date 指令檢查時區
新增使⽤者 • adduser afu • usermod -aG sudo afu #
加⼊ sudo 群組 • ⼀直按 enter • 開新的終端機⽤新帳號登⼊ • sudo su - # 確認可以變⾝為 root
停⽤ root 帳號 ssh 登⼊ • sudo vim /etc/ssh/sshd_config •
PermitRootLogin no # 修改為 no • service ssh restart # 重開 ssh 服務
下次預告 Apache & MySQL & PHP 安裝
References 1. https://www.linode.com/docs/getting-started 2. https://www.digitalocean.com/community/tutorials/ initial-server-setup-with-ubuntu-16-04
感謝聆聽 @afutseng