0

OS: Ubuntu 16.04

I'm trying to enable a self-signed certificate for apache. I already created the certs with the following command:

sudo openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout /etc/ssl/private/apache-selfsigned.key -out /etc/ssl/certs/apache-selfsigned.crt

My default-ssl.conf is:

        <VirtualHost _default_:443>
                ServerAdmin webmaster@test.de
                ServerName pvapp.test-campus.de
                DocumentRoot /var/www/client/pvapp-client/dist

                ErrorLog ${APACHE_LOG_DIR}/error.log
                CustomLog ${APACHE_LOG_DIR}/access.log combined

                SSLEngine on

                SSLCertificateFile    /etc/ssl/certs/apache-selfsigned.crt
                SSLCertificateKeyFile /etc/ssl/private/apache-selfsigned.key

                <FilesMatch "\.(cgi|shtml|phtml|php)$">
                                SSLOptions +StdEnvVars
                </FilesMatch>
                <Directory /usr/lib/cgi-bin>
                                SSLOptions +StdEnvVars
                </Directory>

                 BrowserMatch "MSIE [2-6]" \
                               nokeepalive ssl-unclean-shutdown \
                               downgrade-1.0 force-response-1.0

        </VirtualHost>

And the testServer.conf for the vhost is:

<VirtualHost *:80>
    ServerAdmin webmaster@test.de
    DocumentRoot /var/www/client/pvapp-client/dist
    Redirect permanent / https://pvapp.test-campus.de

    <Directory /var/www/client/pvapp-client/dist>
        AllowOverride All
        Order allow,deny
        Allow from All

        <IfModule mod_rewrite.c>
            Options -MultiViews
            RewriteEngine On
            RewriteCond %{REQUEST_FILENAME} !-f
            RewriteRule ^(.*)$ app.php [QSA,L]
        </IfModule>
    </Directory>

    ErrorLog ${APACHE_LOG_DIR}/test.com-error.log
    CustomLog ${APACHE_LOG_DIR}/test.com-access.log combined
</VirtualHost>

I'm redirecting to an https://.... page but can't reach the page. Without that redirect it's working on the standard IP but it's just http. Conf files are enabled with a2ensite and firewall checked.

When calling the website in chrome its responding "couldn't fine the server IP".

temp
  • 111
  • 4
  • 1
    That sounds more like a DNS resolution issue than a certificate issue. – tater Nov 10 '20 at 07:31
  • How to figure this out? Or even solve it? @tater – temp Nov 10 '20 at 07:32
  • If you go to `https://pvapp.test-campus.de` directly (forget about the redirect), it will show you that the IP address is not found. You need to create a DNS entry for `pvapp.test-campus.de`. – tater Nov 10 '20 at 07:53
  • @tater Is it done by editing the /etc/hosts file like: 192.168.51.47 pvapp.test-campus.de Sry, really new to this. – temp Nov 10 '20 at 07:57
  • 1
    It appears that `test-campus.de` is not even registered as a domain. Have you registered it? You would need to start with doing that. – tater Nov 10 '20 at 08:08
  • @tater I'm using a virtual server of my university and just working locally on it. Isn't it possible to redirect to https like that? – temp Nov 10 '20 at 08:11
  • @tater Okay, I fixed it by just using the IP in the redirect. Thank you. :) – temp Nov 10 '20 at 08:23

0 Answers0