Webサーバーの設定

Webページを表示したり、Wordpressを利用するためにはhttpサーバーアプリケーション(httpd)が必要です。代表的なものは「Apache(アパッチ)」があります。
他には「nginx(エンジンエックス)」というhttpサーバーアプリケーションもあります。

ここでは「Apache(アパッチ)」を取り扱います。

 

Apacheをインストールする

$ sudo yum install httpd
読み込んだプラグイン:fastestmirror, langpacks
Loading mirror speeds from cached hostfile
.
.
.
etc…

 

Webサーバーの設定

httpdを起動する

$ sudo systemctl start httpd

 

サーバー再起動時にhttpdも起動するようにする

$ sudo systemctl enable httpd.service

 

Webサーバーの設定の確認

$ systemctl list-unit-files -t service

 

「/」を入力し、次に「httpd.service」を入力し検索する。
enabledとなっていればOK。

.
.
.
httpd.service enabled
initrd-cleanup.service static
initrd-parse-etc.service static
initrd-switch-root.service static
initrd-udevadm-cleanup-db.service static
.
.
.
etc…

 

Webサイトが表示されることを確認

自分のIPアドレスにアクセスして何か表示されたらWebサーバーの設定はOK。
http://xxx.xxx.xxx.xxx/

 

参照元情報

CentOS 7 構築・運用・管理パーフェクトガイド
CentOS 7 構築・運用・管理
パーフェクトガイド