Ubuntu 12.04 // The apache plugin is not working; there may be problems with your existing configuration


#1

Please fill out the fields below so we can help you better. Note: you must provide your domain name to get help. Domain names for issued certificates are all made public in Certificate Transparency logs (e.g. https://crt.sh/?q=example.com), so withholding your domain name here does not increase secrecy, but only makes it harder for us to provide help.

Hi there,

I’m attempting to use a LE cert on one of our company’s older web servers. I absolutely apologize that I cannot provide the domain in question but I hope this can be resolved without the need for that. The error states that it cannot parse a line in the apache config file that is used exclusively for SSL Vhosts.

Line 837 cannot be parsed. It is the bottom line in that file and only contains the following:

</VirtualHost>

I don’t see any problem with the syntax here. What am I doing wrong or what can I do to fix this? I appreciate it is on an older platform but this cannot be upgraded easily hence I’m hoping to find a fix for this!

Thanks! More info below:

My domain is:
<private sorry!>

I ran this command:
./certbot-auto --apache certonly

It produced this output:
Could not choose appropriate plugin: The apache plugin is not working; there may be problems with your existing configuration.
The error was: PluginError(‘There has been an error in parsing the file /etc/apache2/ssl-vhost.conf on line 837: Syntax error’,)

My web server is (include version):
Apache 2.2.22

The operating system my web server runs on is (include version):
Ubuntu 12.04

My hosting provider, if applicable, is:
n/a

I can login to a root shell on my machine (yes or no, or I don’t know):
yes

I’m using a control panel to manage my site (no, or provide the name and version of the control panel):
No


#2

Hi @spawnsworth,

Could you please show the output of this command?.

sed -n 830,840p /etc/apache2/ssl-vhost.conf

Cheers,
sahsanu


#3

Thanks! The output is below:

     sed -n 830,840p /etc/apache2/ssl-vhost.conf
                        <FilesMatch "\.css$">
                        ForceType text/css
                        </FilesMatch>


</Directory>
</VirtualHost>

#4

That is strange, the command should show 10 lines, or if line 837 is the last line it should show 8 lines but I only see 7.

830                         <FilesMatch "\.css$">
831                        ForceType text/css
832                        </FilesMatch>
833
834
835 </Directory>
836 </VirtualHost>

Please show the output of these commands:

sed -n 830,840p /etc/apache2/ssl-vhost.conf | cat -A
sed -n 837p /etc/apache2/ssl-vhost.conf | cat -A

#5

Ha. Good point! I called the file up in vi and displayed line numbers. Sorry but it appears that there are only 836 lines in the file! The error states it cannot parse line 837. When I ‘goto’ line 837 it takes me to the bottom line which is actually 836.

There’s nothing else after 836 it is absolutely the last line of the file so is there something else that should be in place to precent certbot from trying to parse anything beyond the bottom line?

836


#6

Maybe it is because a strange character in previous lines.

Show this output please:

sed -n 830,840p /etc/apache2/ssl-vhost.conf | cat -A


#7

OK! …

/home/tibus# sed -n 830,840p /etc/apache2/ssl-vhost.conf | cat -A
                        <FilesMatch "\.css$">$
                        ForceType text/css$
                        </FilesMatch>$
$
$
</Directory>$
</VirtualHost>$

Thanks :slight_smile:


#8

Sorry but that seems right to me, maybe the problem starts before that… let’s call certbot developers so they can check this issue.

@bmw, @joohoi, could you please be so kind and take a look to this Apache conf parsing issue?.

Cheers,
sahsanu


#9

Could you maybe post the actual Apache configuration file, replacing the domain name with example.com if necessary?

Also, hopefully you’re a Canonical customer to receive extended support if you’re still running 12.04—otherwise software updates ended last year.

https://www.ubuntu.com/info/release-end-of-life


#10

Does the file happen to begin with something like this?

<IfModule mod_ssl.c>

If so you need to add this at the end:

</IfModule>

#11

OMG you nailed it!

Absolutely spot on. I can’t believe that hasn’t broke anything. The file has been untouched for months!

Working brilliant now thank you very much for all the help guys!


#12

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