Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove "ServerTokens Prod" setting #153

Closed
creopard opened this issue May 16, 2018 · 6 comments
Closed

Remove "ServerTokens Prod" setting #153

creopard opened this issue May 16, 2018 · 6 comments

Comments

@creopard
Copy link
Contributor

This setting simply can't be set in .htaccess, but only in httpd.conf file according to Apache's specification:
http://httpd.apache.org/docs/2.2/en/mod/core.html#servertokens
Doing so will just result in an 500 internal error.

The spec's line "Context:" at "ServerTokens Directive" only lists "server config" but not ".htaccess"

@LeoColomb
Copy link
Member

LeoColomb commented May 16, 2018

That's why there is a warning, right? 😉

# (!) The `ServerTokens` directive will only work in the main server
# configuration file, so don't try to enable it in the `.htaccess` file!

@creopard
Copy link
Contributor Author

That's it. Whats the use of a setting when you can't enable it?
Just for documentary purposes?

@LeoColomb
Copy link
Member

LeoColomb commented May 16, 2018

Honestly I don't know. Related commits are not very verbose.

That say this may be relevant for #1.

@Malvoz
Copy link
Contributor

Malvoz commented May 17, 2018

I don't think h5bp wants to assume a user does or does not have access to the main server configuration file. The current approach informs users with access to the main config file the availability of ServerTokens, and clearly states to not use it if you don't have access.

However (unrelated to ServerTokens but related to comments on main config file), the comment about avoiding .htaccess should also recommend setting AllowOverride to not allow .htaccess because:

When AllowOverride is set to allow the use of .htaccess files, httpd will look in every directory for .htaccess files. Thus, permitting .htaccess files causes a performance hit, whether or not you actually even use them!

https://httpd.apache.org/docs/2.4/howto/htaccess.html#when

@XhmikosR
Copy link
Member

Yeah, I'd say this should stay as is for the aforementioned reasons.

@LeoColomb
Copy link
Member

Agreed, closing.
@Malvoz Feel free to open a PR to add this recommendation. 👍

@LeoColomb LeoColomb mentioned this issue May 6, 2019
5 tasks
LeoColomb added a commit that referenced this issue Aug 7, 2019
LeoColomb added a commit that referenced this issue Jan 3, 2020
LeoColomb added a commit that referenced this issue Jan 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants