0

I have a self-hosted lubuntu server on my LAN which has some services useful for my net (a wordpress in /var/www/html, an owncloud, and a flask app). The problem is that some days ago I installed a self signed ssl certificate which worked perfectly but now I have the following error:

[Tue Nov 24 17:06:00.072579 2020] [mpm_prefork:notice] [pid 8938] AH00169: caught SIGTERM, shutting down
[Tue Nov 24 17:06:00.334836 2020] [ssl:warn] [pid 9005] AH01906: miservidor.com:443:0 server certificate is a CA certificate (BasicConstraints: CA == TRUE !?)
[Tue Nov 24 17:06:00.461929 2020] [ssl:warn] [pid 9019] AH01906: miservidor.com:443:0 server certificate is a CA certificate (BasicConstraints: CA == TRUE !?)
[Tue Nov 24 17:06:00.507795 2020] [mpm_prefork:notice] [pid 9019] AH00163: Apache/2.4.41 (Ubuntu) OpenSSL/1.1.1g mod_wsgi/4.6.8 Python/2.7 configured -- resuming normal operations
[Tue Nov 24 17:06:00.516896 2020] [core:notice] [pid 9019] AH00094: Command line: '/usr/sbin/apache2'

These are my config files:

/etc/apache2/sites-available/000-default.conf

<VirtualHost *:80>
        ServerAdmin webmaster@localhost
        ServerName www.miservidor.com
        Redirect / https://miservidor.com/

        DocumentRoot /var/www/html

        ErrorLog ${APACHE_LOG_DIR}/error.log
        CustomLog ${APACHE_LOG_DIR}/access.log combined
        <Directory /var/www/html/>
            AllowOverride All
            Require all granted
        </Directory>
</VirtualHost>

/etc/apache2/sites-available/default-ssl.conf

<IfModule mod_ssl.c>
        <VirtualHost _default_:443>
                ServerName miservidor.com
                DocumentRoot /var/www/html
                ServerAlias www.miservidor.com
                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
                SSLUseStapling off
                <FilesMatch "\.(cgi|shtml|phtml|php)$">
                                SSLOptions +StdEnvVars
                </FilesMatch>
                <Directory /usr/lib/cgi-bin>
                                SSLOptions +StdEnvVars
                </Directory>
           <Directory /var/www>
                AllowOverride All
                Require all granted
           </Directory>

        </VirtualHost>
</IfModule>

I have created several certificates since the day it worked but with any success. I can acces to my server without problem directly with my IP but not with the domain. Any ideas? Thanks in advance.

[EDIT]

After running the command:

wget -o log.txt miservidor.com

The output is:

--2020-11-25 09:47:29--  http://miservidor.com/
Resolving miservidor.com (miservidor.com)... 82.98.135.44
Connecting to miservidor.com (miservidor.com)|82.98.135.44|:80... connected.
HTTP request sent, awaiting response... 302 Found
Location: https://hosting.tucuenta.es/cart.php?gid=1 [following]
--2020-11-25 09:47:30--  https://hosting.tucuenta.es/cart.php?gid=1
Resolving hosting.tucuenta.es (hosting.tucuenta.es)... 82.98.134.62
Connecting to hosting.tucuenta.es (hosting.tucuenta.es)|82.98.134.62|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: unspecified [text/html]
Saving to: 'index.html.3'

     0K .......... .......... .......... ...                   1.60M=0.02s

2020-11-25 09:47:41 (1.60 MB/s) - 'index.html.3' saved [34578]

And the problem is that the page that is downloading it isn't my server on my lan, it's another page on the internet.

[EDIT] This is the output if i try to access with:

wget -o log.txt https://192.168.1.189


--2020-11-25 09:59:10--  https://192.168.1.189/
Connecting to 192.168.1.189:443... connected.
ERROR: The certificate of '192.168.1.189' is not trusted.
ERROR: The certificate of '192.168.1.189' doesn't have a known issuer.
The certificate's owner does not match hostname '192.168.1.189'
g5fighter
  • 25
  • 1
  • 2
  • 6
  • Why do you think this is an error? There is no error message in your log. Just notices and warnings which are completely normal for self signed certificates. What error do you encounter? – Gerald Schneider Nov 25 '20 at 08:26
  • I know that is not an error itself, but when it worked before i didn't get that, also, i think i have all well configured but i still can´t acces to my server via domain even if it is configured on my router dns table – g5fighter Nov 25 '20 at 08:29
  • I don't know if i can show other useful information which can make more easy to understand whats happening – g5fighter Nov 25 '20 at 08:30
  • Use wget or curl to access your server with verbose output and server headers and edit the complete output into your question. – Gerald Schneider Nov 25 '20 at 08:31
  • It returns another page – g5fighter Nov 25 '20 at 08:52
  • Is the hostname resolved to the correct IP address? – Gerald Schneider Nov 25 '20 at 08:55
  • No, i think it should return my private ip whic is 192.168.1.189, and is returning the ip of the other website. – g5fighter Nov 25 '20 at 08:58
  • Then you should correct your DNS entries. Your problem is not Apache, and for sure not the certificates. – Gerald Schneider Nov 25 '20 at 09:01
  • Ok, you were right, i have deleted the name on the dns and then i put the domain another time, and it worked, thanks. Put it as answer and I will mark as correct – g5fighter Nov 25 '20 at 09:04

1 Answers1

0

Your DNS server is resolving the wrong IP address for your hostname.

Correct your DNS entries.

Gerald Schneider
  • 23,274
  • 8
  • 57
  • 89