3
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

WSL(Ubuntu)のApache2起動でエラー

Posted at

Windows10のWSL(Ubuntu)でApache2デーモンを起動したときにエラーになったので、その原因と対処法です。

$ cat /etc/issue
Ubuntu 18.04.1 LTS \n \l

$ apache2 -v
Server version: Apache/2.4.29 (Ubuntu)
Server built:   2018-10-10T18:59:25
$ sudo /etc/init.d/apache2 start
 * Starting Apache httpd web server apache2
(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
no listening sockets available, shutting down
AH00015: Unable to open logs
Action 'start' failed.
The Apache error log may have more information.
 *

原因

W3SVC (WWW Publishing Service)が起動していて80番ポートを使用していました…

StackExchange Why am I getting “Permission denied: make_sock: could not bind to address” when starting Apache2?
Why GitHub? Apache start error in Windows Creator update. #1921

対策

/etc/apache2/ports.conf
# If you just change the port or add more ports here, you will likely also
# have to change the VirtualHost statement in
# /etc/apache2/sites-enabled/000-default.conf

- Listen 80
+ Listen 8080

<IfModule ssl_module>
-        Listen 443
+        Listen 8443
</IfModule>

<IfModule mod_gnutls.c>
-        Listen 8443
+        Listen 8443
</IfModule>

# vim: syntax=apache ts=4 sw=4 sts=4 sr noet

IISを止めるか、Apacheのポートを8080などに変更すると、無事起動しました。

3
3
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?