Pages : 1
#1 Le 04/12/2020, à 01:55
- abecidofugy
Problème LAMP avec WSL 2
Salut,
Hier, mon LAMP installé sur WSL 2 marchait normalement (tests sommaire, je pouvais accéder à localhost). Après reboot, ce soir, j’ai un souci pour accéder à localhost et localhost/index.html (aucun souci pour localhost/info.php).
Voici mes fichiers de conf :
$ sed -e '/^[ ]*#/d' -e '/^$/d' /etc/apache2/apache2.conf
DefaultRuntimeDir ${APACHE_RUN_DIR}
PidFile ${APACHE_PID_FILE}
Timeout 300
KeepAlive On
MaxKeepAliveRequests 100
KeepAliveTimeout 5
User ${APACHE_RUN_USER}
Group ${APACHE_RUN_GROUP}
HostnameLookups Off
ErrorLog ${APACHE_LOG_DIR}/error.log
LogLevel warn
IncludeOptional mods-enabled/*.load
IncludeOptional mods-enabled/*.conf
Include ports.conf
<Directory />
Options FollowSymLinks
AllowOverride None
Require all denied
</Directory>
<Directory /usr/share>
AllowOverride None
Require all granted
</Directory>
<Directory /var/www/>
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
</Directory>
AccessFileName .htaccess
<FilesMatch "^\.ht">
Require all denied
</FilesMatch>
LogFormat "%v:%p %h %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" vhost_combined
LogFormat "%h %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" combined
LogFormat "%h %l %u %t \"%r\" %>s %O" common
LogFormat "%{Referer}i -> %U" referer
LogFormat "%{User-agent}i" agent
IncludeOptional conf-enabled/*.conf
IncludeOptional sites-enabled/*.conf
$ cat /etc/apache2/sites-enabled/000-default.conf
<VirtualHost *:80>
# The ServerName directive sets the request scheme, hostname and port that
# the server uses to identify itself. This is used when creating
# redirection URLs. In the context of virtual hosts, the ServerName
# specifies what hostname must appear in the request's Host: header to
# match this virtual host. For the default virtual host (this file) this
# value is not decisive as it is used as a last resort host regardless.
# However, you must set it for any further virtual host explicitly.
ServerName localhost
ServerAdmin webmaster@localhost
DocumentRoot /var/www/public
# Available loglevels: trace8, ..., trace1, debug, info, notice, warn,
# error, crit, alert, emerg.
# It is also possible to configure the loglevel for particular
# modules, e.g.
#LogLevel info ssl:warn
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
# For most configuration files from conf-available/, which are
# enabled or disabled at a global level, it is possible to
# include a line for only one particular virtual host. For example the
# following line enables the CGI configuration for this host only
# after it has been globally disabled with "a2disconf".
#Include conf-available/serve-cgi-bin.conf
</VirtualHost>
J’ai suivi ce tuto sommaire : https://www.mrdemonwolf.me/blog/how-to- … mp-on-wsl/ et encore une fois, localhost marchait hier…
Merci de votre aide.
//EDIT :
/var/www/public$ ll
total 0
drwxrwxrwx 1 patrice patrice 4096 déc. 4 01:41 ./
drwxrwxrwx 1 patrice patrice 4096 déc. 4 01:14 ../
-rwxrwxrwx 1 patrice patrice 111 déc. 4 01:41 index.html*
-rwxrwxrwx 1 patrice patrice 18 déc. 1 07:36 info.php*
/var/www$ ll
total 12
drwxr-xr-x 3 root root 4096 déc. 4 02:53 ./
drwxr-xr-x 15 root root 4096 déc. 1 07:18 ../
drwxr-xr-x 2 root root 4096 déc. 1 06:40 html/
lrwxrwxrwx 1 root root 24 déc. 4 02:53 public -> /mnt/c/Users/Patrice/WWW
patrice@bigtower:/var/www$ sudo service apache2 restart
* Restarting Apache httpd web server apache2
AH00112: Warning: DocumentRoot [/var/www/public] does not exist
Dernière modification par abecidofugy (Le 04/12/2020, à 02:58)
KDE neon pour le plaisir d’avoir un O/S moderne et puissant et Firefox Nightly comme navigateur. Aussi sous Windows 11 pour une partie de mon travail…
Hors ligne
Pages : 1