Necesito "/ var / www" pero Apache2 intenta usar un "/ var / www / html" vacío
Estos días duermo con mihttp://localhost
trabajando y leyendo páginas de/var/www
...
Me desperté con un error "AH00094" en el registro de Apache2, y (¿Apache2 creado?) Un sorprendido/var/www/html
, que Apache2 intenta usar.
Ahora mihttp://localhost/anything
no funciona (error 404 en el navegador).
¿Como arreglarlo? Necesito mihttp://localhost
trabajando con archivos en/var/www
!
Estoy usando Ubuntu12 con Apache2, todo por defecto y estándar.
Revisé el registro de errores portail /var/log/apache2/error.log
para descubrir la ruta exacta que Apache, que muestra
... [core:notice] [pid 1597] AH00094: Command line: '/usr/sbin/apache2'
... [:error] [pid 1604] [client 127.0.0.1:40624] script '/var/www/html/info.php' not found or unable to stat
La carpeta/var/www/html
es nuevo, todos, como '/var/www/info.php', están en/var/www
, no en/var/www/html
.
I reparó el error "AH00094" edición
sudo nano /etc/apache2/apache2.conf
y agregando en la última línea
ServerName localhost
(ahora no hay errores de registro sobre localhost, pero nada funciona)
PD: Verifiqué otros problemas relacionados, pero no es el mismo problema:Permisos para / var / www / html , Intentando usar un enlace simbólico para var / www / html
Tengo miedo de usar elpistas de esta respuesta ... en mi Ubuntu no hay los archivos indicados .conf. Debo crearlo? Es seguro?
Como sugirió @RahilWazir, aquí también está mi "/etc/apache2/sites-available/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 www.example.com
ServerAdmin webmaster@localhost
DocumentRoot /var/www/html
# 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>
# vim: syntax=apache ts=4 sw=4 sts=4 sr noet