[SOLVED 2022] Permission denied in WSL: Apache2 startup failed

By Dillon Smart · · · 3 Comments

Ubuntu

Windows Subsystem for Linux is a great tool for Web Developers using the Windows operating system. With the release of WSL2 which brought the introduction of a real Linux Kernal, the environment saw huge speed improvements, cementing itself as the preferred development environment for many developers. However, some Windows updates have proven to cause problems with software installed on WSL. In this post, we are going to walk through the steps to solve “Apache2 startup failed: Permission denied in WSL”.

Apache2 startup failed: Permission denied

(13)Permission denied: AH00072: make_sock: could not bind to address [::]:80
(13)Permission denied: AH00072: make_sock: could not bind to address 0.0.0.0:80

What causes a permission denied error?

Apache listens on port 80 for HTTP connections and 443 for HTTPS connections. The error above occurs when another service is already listening on these ports. In this case, after a Windows update, the IIS (Internet Information Services) service started up, listening on port 80.

Solve Apache2 startup failed error

To fix the issue, we need to stop the IIS service.

Step 1

Search and open ‘Services’ in the Windows start menu

Step 2

Find and select ‘World Wide Web Publishing Service’. This service provides web connectivity and administration through the IIS manager.

Step 3

Right-click and hit stop. This will only stop the service until your restart your machine.

Step 4

Check the startup type is of the service. This is probably set to Automatic. You may want to simply stop the service for now, but it may cause more issues in the future, so it’s best to disable the service from starting up again.

If you use IIS alongside your WSL Apache2 service, you may want to start the service up again when you require it.

To disable the service from starting automatically, right-click and select properties. This will open an additional popup.

Find startup type and set the field to Disabled. Then apply the changes.

Step 5

Open a terminal, and start the Apache2 service.

sudo serivce apache2 start

Apache 2 should now start as expected.

You can learn more about Windows Subsystem for Linux by visiting the official documentation or you can get help with setting WSL up by following our tutorial.

Apache2Windows Subsystem for Linux

3 Comments

svenskanda

Absolutely helpful - this morning after a restart can't systemctl start apache2 get the :80. 1 hour of trouble, and than i find your solution. Peaceful and now i get apache out from WSL2 in Windows at localhost. Nice, but not normal. In my Brain is WSL with Debian a Container, and Apache should only be available in the container, if i started in the container. Is this a bug or a feature?

WSL_Ubuntu

does not work. same error.

Dillon

Im sorry to hear this. Can you provide your Ununtu version and WSL version please?

GBecci

Hi Dillon, many thanks, it worked fine for me, I have to work out the IIS issue.

Dillon

Thats great!

Was this helpful? Leave a comment!

This site uses Akismet to reduce spam. Learn how your comment data is processed.

WSL vs Dual Boot speed test

Updated 16th August 2022

In this experiment, I will be using WSL2 running Ubuntu 20.04 and Ubuntu 20.04 dual-booted on the same Dell XPS. Is there a noticeable difference? Follow along for the results of the WSL vs Dual Boot speed test. If you are like me and use different development environments a lot, you may find the results

What is WSL?

Updated 13th May 2022

In 2022, web developers have a whole host of options to run development environments on a local machine. With the initial release of WSL in 2016 and the release of WLS2 in 2019, a new environment was presented to web developers. In this post, I will help you answer the question “What is WSL?” What

How to create Alias command in Linux

Updated 16th August 2022

Alias commands in Linux are a great way to speed up your workflow. In this post, I will show you how to create Alias command in Linux using Bash on WSL (Windows Subsystem for Linux). What is an Alias command? The alias command in Linux allows you to create custom shortcuts for frequently used commands.