0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

WEBサーバー(apache)のインストール&設定ファイル

0
Last updated at Posted at 2020-05-31

CentOsでapacheをインストール

 yum install httpd.x86_64

ファイアウォールの設定でhttpdへの接続を許可する

# 現在のファイアウォールの設定を確認
 firewall-cmd --list-service
dhcpv6-client dns nfs ssh
# httpdへの接続許可 
 firewall-cmd --add-service=http --zone=public --permanent
success
# firewalld.serviceを再起動し、設定が反映されているか確認
 systemctl restart firewalld
 firewall-cmd --list-service
dhcpv6-client dns http nfs ssh

設定ファイルは

/etc/httpd/conf/httpd.conf
# apacheの作業ディレクトリ
ServerRoot "/etc/httpd"
# 接続を受け付けるポート
Listen 80
# レスポンスするドキュメントのルートディレクトリ
DocumentRoot "/var/www/html"

1つのサーバーで複数のサイトを提供する方法

名前ベースのバーチャルホスト


IPベースのバーチャルホスト


バーチャルホストについては後日改めて追記する

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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?