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

Not finding vhosts on A{mazon,rch}Linux #4905

Closed
bmw opened this issue Jul 5, 2017 · 2 comments
Closed

Not finding vhosts on A{mazon,rch}Linux #4905

bmw opened this issue Jul 5, 2017 · 2 comments
Milestone

Comments

@bmw
Copy link
Member

bmw commented Jul 5, 2017

My operating system is (include version):

Amazon Linux 2017.03

I installed Certbot with (certbot-auto, OS package manager, pip, etc):

certbot-auto

I ran this command and it produced this output:

sudo env PATH=$PATH ./certbot-auto --apache --debug -v -d example.org
...
Could not reverse map the HTTPS VirtualHost to the original
...

Certbot's behavior differed from what I expected because:

Certbot should be able to find the vhost.

This issue was created in response to https://community.letsencrypt.org/t/rate-limited-after-trying-multiple-solutions-to-could-not-reverse-map-the-https-virtualhost-to-the-original-issue/37252. Adding --apache-vhost-root causes the "Could not reverse map..." error message to go away and be replaced by:

No vhost exists with servername or alias of: example.org (or it's in a file with multiple vhosts, which Certbot can't parse yet). No vhost was selected. Please specify ServerName or ServerAlias in the Apache config, or split vhosts into separate files.

I played with this myself for a bit in Docker using http24 installed in the default paths and even with --apache-vhost-root, we're not finding the vhost. The return value from certbot_apache.configurator.get_virtual_hosts() is an empty list.

@joohoi, since Amazon Linux is Red Hat based, this might be a good test to see how better support for non-Debian systems is coming in Apache.

@joohoi
Copy link
Member

joohoi commented Jul 7, 2017

This should be fixed in #4104 as the issue seems to be in make_vhost_ssl

@bmw
Copy link
Member Author

bmw commented Aug 3, 2017

I believe another instance of this problem can be found in https://community.letsencrypt.org/t/archlinux-how-to-configur-lets-encrypt/39258/32. At the very least, #4104 seems to fix the issue.

@bmw bmw changed the title Not finding vhosts on Amazon Linux Not finding vhosts on A{mazon,rch}Linux Aug 3, 2017
@bmw bmw closed this as completed in #4104 Sep 25, 2017
bmw pushed a commit that referenced this issue Sep 25, 2017
…on Debian / Ubuntu (#4104)

This changes the apache plugin behaviour to only parse enabled configuration files and respecting the --apache-vhost-root CLI parameter for new SSL vhost creation. If --apache-vhost-root isn't defined, or doesn't exist, the SSL vhost will be created to originating non-SSL vhost directory.

This PR also implements actual check for vhost enabled state, and makes sure parser.parse_file() does not discard changes in Augeas DOM, by doing an autosave.

Also handles enabling the new SSL vhost, if it's on a path that's not parsed by Apache.

Fixes: #1328
Fixes: #3545
Fixes: #3791
Fixes: #4523
Fixes: #4837
Fixes: #4905

* First changes

* Handle rest of the errors

* Test fixes

* Final fixes

* Make parse_files accessible and fix linter problems

* Activate vhost at later time

* Cleanup

* Add a new test case, and fix old

* Enable site later in deploy_cert

* Make apache-conf-test default dummy configuration enabled

* Remove is_sites_available as obsolete

* Cleanup

* Brought back conditional vhost_path parsing

* Parenthesis

* Fix merge leftovers

* Fix to work with the recent changes to new file creation

* Added fix and tests for non-symlink vhost in sites-enabled

* Made vhostroot parameter for ApacheParser optional, and removed extra_path

* Respect vhost-root, and add Include statements to root configuration if needed

* Fixed site enabling order to prevent apache restart error while enabling mod_ssl

* Don't exclude Ubuntu / Debian vhost-root cli argument

* Changed the SSL vhost directory selection priority

* Requested fixes for paths and vhost discovery

* Make sure the Augeas DOM is written to disk before loading new files

* Actual checking for if the file is parsed within existing Apache configuration

* Fix the order of dummy SSL directives addition and enabling modules

* Restructured site_enabled checks

* Enabling vhost correctly for non-debian systems
@bmw bmw added this to the 0.19.0 milestone Sep 25, 2017
sydneyli pushed a commit that referenced this issue Jun 15, 2018
…on Debian / Ubuntu (#4104)

This changes the apache plugin behaviour to only parse enabled configuration files and respecting the --apache-vhost-root CLI parameter for new SSL vhost creation. If --apache-vhost-root isn't defined, or doesn't exist, the SSL vhost will be created to originating non-SSL vhost directory.

This PR also implements actual check for vhost enabled state, and makes sure parser.parse_file() does not discard changes in Augeas DOM, by doing an autosave.

Also handles enabling the new SSL vhost, if it's on a path that's not parsed by Apache.

Fixes: #1328
Fixes: #3545
Fixes: #3791
Fixes: #4523
Fixes: #4837
Fixes: #4905

* First changes

* Handle rest of the errors

* Test fixes

* Final fixes

* Make parse_files accessible and fix linter problems

* Activate vhost at later time

* Cleanup

* Add a new test case, and fix old

* Enable site later in deploy_cert

* Make apache-conf-test default dummy configuration enabled

* Remove is_sites_available as obsolete

* Cleanup

* Brought back conditional vhost_path parsing

* Parenthesis

* Fix merge leftovers

* Fix to work with the recent changes to new file creation

* Added fix and tests for non-symlink vhost in sites-enabled

* Made vhostroot parameter for ApacheParser optional, and removed extra_path

* Respect vhost-root, and add Include statements to root configuration if needed

* Fixed site enabling order to prevent apache restart error while enabling mod_ssl

* Don't exclude Ubuntu / Debian vhost-root cli argument

* Changed the SSL vhost directory selection priority

* Requested fixes for paths and vhost discovery

* Make sure the Augeas DOM is written to disk before loading new files

* Actual checking for if the file is parsed within existing Apache configuration

* Fix the order of dummy SSL directives addition and enabling modules

* Restructured site_enabled checks

* Enabling vhost correctly for non-debian systems
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants