I am having problems configuring my RHEL box to accept HTTPS connections. This is what I have so far:
My RHEL box sits in a DMZ on IP: 172.16.0.3 – I access the website by entering the IP into the browser. I do not have a DNS entry set up for this:
I have a Virtual Host set on the user directory:
/home/mywebapp
I have created a folder within here where I have created my certificate files.
/home/mywebapp/application/certs/
I have used this command to create the certificates:
openssl req -new -x509 -days 365 -keyout 172.16.0.3.key -out 172.16.0.3.crt -nodes -subj ‘/O=My Web App/OU=My Web App IT Dept/CN=172.16.0.3’
Within httpd.conf I have enabled named virtual hosting on 443:
NameVirtualHost *:80
NameVirtualHost *:443
I have configured my Virtual Hosts as follows:
<VirtualHost *:80>
ServerName 172.16.0.3
ServerAlias 172.16.0.3 *.172.16.0.3
DocumentRoot /home/mywebapp/public_html
<Directory "/home/mywebapp/public_html">
allow from all
Options +Indexes
</Directory>
<Location />
RewriteEngine on
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R]
</Location>
</VirtualHost>
<VirtualHost *:443>
ServerName 172.16.0.3
ServerAlias 172.16.0.3 *.172.16.0.3
DocumentRoot /home/mywebapp/public_html
<Directory "/home/mywebapp/public_html">
allow from all
Options +Indexes
</Directory>
SSLEngine On
SSLCertificateFile /home/mywebapp/application/certs/172.16.0.3.crt
SSLCertificateKeyFile /home/mywebapp/application/certs/172.16.0.3.key
</VirtualHost>
This appears to work fine when visiting the site from the server browser eg “https://localhost”, however trying to connect from a client browser via “https://172.16.0.3” fails to connect.
Can anyone point me in the right direction?
iptablefirewallSELinuxif you cannetstat -natp | grep -e 80 -e 443telnet 172.16.0.3 80command from client to check it allowing to make connection.