Report this

What is the reason for this report?

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

Posted on November 9, 2020

Connected Tutorial(This question is a follow-up to this tutorial):

How To Troubleshoot Common Apache Errors

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



This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

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.

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

Hi @KFSys

I corrected the wording but then got a error on line 168 when I restarted apache

millerfuresh@ubuntu-s-1vcpu-1gb-nyc1-01:~$ sudo apache2ctl -t
apache2: Syntax error on line 168 of /etc/apache2/apache2.conf: </Directory> without matching <Directory> section
Action '-t' failed.
The Apache error log may have more information.
millerfuresh@ubuntu-s-1vcpu-1gb-nyc1-01:~$ 

Thank you @KFSys! This worked

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

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.