Question

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

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

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

Subscribe
Share

Submit an 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.

Thank you @KFSys! This worked

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

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:~$ 

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