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

Make apache run properly on Windows, fixes #1109 #1111

Merged
merged 3 commits into from Sep 20, 2018

Conversation

rfay
Copy link
Member

@rfay rfay commented Sep 13, 2018

The Problem/Issue/Bug:

Apache doesn't work at all on Windows.

There are two problems.

First: https://github.com/drud/ddev/blob/5ed08dc93b285b00fb77ab5ec35fabcaf375ad64/containers/ddev-webserver/files/etc/apache2/envvars#L49-L50 is overwritten with uid_0 (which didn't exist in /etc/passwd)

Second:

Apache just won't run as root. Period. Without recompiling.

How this PR Solves The Problem:

Use uid 1000 in windows instead of using uid 0. This seems to work fine. I've checked to make sure that at least with docker-for-windows files created by the webserver come through as the correct user on the host.

Manual Testing Instructions:

Use apache-fpm as webserver_type on Windows.

Automated Testing Overview:

Related Issue Link(s):

OP #1109

Release/Deployment notes:

This changes the UID used inside the web container to UID 1000 instead of root (uid 0). Although this seems to have no detectable problems on docker for windows in terms of creating files with improper uid there could be side-effects. But it's sure nice to not be running as root inside the container.

This also might causes issues to some Windows user doing an exec hook without sudo.

@rfay rfay self-assigned this Sep 13, 2018
@rfay rfay changed the title Add uid_0 and gid_0 to /etc/passwd to fix root usage on windows, fixes #1109 Make apache run properly on Windows, fixes #1109 Sep 14, 2018
@rfay
Copy link
Member Author

rfay commented Sep 14, 2018

I think I'd like to wait to pull this until we have at least basic apache test coverage, which is queued up in #1101

@rfay rfay force-pushed the 20180913_apache_broken_on_windows branch from a61d9a6 to aa1ba54 Compare September 19, 2018 18:24
@rfay rfay merged commit 62d15da into ddev:master Sep 20, 2018
@rfay rfay deleted the 20180913_apache_broken_on_windows branch September 20, 2018 19:45
@rfay rfay added this to the v1.3.0 milestone Sep 21, 2018
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

Successfully merging this pull request may close these issues.

None yet

2 participants