apache2 config help needed

no, that's fine as it is.

Just to confirm the error is in the default-ssl try

a2dissite default-ssl

which will disable the default-ssl config, and then check that apache2 will restart

if it does, then we know the error is just in the default-ssl.conf file

sudo a2dissite default-ssl
Site default-ssl disabled.
To activate the new configuration, you need to run:
service apache2 reload

sudo service apache2 reload
Job for apache2.service failed. See ‘systemctl status apache2.service’ and ‘journalctl -xn’ for details.

sudo service apache2 restart

(the last one returned the $ without error and my website is working again)

ok,

the "reload" failed because it wasn't running - hence couldn't reload. The restart worked which shows the problem is in the default-ssl.conf

what is at line 134 ? if it's around the

        BrowserMatch "MSIE [2-6]" \
                        nokeepalive ssl-unclean-shutdown \
                        downgrade-1.0 force-response-1.0
        # MSIE 7 and newer should be able to use keepalive
        BrowserMatch "MSIE [17-9]" ssl-unclean-shutdown

then comment out all those lines ( with a # at the start of the line) and try the a2ensite default-ssl again followed by an apache restart .... and see what happens. If it's not around those lines, then what is at line 134 ?

[Syntax error on line 134 of /etc/apache2/sites-enabled/default-ssl.conf: without matching section

in /etc/apache2/sites-enabled there’s no default-ssl.conf only 000-default.conf

Yeah, the config file is moved because you executed sudo a2dissite default-ssl… It’s now somewhere in /sites-available/ or something? I’m not very familiar with Debian based Apache setups, but it’s around there somewhere… Just not in /sites-enabled/…

if you edit the default-ssl.conf file … at the beginning, there is a line ( around line 2?) that’s something like default: 443 ( within angle brackets.

At the end is /VirtualHost ( again within angled brackets )

Check that the oe at the beginning is “VirtualHost default: 443” (within the angled brackets). The angled brackets won’t paste here nicely.

[offtopic]You can use many HTML tags, including the well known HTML character entities < and >. And yes, I had to type & to make those &'s :stuck_out_tongue:

1 Like

I’m not sure what you mean by angled brackets but if you mean the closing tag (on my keyboard its next to the M)
well, it was missing in the first line, I’ve put it back

Yes, those are the ones < and >

It’s those tags and the words in them that it’s complaining don’t match.

open tag IfModule mod_ssl.c (other bracket)
open tag VirtualHost default: 443 (other bracket)

close tag VirtualHost (other bracket)
close tag IfModule (other bracket)

Now it’s like this. Shall I try a2ensite again?

The error says

Syntax error on line 134 of /etc/apache2/sites-enabled/default-ssl.conf: without matching section

so this means that there is no matching section to the closing tag.

If the closing tag is </VirtualHost> then there need to be a corresponding opening tag.

looking at what you posted above you have " <default: 443> " - it needs changing to <VirtualHost default: 443>

Correct - that looks better now - try that ( we posted at the same time above )

here we go again:
Job for apache2.service failed. See ‘systemctl status apache2.service’ and ‘journalctl -xn’ for details.

systemctl status apache2.service
● apache2.service - LSB: Apache2 web server
Loaded: loaded (/etc/init.d/apache2)
Active: active (running) (Result: exit-code) since vr 2016-01-15 22:44:50 CET; 38min ago
Process: 2959 ExecStop=/etc/init.d/apache2 stop (code=exited, status=0/SUCCESS)
Process: 3815 ExecReload=/etc/init.d/apache2 reload (code=exited, status=1/FAILURE)
Process: 3515 ExecStart=/etc/init.d/apache2 start (code=exited, status=0/SUCCESS)
CGroup: /system.slice/apache2.service
├─3530 /usr/sbin/apache2 -k start
├─3534 /usr/sbin/apache2 -k start
├─3535 /usr/sbin/apache2 -k start
├─3536 /usr/sbin/apache2 -k start
├─3537 /usr/sbin/apache2 -k start
├─3538 /usr/sbin/apache2 -k start
├─3552 /usr/sbin/apache2 -k start
├─3554 /usr/sbin/apache2 -k start
├─3555 /usr/sbin/apache2 -k start
├─3557 /usr/sbin/apache2 -k start
└─3558 /usr/sbin/apache2 -k start

journalctl -xn
No journal files were found.

OK, so follow the logic and log files ( which tell you the error lines etc - and which tags are not matching )

I’m sorry but I don’t understand what to do. I looked at the error log

Jan 15 23:40:40 katbulk rsyslogd-2007: action ‘action 17’ suspended, next retry is Fri Jan 15 23:42:10 2016 [try http://www.rsyslog.com/e/2007 ]

I think I have to do something with this;
Process: 3815 ExecReload=/etc/init.d/apache2 reload (code=exited, status=1/FAILURE)

Its midnight here, I cant see it anymore. I come back tomorrow with a fresh brain:-)

your syslog should give you the important clues.

this is the syslog:

configtest failed. Not doing anything. … (warning).
Jan 15 23:22:58 katbulk apache2[3815]: Output of config test was:
Jan 15 23:22:58 katbulk apache2[3815]: [Fri Jan 15 23:22:58.683175 2016] [core:error] [pid 3824] (EAI 2)Name or service not $
Jan 15 23:22:58 katbulk apache2[3815]: AH00526: Syntax error on line 2 of /etc/apache2/sites-enabled/default-ssl.conf:
Jan 15 23:22:58 katbulk apache2[3815]: Missing address for VirtualHost
Jan 15 23:22:58 katbulk apache2[3815]: Action ‘configtest’ failed.
Jan 15 23:22:58 katbulk apache2[3815]: The Apache error log may have more information.

So I looked at the error.log but no entries were added in that time

[Fri Jan 15 22:44:50.018052 2016] [core:notice] [pid 3530] AH00094: Command line: ‘/usr/sbin/apache2’
[Sat Jan 16 01:25:42.179031 2016] [mpm_prefork:notice] [pid 3530] AH00169: caught SIGTERM, shutting down

And ofcourse you’ve already checked line 2 of /etc/apache2/sites-enabled/default-ssl.conf I assume? What could be wrong with the VirtualHost at that line?
Secondly, I assume you’ve read all about Apaches <VirtualHost> section and what parameters are mandatory?

this is line 2 : > <VirtualHost default: 443>
I cant see what the error is

I don’t know if that’s the whole line, but it doesn’t look like a normal Apache directive/block…

This forum parses HTML codes, so perhaps you can embed the whole line in `…` (backticks, most of the time left of the “1” key on your keyboard)?

And perhaps a little bit of context? A few lines above and below.

Ah, I saw the .conf file in the 11th post in this thread. Probably, the line is <default: 443> (based on that post… Which is strange, because then you’ll be missing the VirtualHost part.) You could try <VirtualHost *:443>. In essence the same as ‘default’, but the Apache docs say _default_ is an alias for *. I didn’t see any underscores in your line, but if you just use a *, it’ll be all the same and work nicely.) I assume you won’t do any IP-based virtual hosting, only name-based?