1

I have a series of servers which I am upgrading from 2.0/2.2 to 2.4. The previous admins made rather a hash of various Options. I am confused because the 2.0/2.2 documentation say that Options All (which is "all but MultiViews") is the default, whereas in 2.4 the default has changed to FollowSymLinks. I am also confused about what are the relationship of the options for the parent directory vs the options for the child directory -- what gets inherited? This is my problem child...

<Directory />
    Options FollowSymLinks
    AllowOverride None
    Order deny,allow
    Deny from all
</Directory>
<Directory "/opt/apache/netegrity/webagent/pw/">
    Options -Indexes MultiViews ExecCGI
    AllowOverride None
    Order allow,deny
    Allow from all
</Directory>

Ok, this is 2.2, where the documentation definitely scolds you for mixing +/- with non+/- Options in the same line, but does start your server. So what are the options being set for /opt/apache/netegrity/webagent/pw/ in this code? Does the pw directory inherit FollowSymLinks and set MultiViews & ExecCGI, and the -Indexes is nonsense because Indexes isn't on anyway? If the second Options directive were only

    Options MultiViews ExecCGI

would Indexes be turned on or not for /opt/apache/netegrity/webagent/pw/? What about FollowSymLinks? I know how this evolved -- that second Options directive started out created by the webagent installer, and was

    Options Indexes MultiViews ExecCGI

but then the admins wanted to take Indexes away, so they stuck a minus sign in front of it. I think (if I'm reading the documentation correctly) that the way you turn indexes off is to just leave it out, not stick minus signs in.

So we come to the money question, which is how to port this from 2.2 to 2.4 syntax. Since the Options default is now FollowSymLinks rather than All, we can leave it out

<Directory />
    AllowOverride none
    Require all denied
</Directory>

right? And The CA people suggest this setting for /opt/apache/CA/webagent/pw/

<Directory "/opt/apache/CA/webagent/pw/">
    Options Indexes MultiViews ExecCGI
    AllowOverride None
    Require all granted
</Directory>

So if we wanted to remove Indexes, do we just leave it off entirely, with no minused option?

<Directory "/opt/apache/CA/webagent/pw/">
    Options MultiViews ExecCGI
    AllowOverride None
    Require all granted
</Directory>

And, the last question, is FollowSymLinks set for /opt/apache/CA/webagent/pw/ implicitly because it is set for ? Or is it only set if it appears on the Options line for /opt/apache/CA/webagent/pw/?

0

There exists a configtest parameter in apache2ctl to check your configuration(s).

I like to use this when I'm unsure:

# apache2ctl configtest
Syntax OK
  • Is there some sort of argument that you can give to configtest to see what the configuration is setting, as opposed to using it to tell you if there are or are not syntax errors? I know how to construct several different permutations of Options directives that don't have any syntax errors, I just don't know which set is actually doing what I want because the documentation is ambiguous. – cathyf Mar 5 '17 at 22:39
  • from the Apache documentation: configtest Run a configuration file syntax test. It parses the configuration files and either reports Syntax Ok or detailed information about the particular syntax error. This is equivalent to apachectl -t. – vchrizz Mar 6 '17 at 17:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.