Quantcast
Channel: Bashタグが付けられた新着記事 - Qiita
Viewing all articles
Browse latest Browse all 2811

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

$
0
0

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"# 接続を受け付けるポート
Listen80# レスポンスするドキュメントのルートディレクトリ
DocumentRoot"/var/www/html"

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

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

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

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


Viewing all articles
Browse latest Browse all 2811

Trending Articles