忍者ブログ

STEP UP BLOG

Home > ブログ > CentOS

[PR]

×

[PR]上記の広告は3ヶ月以上新規記事投稿のないブログに表示されています。新しい記事を書く事で広告が消えます。

CentOS6以前とCentOS7でのよく使うコマンドのメモ

主にWebサーバを動かすときによく使うコマンドを挙げています。

・サービス一覧
CentOS6以前
$ chkconfig --list

CentOS7
$ systemctl list-units --type=service


・サービスの状態、起動、停止、再起動(例:httpd)
CentOS6以前
# service httpd status
# service httpd start
# service httpd stop
# service httpd restart

CentOS7
# systemctl status httpd.service
# systemctl start httpd.service
# systemctl stop httpd.service
# systemctl restart httpd.service


・ファイアウォール
CentOS6以前
# iptables -nvL
# iptables -A INPUT -p tcp -m tcp --dport 443 -j ACCEPT

CentOS7
# firewall-cmd --list-services --zone=public --permanent
# firewall-cmd --add-service=https --zone=public --permanent

firewalldはサービス名で追加削除できるのでわかりやすいですね。
PR

PAGE TOP