Invalid response acme-challenge/ 400

OK, some progress. First, change the VirtualHost statement in webmin.1675970250.conf to also be:

<VirtualHost *:80>

Second, remove the portman.com.conf file.

Third, show the contents of this file with 3 backticks before and after

/etc/apache2/sites-enabled/portman.no-ip.biz.conf
3 Likes

contents of portman.no-ip.biz.conf:

<VirtualHost *:80>
    DocumentRoot /var/www/html
    ServerName portman.no-ip.biz
    <Directory "/var/www/html">
        Options None
        Require all granted
    </Directory>
    RewriteEngine on
    RewriteCond %{SERVER_NAME} =portman.no-ip.biz
    RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]
</VirtualHost>

I did notice the directory listings are not the same for all the files:

drwxr-xr-x 2 root root 4096 Mar 21 09:21 .
drwxr-xr-x 8 root root 4096 Mar 20 22:20 ..
lrwxrwxrwx 1 root root   35 Sep 15  2021 000-default.conf -> ../sites-available/000-default.conf
lrwxrwxrwx 1 root root   52 Nov 12  2021 000-default-le-ssl.conf -> /etc/apache2/sites-available/000-default-le-ssl.conf
lrwxrwxrwx 1 root root   51 Mar 20 16:49 portman.no-ip.biz.conf -> /etc/apache2/sites-available/portman.no-ip.biz.conf
lrwxrwxrwx 1 root root   56 Mar 20 10:00 smartvestoraltoona.com.conf -> /etc/apache2/sites-available/smartvestoraltoona.com.conf
lrwxrwxrwx 1 root root   63 Mar 20 16:45 smartvestoraltoona.com-le-ssl.conf -> /etc/apache2/sites-available/smartvestoraltoona.com-le-ssl.conf
-rw-r--r-- 1 root root  315 Mar 21 08:47 vimcor.com.conf
lrwxrwxrwx 1 root root   51 Feb  9 14:17 webmin.1675970250.conf -> /etc/apache2/sites-available/webmin.1675970250.conf
lrwxrwxrwx 1 root root   58 Mar 20 16:45 webmin.1675970250-le-ssl.conf -> /etc/apache2/sites-available/webmin.1675970250-le-ssl.conf

If you finished changing the VirtualHost in the webmin conf please show this again.

sudo apachectl -t -D DUMP_VHOSTS

Thanks for the directory list. Your Apache config is a mess. It will take some time to sort it out.

2 Likes

Yes, it is a mess.... got fouled up when I tried to install joomla to restore an old site, but joomla did not install correctly and I had to go to wordpress to get my site up in time for clients to reserve tax preparation appointments. My 'web host' I was using with my internet provider bit the dust... cant get it to even load the control panel... that is what started all of this hassle....

results of apachectl request:

VirtualHost configuration:
*:443                  is a NameVirtualHost
         default server portman.no-ip.biz (/etc/apache2/sites-enabled/000-default-le-ssl.conf:2)
         port 443 namevhost portman.no-ip.biz (/etc/apache2/sites-enabled/000-default-le-ssl.conf:2)
         port 443 namevhost smartvestoraltoona.com (/etc/apache2/sites-enabled/smartvestoraltoona.com-le-ssl.conf:2)
         port 443 namevhost vimcor.com (/etc/apache2/sites-enabled/webmin.1675970250-le-ssl.conf:2)
*:80                   is a NameVirtualHost
         default server portman.no-ip.biz (/etc/apache2/sites-enabled/portman.no-ip.biz.conf:1)
         port 80 namevhost portman.no-ip.biz (/etc/apache2/sites-enabled/portman.no-ip.biz.conf:1)
         port 80 namevhost smartvestoraltoona.com (/etc/apache2/sites-enabled/smartvestoraltoona.com.conf:1)
         port 80 namevhost vimcor.com (/etc/apache2/sites-enabled/vimcor.com.conf:1)
         port 80 namevhost vimcor.com (/etc/apache2/sites-enabled/webmin.1675970250.conf:1)

Ok, make a backup of your vimcor.com.conf and then remove it from sites-enabled

And, show contents of this with the 3 backticks

/etc/apache2/sites-enabled/smartvestoraltoona.com-le-ssl.conf

and this too

/etc/apache2/sites-enabled/webmin.1675970250.conf
2 Likes

smartvestoraltoona.com-le-ssl.conf

<IfModule mod_ssl.c>
    <VirtualHost _default_:443>
        DocumentRoot /var/www/html
        ServerName smartvestoraltoona.com

        Include /etc/letsencrypt/options-ssl-apache.conf
        SSLCertificateFile /etc/letsencrypt/live/portman.no-ip.biz/fullchain.pem
        SSLCertificateKeyFile /etc/letsencrypt/live/portman.no-ip.biz/privkey.pem
    </VirtualHost>
</IfModule>

webmin.1675970250.conf

<VirtualHost *:80>
    ServerName vimcor.com
    DocumentRoot /var/www/html
RewriteEngine on
RewriteCond %{SERVER_NAME} =vimcor.com
RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]
</VirtualHost>

Can you look for any .htaccess file for Apache? Because some of the redirects are not done by the VirtualHost's

Also, change <VirtualHost _default_:443> to <VirtualHost *:443> in your smartvestoraltoona conf you just showed

Here is why the domains look wrong in the browser

curl -IL http://smartvestoraltoona.com
(first redirect by VirtualHost to HTTPS is fine)
HTTP/1.1 301 Moved Permanently
Server: Apache/2.4.41 (Ubuntu)
Location: https://smartvestoraltoona.com/

(but that gets redirected to portman.  By .htaccess maybe?  Or WordPress?)
HTTP/1.1 301 Moved Permanently
Server: Apache/2.4.41 (Ubuntu)
X-Redirect-By: WordPress
Location: https://portman.no-ip.biz/

(which ends up at portman)
HTTP/1.1 200 OK
Server: Apache/2.4.41 (Ubuntu)
Link: <https://portman.no-ip.biz/index.php/wp-json/>; rel="https://api.w.org/"
(other headers omitted)
2 Likes

This file is in the wrong directory:

It should have been enabled from the sites-available directory [like all the others].

2 Likes

Agree that's the right method for conf files. But, this looks like a duplicate of the file below so I already asked them to remove the vimcor.com.conf copy entirely (after making a backup copy).

webmin.1675970250.conf
3 Likes

the only .htaccess file is see is from /var/www/html:


# BEGIN WordPress
# The directives (lines) between "BEGIN WordPress" and "END WordPress" are
# dynamically generated, and should only be modified via WordPress filters.
# Any changes to the directives between these markers will be overwritten.
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

# END WordPress

Check your WordPress config. Something in it must be doing the redirect.

Once you get that fixed we can continue and ensure your certs for all 3 domains can be renewed.

3 Likes

I was able to renew the certs (well, before all the recent changes). So, yes, we should check again after we find this issue.

1 Like

I did not see an .htaccess file in wordpress, but I did change one setting in the settings screen. Now when going to vimcor.com the url stays vimcor.com, as it does if you enter portman.no-ip.biz. However, smartvestoraltoona.com can no longer be reached.

Keep working on that setting. Now all 3 of your domains get sent to vimcor so it definitely did something. Even portman goes there now as shown:

curl -IL https://portman.no-ip.biz
HTTP/1.1 301 Moved Permanently
Server: Apache/2.4.41 (Ubuntu)
X-Redirect-By: WordPress
Location: https://vimcor.com/

HTTP/1.1 200 OK
Date: Tue, 21 Mar 2023 22:00:14 GMT
Server: Apache/2.4.41 (Ubuntu)
Link: <https://vimcor.com/index.php/wp-json/>; rel="https://api.w.org/"
Link: <https://vimcor.com/index.php/wp-json/wp/v2/pages/2>; rel="alternate"; 
3 Likes

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.