概要
wslでapache2やってみた。
wslにapache2をインストールしてたので、chromeから開いてみた。
環境
windows 10
wsl1
ubuntu 18.04
確認
$ sudo dpkg -l | grep apache
ii apache2 2.4.29-1ubuntu4.6 amd64 Apache HTTP Server
ii apache2-bin 2.4.29-1ubuntu4.6 amd64 Apache HTTP Server (modules and other binary files)
ii apache2-data 2.4.29-1ubuntu4.6 all Apache HTTP Server (common files)
ii apache2-utils 2.4.29-1ubuntu4.6 amd64 Apache HTTP Server (utility programs for web servers)
ii libapache2-mod-php7.2 7.2.18-1+ubuntu18.04.1+deb.sury.org+1 amd64 server-side, HTML-embedded scripting language (Apache 2 module)
$ apache2 -V
[Mon Sep 01 07:16:37.353246 2025] [core:warn] [pid 64] AH00111: Config variable ${APACHE_RUN_DIR} is not defined
apache2: Syntax error on line 80 of /etc/apache2/apache2.conf: DefaultRuntimeDir must be a valid directory, absolute or relative to ServerRoot
Server version: Apache/2.4.29 (Ubuntu)
Server built: 2023-03-08T17:34:33
Server's Module Magic Number: 20120211:68
Server loaded: APR 1.6.3, APR-UTIL 1.6.1
Compiled using: APR 1.6.3, APR-UTIL 1.6.1
Architecture: 64-bit
Server MPM:
Server compiled with....
-D APR_HAS_SENDFILE
-D APR_HAS_MMAP
-D APR_HAVE_IPV6 (IPv4-mapped addresses enabled)
-D APR_USE_SYSVSEM_SERIALIZE
-D APR_USE_PTHREAD_SERIALIZE
-D SINGLE_LISTEN_UNSERIALIZED_ACCEPT
-D APR_HAS_OTHER_CHILD
-D AP_HAVE_RELIABLE_PIPED_LOGS
-D DYNAMIC_MODULE_LIMIT=256
-D HTTPD_ROOT="/etc/apache2"
-D SUEXEC_BIN="/usr/lib/apache2/suexec"
-D DEFAULT_PIDLOG="/var/run/apache2.pid"
-D DEFAULT_SCOREBOARD="logs/apache_runtime_status"
-D DEFAULT_ERRORLOG="logs/error_log"
-D AP_TYPES_CONFIG_FILE="mime.types"
-D SERVER_CONFIG_FILE="apache2.conf"
エラー対応
nano /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 [2404:7a83:6460:a730:7d4f:cf4e:bf56:ca17]:80
Listen 8000
<IfModule ssl_module>
Listen 443
</IfModule>
<IfModule mod_gnutls.c>
Listen 443
</IfModule>
# vim: syntax=apache ts=4 sw=4 sts=4 sr noet
nano /etc/apache2/apache2.conf
AcceptFilter http none
AcceptFilter https none
結果
以上