Apache plugin having trouble with a specific conf file


#1

First of all, I’m very impressed with LetsEncrcypt and I’m very excited. It works really well and I only found one problem on a single host. Here is what happened.

When running the client, it failed with this message:
No installers seem to be present and working on your system; fix that or try running letsencrypt with the "certonly" command

That seemed to be wrong, because Apache2 is installed and so I called the client again with the --apache option and then I got a different error message:
The error was: PluginError(('There has been an error in parsing the file (%s): %s', u'/etc/apache2/sites-enabled/openphoto.conf', u'Syntax error'),)

I looked into that file and it seemed to be OK. I also ran apachectl configtest and that was happy with the configuration too.

Only when I removed that file the client was complaining about was I able to continue.

The content of that file is this:

<VirtualHost *:80>
  ServerName  photos.example.com

  DocumentRoot /var/www/openphoto.tcg/src/html

  <Directory "/var/www/openphoto.tcg/src/html">
    Order deny,allow
    Allow from all

    RewriteEngine on
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)\?*$ index.php?__route__=/$1 [L,QSA]

    # 403 Forbidden for ini files
    #RewriteRule \.ini$ - [F,NC]

    AddOutputFilterByType DEFLATE text/plain
    AddOutputFilterByType DEFLATE text/html
    AddOutputFilterByType DEFLATE text/css
    AddOutputFilterByType DEFLATE application/x-javascript
    AddOutputFilterByType DEFLATE text/javascript
    BrowserMatch ^Mozilla/4 gzip-only-text/html
    BrowserMatch ^Mozilla/4\.0[678] no-gzip
    BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
  </Directory>

  # 404 Not Found for ini files
  AliasMatch \.ini$    /404

  ExpiresActive On
  ExpiresByType text/javascript "A31536000"
  ExpiresByType application/x-javascript "A31536000"
  ExpiresByType text/css "A31536000"
  ExpiresByType image/x-icon "A31536000"
  ExpiresByType image/gif "A604800"
  ExpiresByType image/jpg "A604800"
  ExpiresByType image/jpeg "A604800"
  ExpiresByType image/png "A604800"

  Header set Cache-Control "must-revalidate"
  FileETag MTime Size
</VirtualHost>

Any idea what’s the problem?


#2

The LE client is less forgiving than Apache when it comes to parsing syntax. For example there are supposed to be more quotes in your RewriteRule line (see the Apache doc for correct syntax). The Apache server parses the lines without giving any warnings but the LE client hard faults.


#3

Yes, I was already thinking that was the case. Thanks for your reply @Svavar_Kjarrval

In terms of feedback for the beta phase of the LE client I was just thinking that the other case, where the client responded with feedback that no installers seem to be present is misleading. Remember, I was only getting to the detailed error message when forcing to the apache plugin but not when calling the LE client without parameters - which is what most users would probably do.