logo
Apache Lounge
Webmasters

 

About Forum Index Downloads Search Register Log in RSS X


Keep Server Online

If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.

or

Bitcoin

A donation makes a contribution towards the costs, the time and effort that's going in this site and building.

Thank You! Steffen

Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.
Post new topic   Forum Index -> Apache View previous topic :: View next topic
Reply to topic   Topic: ServerName and ServerAlias with different behaviour. But why
Author
20160413



Joined: 13 Apr 2016
Posts: 28

PostPosted: Sat 02 Jun '18 0:15    Post subject: ServerName and ServerAlias with different behaviour. But why Reply with quote

Apparently I do not know what is going on. Let's Encrpyt challenges were working in the past 18 months but now that I require a login (not an authentication!) everything goes berserk.

"mediawikiwidgets.org.conf"

Code:

<VirtualHost *:80>
   ServerAdmin mail@example.com
   ServerName www.mediawikiwidgets.org
   ServerAlias mediawikiwidgets.org

    <Directory /path/to/doc/root>
      <IfModule mod_rewrite.c>
         RewriteEngine on
         RewriteBase /
         RewriteCond %{REQUEST_URI} !^.well-known/acme-challenge
         RewriteRule ^(.*) https://www.mediawikiwidgets.org/$1 [R=301,L]
      </IfModule>
   </Directory>

   ErrorLog ${APACHE_LOG_DIR}/error.log

   LogLevel warn

   CustomLog "|/usr/bin/rotatelogs -l ${APACHE_LOG_DIR}/%Y%m%d_access.log 86400" combined
</VirtualHost>


Changing to the following does not help either (slash before well-known):

Code:

<VirtualHost *:80>
   ServerAdmin mail@example.com
   ServerName www.mediawikiwidgets.org
   ServerAlias mediawikiwidgets.org

    <Directory /path/to/doc/root>
      <IfModule mod_rewrite.c>
         RewriteEngine on
         RewriteBase /
         RewriteCond %{REQUEST_URI} !^/.well-known/acme-challenge
         RewriteRule ^(.*) https://www.mediawikiwidgets.org/$1 [R=301,L]
      </IfModule>
   </Directory>

   ErrorLog ${APACHE_LOG_DIR}/error.log

   LogLevel warn

   CustomLog "|/usr/bin/rotatelogs -l ${APACHE_LOG_DIR}/%Y%m%d_access.log 86400" combined
</VirtualHost>



ServerName gives me "unauthorized"

https://www.mediawikiwidgets.org/.well-known/acme-challenge/C-CkfkBgKJfNCsAny2O4FLqONa_nFui4ooBKRkpr00I:

and ServerAlias gives me "not found"

http://mediawikiwidgets.org/.well-known/acme-challenge/k4o3RgS5usXycCZ4LEVq0sjOOaaZpqtQ_8IfSwpcJ1o:

Anyways I am follwing the suggestions on this page:

https://www.hyperborea.org/journal/2016/04/redirecting-https-lets-encrypt/

This is working great if your website uses an authorization for https but apparently if it does not it is not working.

cerbot reports the following pain

Code:

 - The following errors were reported by the server:

   Domain: www.mediawikiwidgets.org
   Type:   unauthorized
   Detail: Invalid response from
   http://www.mediawikiwidgets.org/.well-known/acme-challenge/T5iNDzHQ3ddQnND4PTGNi-HLQkZwOwgmrxv2I0qP6DA:
   "<?xml version="1.0" encoding="UTF-8"?>
   <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
     "http://www.w3.org/TR/xhtml1/D"

   Domain: mediawikiwidgets.org
   Type:   unauthorized
   Detail: Invalid response from
   http://mediawikiwidgets.org/.well-known/acme-challenge/ijGABkzaVh3d87Vo0-QF74Kjq77ORQb5Yyy_V2dzJKE:
   "<?xml version="1.0" encoding="UTF-8"?>
   <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
     "http://www.w3.org/TR/xhtml1/D"

   To fix these errors, please make sure that your domain name was
   entered correctly and the DNS A record(s) for that domain
   contain(s) the right IP address.


Any help apprechiated.
Back to top
20160413



Joined: 13 Apr 2016
Posts: 28

PostPosted: Sat 02 Jun '18 8:20    Post subject: Reply with quote

What a mess. I guess I cannot longer do the webroot challenge in this case.

The behaviour for both is different since I have an additional redirect for ServerName in a separate VirtualHost.

I guess it was just too late yesterday.
Back to top


Reply to topic   Topic: ServerName and ServerAlias with different behaviour. But why View previous topic :: View next topic
Post new topic   Forum Index -> Apache