😇 こんな人におすすめ
- Linux触り始めた
- サーバー操作が怖い
- systemctlがよく分からない
- LPIC受ける予定
🚨 結論:まずこれだけ覚えろ
systemctl start nginx
systemctl stop nginx
systemctl restart nginx
systemctl status nginx
systemctl enable nginx
👉 これで8割OK
📌 systemctlとは?
👉 サービス(サーバープログラム)を操作するコマンド
例
- nginx(Webサーバー)
- ssh(リモート接続)
- cron(定期実行)
💡 サービスって何?
👉 バックグラウンドで動くプログラム
つまり
「気づかないところで動いてるやつ」
🔥 よく使うコマンド(超重要)
▶ 起動
sudo systemctl start nginx
▶ 停止
sudo systemctl stop nginx
▶ 再起動
sudo systemctl restart nginx
▶ 状態確認
systemctl status nginx
👉 一番使う
▶ 自動起動ON
systemctl enable nginx
▶ 自動起動OFF
systemctl disable nginx
⚠️ 初心者あるある
❌ nginx起動したのにアクセスできない
👉 原因
- 起動してない
- ポート開いてない
- サービス死んでる
👉 まずこれ
systemctl status nginx
💻 実践(これやれば理解できる)
sudo apt install nginx
sudo systemctl start nginx
systemctl status nginx
👉 ブラウザで確認
http://localhost
🧠 LPICで狙われるポイント
- start / stop / restart
- enable / disable
- status
- systemdの理解
🔥 覚え方(チート)
👉 「スタストリスタエネ」
- start
- stop
- restart
- status
- enable
🎯 まとめ
- systemctl = サービス操作
- status が最重要
- enable で自動起動
💬 ひとこと
Linuxできる人は
👉 「サービス管理」ができる人です
ここ超えたら一気にレベル上がります。