# apache2 config help needed

**URL:** https://community.letsencrypt.org/t/apache2-config-help-needed/8854
**Category:** Uncategorized
**Created:** [January 14, 2016, 3:06pm UTC](https://community.letsencrypt.org/t/apache2-config-help-needed/8854 "2016-01-14T15:06:03Z")
**Posts on this page:** 20
**Page:** 2

<div class="post-metadata">

### Author: ![serverco](https://sea3.discourse-cdn.com/letsencrypt/user_avatar/community.letsencrypt.org/serverco/32/4251_2.png) [@serverco](https://community.letsencrypt.org/u/serverco)
#### Post date: [January 15, 2016, 9:41pm UTC](https://community.letsencrypt.org/t/apache2-config-help-needed/8854/21 "2016-01-15T21:41:29Z")

</div>

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

---

<div class="post-metadata">

### Author: ![watewwer](https://avatars.discourse-cdn.com/v4/letter/w/e47c2d/32.png) [@watewwer](https://community.letsencrypt.org/u/watewwer)
#### Post date: [January 15, 2016, 9:47pm UTC](https://community.letsencrypt.org/t/apache2-config-help-needed/8854/22 "2016-01-15T21:47:00Z")

</div>

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)

---

<div class="post-metadata">

### Author: ![serverco](https://sea3.discourse-cdn.com/letsencrypt/user_avatar/community.letsencrypt.org/serverco/32/4251_2.png) [@serverco](https://community.letsencrypt.org/u/serverco)
#### Post date: [January 15, 2016, 9:52pm UTC](https://community.letsencrypt.org/t/apache2-config-help-needed/8854/23 "2016-01-15T21:52:32Z")

</div>

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 ?

---

<div class="post-metadata">

### Author: ![watewwer](https://avatars.discourse-cdn.com/v4/letter/w/e47c2d/32.png) [@watewwer](https://community.letsencrypt.org/u/watewwer)
#### Post date: [January 15, 2016, 9:56pm UTC](https://community.letsencrypt.org/t/apache2-config-help-needed/8854/24 "2016-01-15T21:56:34Z")

</div>

[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

---

<div class="post-metadata">

### Author: ![Osiris](https://avatars.discourse-cdn.com/v4/letter/o/839c29/32.png) [@Osiris](https://community.letsencrypt.org/u/Osiris)
#### Post date: [January 15, 2016, 10:01pm UTC](https://community.letsencrypt.org/t/apache2-config-help-needed/8854/25 "2016-01-15T22:01:53Z")

</div>

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/…

---

<div class="post-metadata">

### Author: ![serverco](https://sea3.discourse-cdn.com/letsencrypt/user_avatar/community.letsencrypt.org/serverco/32/4251_2.png) [@serverco](https://community.letsencrypt.org/u/serverco)
#### Post date: [January 15, 2016, 10:02pm UTC](https://community.letsencrypt.org/t/apache2-config-help-needed/8854/26 "2016-01-15T22:02:09Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![Osiris](https://avatars.discourse-cdn.com/v4/letter/o/839c29/32.png) [@Osiris](https://community.letsencrypt.org/u/Osiris)
#### Post date: [January 15, 2016, 10:05pm UTC](https://community.letsencrypt.org/t/apache2-config-help-needed/8854/27 "2016-01-15T22:05:45Z")

</div>

> [@serverco](#):
>
> The angled brackets won't paste here nicely.

[offtopic]You can use many HTML tags, including the well known HTML character entities &lt; and &gt;. And yes, I had to type &amp; to make those &'s 😛

---

<div class="post-metadata">

### Author: ![watewwer](https://avatars.discourse-cdn.com/v4/letter/w/e47c2d/32.png) [@watewwer](https://community.letsencrypt.org/u/watewwer)
#### Post date: [January 15, 2016, 10:11pm UTC](https://community.letsencrypt.org/t/apache2-config-help-needed/8854/28 "2016-01-15T22:11:15Z")

</div>

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

---

<div class="post-metadata">

### Author: ![serverco](https://sea3.discourse-cdn.com/letsencrypt/user_avatar/community.letsencrypt.org/serverco/32/4251_2.png) [@serverco](https://community.letsencrypt.org/u/serverco)
#### Post date: [January 15, 2016, 10:13pm UTC](https://community.letsencrypt.org/t/apache2-config-help-needed/8854/29 "2016-01-15T22:13:30Z")

</div>

Yes, those are the ones \< and \>

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

---

<div class="post-metadata">

### Author: ![watewwer](https://avatars.discourse-cdn.com/v4/letter/w/e47c2d/32.png) [@watewwer](https://community.letsencrypt.org/u/watewwer)
#### Post date: [January 15, 2016, 10:16pm UTC](https://community.letsencrypt.org/t/apache2-config-help-needed/8854/30 "2016-01-15T22:16:25Z")

</div>

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?

---

<div class="post-metadata">

### Author: ![serverco](https://sea3.discourse-cdn.com/letsencrypt/user_avatar/community.letsencrypt.org/serverco/32/4251_2.png) [@serverco](https://community.letsencrypt.org/u/serverco)
#### Post date: [January 15, 2016, 10:20pm UTC](https://community.letsencrypt.org/t/apache2-config-help-needed/8854/31 "2016-01-15T22:20:40Z")

</div>

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\>

---

<div class="post-metadata">

### Author: ![serverco](https://sea3.discourse-cdn.com/letsencrypt/user_avatar/community.letsencrypt.org/serverco/32/4251_2.png) [@serverco](https://community.letsencrypt.org/u/serverco)
#### Post date: [January 15, 2016, 10:21pm UTC](https://community.letsencrypt.org/t/apache2-config-help-needed/8854/32 "2016-01-15T22:21:22Z")

</div>

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

---

<div class="post-metadata">

### Author: ![watewwer](https://avatars.discourse-cdn.com/v4/letter/w/e47c2d/32.png) [@watewwer](https://community.letsencrypt.org/u/watewwer)
#### Post date: [January 15, 2016, 10:25pm UTC](https://community.letsencrypt.org/t/apache2-config-help-needed/8854/33 "2016-01-15T22:25:31Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![serverco](https://sea3.discourse-cdn.com/letsencrypt/user_avatar/community.letsencrypt.org/serverco/32/4251_2.png) [@serverco](https://community.letsencrypt.org/u/serverco)
#### Post date: [January 15, 2016, 10:31pm UTC](https://community.letsencrypt.org/t/apache2-config-help-needed/8854/34 "2016-01-15T22:31:53Z")

</div>

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

---

<div class="post-metadata">

### Author: ![watewwer](https://avatars.discourse-cdn.com/v4/letter/w/e47c2d/32.png) [@watewwer](https://community.letsencrypt.org/u/watewwer)
#### Post date: [January 15, 2016, 11:02pm UTC](https://community.letsencrypt.org/t/apache2-config-help-needed/8854/35 "2016-01-15T23:02:03Z")

</div>

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](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:-)

---

<div class="post-metadata">

### Author: ![serverco](https://sea3.discourse-cdn.com/letsencrypt/user_avatar/community.letsencrypt.org/serverco/32/4251_2.png) [@serverco](https://community.letsencrypt.org/u/serverco)
#### Post date: [January 16, 2016, 8:04am UTC](https://community.letsencrypt.org/t/apache2-config-help-needed/8854/36 "2016-01-16T08:04:04Z")

</div>

your syslog should give you the important clues.

> [@watewwer](#):
>
> Jan 15 21:43:10 katbulk apache2[3127]: Output of config test was:  
> Jan 15 21:43:10 katbulk apache2[3127]: apache2: Syntax error on line 219 of /etc/apache2/apache2.conf: Syntax error on line 134 of /etc/apache2/sites-enabled/default-ssl.conf: without matching section  
> Jan 15 21:43:10 katbulk apache2[3127]: Action 'configtest' failed.  
> Jan 15 21:43:10 katbulk apache2[3127]: The Apache error log may have more information.

---

<div class="post-metadata">

### Author: ![watewwer](https://avatars.discourse-cdn.com/v4/letter/w/e47c2d/32.png) [@watewwer](https://community.letsencrypt.org/u/watewwer)
#### Post date: [January 17, 2016, 1:08am UTC](https://community.letsencrypt.org/t/apache2-config-help-needed/8854/37 "2016-01-17T01:08:21Z")

</div>

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

---

<div class="post-metadata">

### Author: ![Osiris](https://avatars.discourse-cdn.com/v4/letter/o/839c29/32.png) [@Osiris](https://community.letsencrypt.org/u/Osiris)
#### Post date: [January 17, 2016, 1:22am UTC](https://community.letsencrypt.org/t/apache2-config-help-needed/8854/38 "2016-01-17T01:22:45Z")

</div>

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](https://httpd.apache.org/docs/2.4/en/mod/core.html#virtualhost) and what parameters are mandatory?

---

<div class="post-metadata">

### Author: ![watewwer](https://avatars.discourse-cdn.com/v4/letter/w/e47c2d/32.png) [@watewwer](https://community.letsencrypt.org/u/watewwer)
#### Post date: [January 17, 2016, 2:34pm UTC](https://community.letsencrypt.org/t/apache2-config-help-needed/8854/39 "2016-01-17T14:34:37Z")

</div>

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

---

<div class="post-metadata">

### Author: ![Osiris](https://avatars.discourse-cdn.com/v4/letter/o/839c29/32.png) [@Osiris](https://community.letsencrypt.org/u/Osiris)
#### Post date: [January 17, 2016, 2:37pm UTC](https://community.letsencrypt.org/t/apache2-config-help-needed/8854/40 "2016-01-17T14:37:17Z")

</div>

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](https://httpd.apache.org/docs/2.4/en/mod/core.html#virtualhost) 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?

[Previous page](https://community.letsencrypt.org/t/apache2-config-help-needed/8854.md?page=1)

[Next page](https://community.letsencrypt.org/t/apache2-config-help-needed/8854.md?page=3)
