LoginSignup
1
0

More than 3 years have passed since last update.

CentOS7にApache2.4.6をインストールする。

Posted at

VMwareで作成した仮想環境(CentOS7)にapacheをインストールしてブラウザから確認する。

インストール

Apacheのインストール

yum install httpd -y

Apacheの自動起動設定

systemctl enable httpd

Apacheの設定確認

※enabledと表示されればOK

systemctl is-enabled httpd

Apahce起動

systemctl start httpd

停止  :systemctl stop httpd
再起動 :systemctl restart httpd
状態確認:systemctl status httpd

ファイアウォールでhttpを許可

※Port80:http
※firewall-cmd --permanent オプション
サーバ再起動やfirewalld reload時に恒久的に設定を反映させる。

firewall-cmd --permanent --add-port=80/tcp

ファイアウォールでhttpsを許可

※Port443:https

firewall-cmd --permanent --add-port=443/tcp

ファイアウォールの設定を反映

firewall-cmd --reload

以上でインストール完了
サーバのIPにアクセスしテストページが表示されればOK
http://IPアドレス/

image.png

1
0
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
0