Ssl – The requested URL was not found on this server

amazon ec2amazon-web-servicesApache2sslssl-certificate

I am trying to enable SSL for port 4100 for an Amazon EC2 Instance. When I access the site https://test.example.com:4100/login, I get an error as follows – The requested URL /login was not found on this server. Can someone please help me?

I've modified httpd.conf as below –

<IfModule mod_ssl.c>
NameVirtualHost *:4100
Listen 4100
</IfModule>
<VirtualHost *:4100>
ServerName test.example.com
SSLProxyEngine on
SSLEngine on
SSLCertificateKeyFile /etc/letsencrypt/live/test.example.com/privkey.pem
SSLCertificateFile /etc/letsencrypt/live/test.example.com/cert.pem
SSLCertificateChainFile /etc/letsencrypt/live/test.example.com/fullchain.pem
DocumentRoot /var/www/html/

ssl.conf

Listen 443
<VirtualHost _default_:443>
SSLProxyEngine on
SSLEngine on
SSLCertificateKeyFile /etc/letsencrypt/live/test.example.com/privkey.pem
SSLCertificateFile /etc/letsencrypt/live/test.example.com/cert.pem
SSLCertificateChainFile /etc/letsencrypt/live/test.example.com/fullchain.pem
<VirtualHost>

Best Answer

In ssl.conf in below lines, replace 443 by 4100

Listen 443

VirtualHost default:443

Then restart apache.

Also, Add custom rule/TCP to listen on port 4100 in AWS security rules

Related Topic