コンテンツへスキップ

[ノート] CentOS 7 HTTPサービス構築

2022年6月21日

Apacheサービス

DNS設定

NIC IP: 192.168.1.100、DNSは自身を指す、ドメイン: infanx.com

HTTP設定

yum install -y httpd*

/etc/httpd/conf/httpd.conf を編集:

<virtualhost *:80>
  documentroot /www/infanx
  servername infanx.com
  directoryindex index.html
</virtualhost>
mkdir -p /www/infanx
echo "Hello World!" > /www/infanx/index.html
systemctl restart httpd
curl http://infanx.com  # テスト

ユーザーベースのアクセス制御、ディレクトリアクセスモード、IP/ドメイン制限、仮想ディレクトリ設定もカバー。

前の記事
先電IaaS 2.4クラウド基盤構築
次の記事
[ノート] CentOS 7 FTPサービス構築