AH00526: Syntax error on line 3 of /etc/httpd/conf/extra/httpd-directories.conf:

Bramus

Verified User
Joined
Jun 19, 2008
Messages
22
Location
The Netherlands
I was updating Apache today to version 2.4.54 but now it wont start anymore. It is viging me the following error message:

Aug 13 11:11:32 server05. systemd[1]: Starting The Apache HTTP Server...
Aug 13 11:11:32 server05. httpd[10590]: AH00526: Syntax error on line 3 of /etc/httpd/conf/extra/httpd-directories.conf:
Aug 13 11:11:32 server05. httpd[10590]: Option FollowSymLinks not allowed here
Aug 13 11:11:32 server05. systemd[1]: httpd.service: main process exited, code=exited, status=1/FAILURE
Aug 13 11:11:32 server05. systemd[1]: Failed to start The Apache HTTP Server.
Aug 13 11:11:32 server05. systemd[1]: Unit httpd.service entered failed state.
Aug 13 11:11:32 server05. systemd[1]: httpd.service failed.

I did an Update / Clean / build apache and also a rewrite_confs, but nothing seems to work.

Any one has a suggestion? I have removed the +FollowSymLinks manually, but not sure what will happen now. Also i tried removing the file itself and rewrite_confs, but it keeps getting back (the +FollowSymlinks). So manually removing seems to solve the issue for now, but not sure if this will fix it permanently
 
Last edited:
DirectAdmin / CustomBuild version?

Did you tried ./build rewrite_confs yet?
Yes I did, but the +FollowSymlinks is coming back in the file. See also my edited post. I have now manually removed the +FollowSymlinks from the file and HTTPD is starting.
 
So manually removing seems to solve the issue for now, but not sure if this will fix it permanently
If it's not fixed permenantly you have to create a custom httpd-directories-old.conf in this directory:
/usr/local/directadmin/custombuild/custom/ap/conf/extra
create it if it does not exists yet.
Just copy the current file in there, make the adjustment and run the rewrite_confs again and it should be fine.
 
The same problem in couple servers.
rewrite_confs makes
symlink httpd-directories.conf to httpd-directories-old.conf
and rewrites httpd-directories-old.conf
You need to have correct version in /usr/local/directadmin/custombuild/custom/ap/conf/extra/httpd-directories-old.conf
rewrite_confs also creates config file httpd-directories-new.conf and when you replace that with old httpd, it works correct.

DA team, any good solution without making custom conf? /usr/local/directadmin/custombuild/custom/ap/conf/extra/httpd-directories-old.conf


downloadserver=files-lt.directadmin.com
/build versions | grep DirectAdmin
Latest version of DirectAdmin: 1.642 build f42272a9ea817a0fc6f470e3d8746802cedcd36a
Installed version of DirectAdmin: 1.642 build f42272a9ea817a0fc6f470e3d8746802cedcd36a
 
rewrite_confs makes
symlink httpd-directories.conf to httpd-directories-old.conf
and rewrites httpd-directories-old.conf
Which is like working as designed.

You need to have correct version in /usr/local/directadmin/custombuild/custom/ap/conf/extra/httpd-directories-old.conf
rewrite_confs also creates config file httpd-directories-new.conf and when you replace that with old httpd, it works correct.
Why like this? You should use a correct version like this:
/usr/local/directadmin/custombuild/custom/ap/conf/extra/httpd-directories.conf and not -old.conf.
Maybe that is causing your issue.

This way the original /etc/httpd/conf/extra/httpd-directories.conf will be replaced by the one in the custom directory and then the rebuild and symlink will be done. So you always have the correct httpd-directories-old.conf.

So try like this and see if it works for you. If not, write what you want to achieve and what is not working or error or whatever.
 
This way the original /etc/httpd/conf/extra/httpd-directories.conf will be replaced by the one in the custom directory and then the rebuild and symlink will be done. So you always have the correct httpd-directories-old.conf.

So try like this and see if it works for you. If not, write what you want to achieve and what is not working or error or whatever.
build rewrite_confs - makes always this:
lrwxrwxrwx 1 root root 26 Sep 10 18:44 httpd-directories.conf -> httpd-directories-old.conf
-rw-r--r-- 1 root root 503 Sep 10 18:44 httpd-directories-new.conf
-rw-r--r-- 1 root root 305 Sep 10 18:44 httpd-directories-old.conf

also when you dont have any custom config "httpd-directories*.conf" in
/usr/local/directadmin/custombuild/custom/ap2/conf/extra/


so when you have problem
"
Aug 13 11:11:32 server05. httpd[10590]: AH00526: Syntax error on line 3 of /etc/httpd/conf/extra/httpd-directories.conf:
Aug 13 11:11:32 server05. httpd[10590]: Option FollowSymLinks not allowed here
"

you must create correct version in
/usr/local/directadmin/custombuild/custom/ap2/conf/extra/httpd-directories-old.conf

or
/usr/local/directadmin/custombuild/custom/ap2/conf/extra/httpd-directories.conf

them with /usr/local/directadmin/custombuild/custom/ap2/conf/extra/httpd-directories.conf
rewrite_confs creates as
/usr/local/directadmin/custombuild/custom/ap2/conf/extra/httpd-directories-old.conf



Maybe in future DA will correct
"if exist
/usr/local/directadmin/custombuild/custom/ap2/conf/extra/httpd-directories.conf
dont make symlink
lrwxrwxrwx 1 root root 26 Sep 10 18:44 httpd-directories.conf -> httpd-directories-old.conf
"

or there is any bug.
 
Last edited:
you must create correct version in
Please stop telling wat we must create. Start telling what you want to achieve, because I don't understand any thing of what you really want.

also when you dont have any custom config "httpd-directories*.conf" in
/usr/local/directadmin/custombuild/custom/ap2/conf/extra/
Yes I know, like I said, that's working as designed, what is your problem with this?

so when you have problem
"
Aug 13 11:11:32 server05. httpd[10590]: AH00526: Syntax error on line 3 of /etc/httpd/conf/extra/httpd-directories.conf:
Aug 13 11:11:32 server05. httpd[10590]: Option FollowSymLinks not allowed here
Then you have some issue for some reason and ask how to fix.
My httpd-directories.conf does has this on line 3, which does include the FollowSymLinks:
Options All -MultiViews -Indexes +FollowSymLinks +IncludesNoExec +Includes

So why would it throw an error on your server? While it doesn't on our servers?

Which Distro and version are you using?
Which version of Apache?
Any other stuff like nGinx or something?
Cloudlinux or not?
Which version of Directadmin?
Which version of build? This you can find out by doing a ./build version command in the custombuild directory.

If it is a bug causing this somewhere, we have to find out why and exactly where.
If you have minimal a Personal Plus license, you can also send in a ticket with DA for your problem.
 
CentOS Linux release 7.9.2009 (Core)
Ok, I found the reason why there is a problem on many installations.

The problem occurs after build apache / rewrite_confs

httpd[10590]: Option FollowSymLinks not allowed here
when there in options.conf
harden_symlinks_patch=yes


with
harden_symlinks_patch=no
./build apache && ./build rewrite_confs
work correct.

So with option
harden_symlinks_patch=yes
httpd-directories.conf must be without +FollowSymLinks
 
So with option
harden_symlinks_patch=yes
httpd-directories.conf must be without +FollowSymLinks
Aha... this is what confused me. We got 2 servers with Centos 7.9.2009.
In options.conf we do have the harden_symlinks=yes and the +FollowSymLinks present in the httpd-directories.conf.

This was working without any issue or error notice and has been for some time. Probably DA changed something.

Just to be sure of this I ran a ./build rewrite_confs on both servers and in both cases in the httpd-directories-old.conf the +FollowSymLinks was automatically removed.

So you shouldn't need to manually adjust these files. But you have to remove the +FollowSymLinks in the custom httpd-directories.conf in that case if you have one in your custom directory for some reason.

Good find!
 
Back
Top