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

Failed to disable autoindex Apache module #446

Closed
ghost opened this issue Jul 5, 2023 · 4 comments
Closed

Failed to disable autoindex Apache module #446

ghost opened this issue Jul 5, 2023 · 4 comments
Labels
services Relating to common services like NTP, Apache, uWSGI, cron, etc.
Milestone

Comments

@ghost
Copy link

ghost commented Jul 5, 2023

Seeing the following errors when deploying:

----------
          ID: autoindex
    Function: apache_module.disabled
      Result: False
     Comment: Failed to disable autoindex Apache module
     Started: 12:02:44.624481
    Duration: 31.62 ms
     Changes:   
...
----------
          ID: apache2
    Function: service.running
      Result: False
     Comment: One or more requisite failed: apache.autoindex
     Started: 12:02:44.661744
    Duration: 0.003 ms
     Changes:   
@ghost ghost assigned jpmckinney Jul 5, 2023
@ghost
Copy link
Author

ghost commented Jul 5, 2023

This was setup to resolve an issue with the new default site configuration. #218 (comment)

@jpmckinney
Copy link
Member

jpmckinney commented Jul 5, 2023

On which service?

I was able to deploy this change initially, but it seems once autoindex is disabled, maybe Salt doesn't recognize that it is?

On the registry server I had to re-enable it for now (though this server has 2 IPs - not sure if part of the challenge): https://ocdsdeploy.readthedocs.io/en/latest/develop/update/apache.html#autoindex

@jpmckinney jpmckinney assigned ghost and unassigned jpmckinney Jul 5, 2023
@ghost
Copy link
Author

ghost commented Jul 5, 2023

I saw the above error deploying to Prometheus, I assume it is present on more servers since this is applied by default.

My assumptions is that Salt cannot handle the "WARNING: The following essential module will be disabled." Apache prompt.
If this is the issue, we could work around this by removing the mods-enabled symlink directly (file.absent).

/etc/apache2/mods-enabled/autoindex.conf
/etc/apache2/mods-enabled/autoindex.load

@jpmckinney
Copy link
Member

That works for me.

Do you know why Apache warns about disabling this module? It seems like unwanted/insecure behavior to list directories by default.

I disabled it so that requests to e.g. ocp23.open-contracting.org respond with 404 instead of 403, but using 403 isn't a big deal.

@jpmckinney jpmckinney added the services Relating to common services like NTP, Apache, uWSGI, cron, etc. label Jul 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
services Relating to common services like NTP, Apache, uWSGI, cron, etc.
Projects
None yet
Development

No branches or pull requests

1 participant