Я нашел сообщения, в которых говорится об обновлении свойства /etc/httpd/conf/httpd.conf 'Listen' и/или создании < em>VirtualHost, но я в замешательстве... если я добавлю свойство httpd.conf 'Listen 3001', я получу конфликт портов при запуске app, потому что новое свойство сообщает Apache, какие порты следует прослушивать/запускать, поэтому это конфликтует с портом моего приложения.
Для части VirtualHost я попробовал следующее: и он вернул ту же страницу успеха Apache при переходе на https://www.demo.com.
ServerName www.demo.com
Вопросы:
- Как настроить Apache для подключения к порту 3001 моего приложения на https://www. demo.com без конфликта портов? Или порт 80? Приложение может работать на 80.
- Нужен ли мне DocumentRoot или какое-либо другое свойство VirtualHost? В документах показан приведенный ниже пример, но откуда этот путь берется/существует? Входит ли VirtualHost в httpd.conf?
ОБНОВЛЕНИЕ с этапами реализации TLS/SSL
# Here are the instructions from the second link (AWS doc) from my question summarized. I currently run these manually after spinning up the EC2 and installing docker, compose, git repos:
sudo service httpd start
sudo service httpd status
sudo yum update -y
sudo yum install -y mod_ssl
sudo service httpd restart
# Custom key in /etc/pki/tls/private
cd /etc/pki/tls/private
sudo openssl genrsa -out custom.key
sudo chown root.root custom.key
sudo chmod 600 custom.key
cd /etc/pki/tls/private
sudo openssl req -new -key custom.key -out csr.pem
________________________
# Submit the CSR to a CA (godaddy in my case; essentially I rekey the cert with a new csr, wait for approval, then download new crt file)
download cert files
________________________
# Place the new CA-signed certificate and any intermediate certificates in the /etc/pki/tls/certs
cd /etc/pki/tls/certs
sudo vi custom.crt
paste crt file contents downloaded from godaddy (above)
sudo chown root.root custom.crt
sudo chmod 600 custom.crt
cd /etc/pki/tls/private
sudo rm /etc/pki/tls/private/localhost.key
________________________
# Edit /etc/httpd/conf.d/ssl.conf to reflect your new certificate and key files.
Provide the path and file name of the CA-signed host certificate in Apache's SSLCertificateFile directive:
SSLCertificateFile /etc/pki/tls/certs/custom.crt
# I did not do this second step; from godaddy I received a crt and pem (these are same file/contents, and a abc-bundle.crt which I do not use)
If you received an intermediate certificate file
SSLCACertificateFile /etc/pki/tls/certs/intermediate.crt
Provide the path and file name of the private key in Apache's SSLCertificateKeyFile directive:
SSLCertificateKeyFile /etc/pki/tls/private/custom.key
________________________
8. Save /etc/httpd/conf.d/ssl.conf and restart Apache.
sudo service httpd restart
Navigate to URL with https
Подробнее здесь: https://stackoverflow.com/questions/784 ... t-conflict