1. TOP
  2. プログラミング
  3. VPSサーバーの構築 第2回 CentOS7 apache MariaDB PHP7 2018

VPSサーバーの構築 第2回 CentOS7 apache MariaDB PHP7 2018

プログラミング
この記事は約 3 分で読めます。 2,340 Views

Warning: Undefined array key 3 in /home/octo8/dainamo.jp/public_html/wp/wp-content/themes/surfing/lib/table-of-contents-plus/surfing_toc.php on line 1434

Warning: Undefined array key 3 in /home/octo8/dainamo.jp/public_html/wp/wp-content/themes/surfing/lib/table-of-contents-plus/surfing_toc.php on line 1434

Warning: Undefined array key 3 in /home/octo8/dainamo.jp/public_html/wp/wp-content/themes/surfing/lib/table-of-contents-plus/surfing_toc.php on line 1434

Warning: Undefined array key 3 in /home/octo8/dainamo.jp/public_html/wp/wp-content/themes/surfing/lib/table-of-contents-plus/surfing_toc.php on line 1434

Warning: Undefined array key 3 in /home/octo8/dainamo.jp/public_html/wp/wp-content/themes/surfing/lib/table-of-contents-plus/surfing_toc.php on line 1451

Warning: Undefined array key 3 in /home/octo8/dainamo.jp/public_html/wp/wp-content/themes/surfing/lib/table-of-contents-plus/surfing_toc.php on line 1451

Warning: Undefined array key 3 in /home/octo8/dainamo.jp/public_html/wp/wp-content/themes/surfing/lib/table-of-contents-plus/surfing_toc.php on line 1451

Warning: Undefined array key 3 in /home/octo8/dainamo.jp/public_html/wp/wp-content/themes/surfing/lib/table-of-contents-plus/surfing_toc.php on line 1451

Warning: Undefined array key 3 in /home/octo8/dainamo.jp/public_html/wp/wp-content/themes/surfing/lib/table-of-contents-plus/surfing_toc.php on line 1216

Warning: Undefined array key 3 in /home/octo8/dainamo.jp/public_html/wp/wp-content/themes/surfing/lib/table-of-contents-plus/surfing_toc.php on line 1216

Warning: Undefined array key 3 in /home/octo8/dainamo.jp/public_html/wp/wp-content/themes/surfing/lib/table-of-contents-plus/surfing_toc.php on line 1216

Warning: Undefined array key 3 in /home/octo8/dainamo.jp/public_html/wp/wp-content/themes/surfing/lib/table-of-contents-plus/surfing_toc.php on line 1216

Warning: Undefined array key 3 in /home/octo8/dainamo.jp/public_html/wp/wp-content/themes/surfing/lib/table-of-contents-plus/surfing_toc.php on line 1226

Warning: Undefined array key 3 in /home/octo8/dainamo.jp/public_html/wp/wp-content/themes/surfing/lib/table-of-contents-plus/surfing_toc.php on line 1226

Warning: Undefined array key 3 in /home/octo8/dainamo.jp/public_html/wp/wp-content/themes/surfing/lib/table-of-contents-plus/surfing_toc.php on line 1226

Warning: Undefined array key 3 in /home/octo8/dainamo.jp/public_html/wp/wp-content/themes/surfing/lib/table-of-contents-plus/surfing_toc.php on line 1226

Warning: Undefined array key 3 in /home/octo8/dainamo.jp/public_html/wp/wp-content/themes/surfing/lib/table-of-contents-plus/surfing_toc.php on line 1239

Warning: Undefined array key 3 in /home/octo8/dainamo.jp/public_html/wp/wp-content/themes/surfing/lib/table-of-contents-plus/surfing_toc.php on line 1239

Warning: Undefined array key 3 in /home/octo8/dainamo.jp/public_html/wp/wp-content/themes/surfing/lib/table-of-contents-plus/surfing_toc.php on line 1239

Warning: Undefined array key 3 in /home/octo8/dainamo.jp/public_html/wp/wp-content/themes/surfing/lib/table-of-contents-plus/surfing_toc.php on line 1239

前回はCentOS7をインストールとユーザーの作成などを行ってきました。

今回はapacheの設定を行っていきます。
nginxも最近では使用していることも多くなってきましたが、まずはapacheの設定ができれば大丈夫でしょう。

まずは前回と同じようにsshでログインしましょう

忘れてしまった方は前回の記事を参考にしてください

VPSサーバーの構築 第1回 CentOS7 apache MariaDB PHP7 2018

apacheのインストール

まずはapacheのインストールを以下のコマンドで行います。

yum install httpd

yを押して行き完了まで進めます。

これでapacheがインストールされました。

こちらのコマンドでインストールされているか確認しておきましょう

yum list installed

httpdが一覧に表示されれば完了です。

apacheの自動起動設定

サーバーが再起動した時に自動でapacheが起動するように設定します。

systemctl enable httpd

以下のコマンドで確認しておきます

systemctl list-unit-files -t service

httpdの欄が enable になって入れば完了です

httpd.service enabled

httpアクセスを許可する

centOS7では、デフォルトでfirewalldが有効になっており、
デフォルトではhttpにアクセスできないため、WEBページを閲覧することができません。

そのため、firewalldの80番ポートを許可する必要があります。

firewall-cmd --add-service=http --permanent

これで設定が完了しました

次回はドキュメントルート(httpd.conf)の設定を行って行きます。

この設定を完了されることでwebページが見れることになります。

制作のご依頼・ご相談はこちら

dainamoでは魅力的なWEBサイトや、アプリ、ツール、ポスター、パンフレット、チラシなど幅広く承っております。ご相談、見積もり、お問い合わせなど、お気軽にご連絡ください。

今すぐご相談・問い合わせをする

\ SNSでシェアしよう! /

web制作・デザイン・システム開発・管理なら dainamo(ダイナモ)の注目記事を受け取ろう

この記事が気に入ったら
いいね!しよう

web制作・デザイン・システム開発・管理なら dainamo(ダイナモ)の人気記事をお届けします。

  • 気に入ったらブックマーク! このエントリーをはてなブックマークに追加
  • フォローしよう!

ライター紹介 ライター一覧

kz

kz

税金にも詳しいエンジニア

サーバーの構築からフロントエンド、iOSアプリの作成も行います。
WEBアプリや会員サービスの構築を得意としています。

制作物の一部を紹介
・海外旅行者向け事業者サービス
https://vacation-japan.com

・記憶術を使ったWEBアプリ会員サイト

その他、教育アプリetc..

この人が書いた記事  記事一覧

  • 【VPN】自宅のMacから会社のMacにリモートアクセスする場合のVPNの設定と画面共有方法【リモートデスクトップ】

  • Apacheのバージョン情報を隠してセキュリティを向上させる

  • 文字コードとは一体何なのか?MacでCSVの文字コードをUTF-8に変換する

  • 教師ありの機械学習(AI)プログラムを使用して、与えられた文章が何の言語なのか判定する

関連記事

  • VPSサーバーの構築 第5回 CentOS7 apache MariaDB PHP7 2018

  • プログラミングで挫折した時に役立つエンジニア向けサイトまとめ2020

  • VPSサーバーの構築 第4回 CentOS7 apache MariaDB PHP7 2018

  • 【初心者web系エンジニア必見】挫折しない為のポイントとおすすめ学習サービスまとめ(初心者がWeb系エンジニアとして働くために大事なこと1)

  • 産業とデザインの歴史と遷移

  • Webサイトのメンテナンスモードの画面を出す方法と開発者だけ見れるようにする方法【Apache】