Installing Apache on Windows Subsystem for Linux

bluppfisk picture bluppfisk · Apr 7, 2016 · Viewed 41.1k times · Source

Having just updated to the newest Windows 10 release (build 14316), I immediately started playing with WSL, the Windows Subsystem for Linux, which is supposed to run an Ubuntu installation on Windows.

Maybe I'm trying the impossible by trying to install Apache on it, but then someone please explain me why this won't be possible.

At any rate, during installation (sudo apt-get install apache2), I received the following error messages after the dependencies were downloaded and installed correctly:

initctl: Unable to connect to Upstart: Failed to connect to socket /com/ubuntu/upstart: No such file or directory
runlevel:/var/run/utmp: No such file or directory
 * Starting web server apache2                                                 *
 * The apache2 configtest failed.
Output of config test was:
mktemp: failed to create directory via template '/var/lock/apache2.XXXXXXXXXX': No such file or directory
chmod: missing operand after '755'
Try 'chmod --help' for more information.
invoke-rc.d: initscript apache2, action "start" failed.
Setting up ssl-cert (1.0.33) ...
Processing triggers for libc-bin (2.19-0ubuntu6.7) ...
Processing triggers for ureadahead (0.100.0-16) ...
Processing triggers for ufw (0.34~rc-0ubuntu2) ...
WARN: / is group writable!

Now, I understand that there seem to be some folders and files missing for Apache2 to work. Before I start changing anything that will mess with my Windows installation, I want to ask whether there's a different way? Also, should I worry about / being group writable or is this just standard Windows behaviour?

Answer

Alberto.d72 picture Alberto.d72 · May 3, 2016

In order to eliminate this warning

Invalid argument: AH00076: Failed to enable APR_TCP_DEFER_ACCEP

Add this to the end of /etc/apache2/apache2.conf

AcceptFilter http none