Apacheのインストール
1.Webサーバのインストール

yum -y install httpd*
yum -y install mod_ssl

 
Apacheの設定
2.バーチャルホストの設定

vi /etc/httpd/conf/httpd.conf

    <VirtualHost *:80>
        DocumentRoot /var/html/www/{hogehoge}
        ServerName {hogehoge}.example.com
    </VirtualHost>
    <VirtualHost *:443>
        DocumentRoot /var/html/www/{hogehoge}
        ServerName {hogehoge}.example.com

        SSLEngine on
        SSLProtocol all -SSLv2
        SSLCipherSuite ALL:!ADH:!EXPORT:!SSLv2:RC4+RSA:HIGH:+MEDIUM:+LOW

        SSLCertificateFile /etc/tls/server.crt
        SSLCertificateKeyFile /etc/tls/server.key
    </VirtualHost>
 
サーバ証明書の作成
3.サーバ証明書の作成

openssl genrsa 2048 > server.key

openssl req -new -key server.key > server.csr

openssl x509 -req -days 3650 -signkey server.key < server.csr > server.crt

 
Apacheの起動
4.Apacheの起動

systemctl enable --now httpd

 
FWの設定
5.ファイヤーウォールの設定

firewall-cmd --permanent --zone=public --add-service={http,https}

firewall-cmd --reload