Amazon linux 2 Apache Webサーバサブドメインの設定


AWSを使用してamazon linux 2がインストールされているサーバにサブドメインを設定する必要がある場合は、
次のパスのファイルを変更すればいいです./etc/httpd/conf.d/vhost.conf
<VirtualHost *:80>
  ServerAdmin [email protected]
  DocumentRoot "/home/foldername/public"
  ServerName subdomain.domain.kr
  ServerAlias subdomain2.domain.kr
</VirtualHost>
これらの設定が完了すると、sudo systemctl restart httpd上記コマンドでApache Webサーバを再起動すると、設定ファイルが適用されます.
subdomain.domain.または
subdomain2.domain.krどこまでつながっても
/home/foldername/publicドキュメンタリールートフォルダに設定されているサーバのこのフォルダに接続します.