Question

AH00526: Syntax error on line 165 of /etc/apache2/apache2.conf:

Posted November 9, 2020 163 views
UbuntuApache

Hi

I am trying to fix this error: <Directory> directive missing closing ’>’ in this section:

<Directory /user/share/>
AllowOverride None
Require all granted
</Directory>

What is the first line supposed to look like? I have tried moving the bracket. I am using Ubuntu & apache2.

Thank you

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

×
3 answers

Hi @millerfuresh,

Here is how it’s in my config

<Directory /usr/share>
        AllowOverride None
        Require all granted
</Directory>

Everything on your end looks alright as well. Having said that if you comment it and try to start Apache, does it work or it still gives another error?

Regards,
KFSys

  • Hey @KFSys! - thank you

    I corrected the typo but have another error

    lines 1-13/13 (END)…skipping…
    ● apache2.service - The Apache HTTP Server
    Loaded: loaded (/lib/systemd/system/apache2.service; enabled; vendor preset: enabled)
    Active: failed (Result: exit-code) since Mon 2020-11-09 08:25:54 UTC; 1min 23s ago
    Docs: https://httpd.apache.org/docs/2.4/
    Process: 52589 ExecStart=/usr/sbin/apachectl start (code=exited, status=1/FAILURE)

    Nov 09 08:25:54 ubuntu-s-1vcpu-1gb-nyc1-01 systemd[1]: Starting The Apache HTTP Server…
    Nov 09 08:25:54 ubuntu-s-1vcpu-1gb-nyc1-01 apachectl[52598]: apache2: Syntax error on line 168 of /etc/apache2/apache2.conf: </Directory> without matching <Directory> section
    Nov 09 08:25:54 ubuntu-s-1vcpu-1gb-nyc1-01 apachectl[52589]: Action ‘start’ failed.
    Nov 09 08:25:54 ubuntu-s-1vcpu-1gb-nyc1-01 apachectl[52589]: The Apache error log may have more information.
    Nov 09 08:25:54 ubuntu-s-1vcpu-1gb-nyc1-01 systemd[1]: apache2.service: Control process exited, code=exited, status=1/FAILURE
    Nov 09 08:25:54 ubuntu-s-1vcpu-1gb-nyc1-01 systemd[1]: apache2.service: Failed with result 'exit-code’.
    Nov 09 08:25:54 ubuntu-s-1vcpu-1gb-nyc1-01 systemd[1]: Failed to start The Apache HTTP Server.
    ~
    ~

Show answer This answer has been marked as resolved by millerfuresh.
Show answer This answer has been marked as resolved by millerfuresh.
Submit an Answer