LoginSignup
1
1

More than 5 years have passed since last update.

Cent0S7を再インストール  -firewallの設定変更とかポート番号の変更とか-

Last updated at Posted at 2017-09-30

さくらVPSにCentOS6をインストールし、ユーザーの追加やポートの変更apacheのインストール。。。などなどすまし、GitlabをインストールしてWordPressもインストールしたところで
うっかり

yum security update

したら、カーネルパニックになってしまい、色々試したのですが、直せず^^;

諦めてOSを再インストールすることにしました。
なんとなくCentOS7にしてみた。

前回とおなじくこちらの記事を参考に、apacheのインストールまで済ませて、
http://knowledge.sakura.ad.jp/beginner/2978/
ブラウザで確認したら、エラー表示でした。

原因はfirewallでhttpが開いておりませんでした。
# firewall-cmd --list-all
したら、以下の内容(sshしか開いていない。)

public (active)
target: default
icmp-block-inversion: no
interfaces: eth0
sources:
services: dhcpv6-client ssh
ports:
protocols:
masquerade: no
forward-ports:
source-ports:
icmp-blocks:
rich rules:`

なので、
# firewall-cmd --permanent --add-service=http

# firewall-cmd --reload
して、httpを追加
以下のようになりました。

public (active)
target: default
icmp-block-inversion: no
interfaces: eth0
sources:
services: dhcpv6-client ssh http
ports:
protocols:
masquerade: no
forward-ports:
source-ports:
icmp-blocks:
rich rules:`

これで、ブラウザ確認したら、 CentOSの画面が無事表示^o^

あと、以下の記事を参考に yum update したときに
カーネルさんがアップデートしないようにしました。
http://altenergy-system.com/archives/2982

この記事の通り、カーネルもアップデートするようにしなくちゃいけないみたいなんですけど、
今の段階ではそれは諦めることに。

あと、CentOS7でのsshのポート番号変更は、こちらの記事がわかりやすかったです
https://qiita.com/fk_2000/items/019b62818e34be973227

1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1