Meteoclimatic
Software => WeeWX => Mensaje iniciado por: sunbloquer en 12 de Enero del 2017, 11:11:20 am
-
Hola. Alguien ha tenido un problema similar? me pasa ultimamente que si apago la RPI y reconecto el servidor apache no esta funcionando lo cual me doy cuenta porque no hay web local >:( hablan de un bug.....
Curiosamente en otra RPI y probando el Nginx el problema es similar, sin cambios, una instalación pelada y pasa lo mismo.
Alguien le hace un restart a su Apache2 y comprueba? :;
-
Y ¿que dice el log de Apache2?
-
No obstante, si reinicio todo va OKç
OJO.....yo en esta Raspi (la original, la del 2012) sigo con Wheezy.
-
Y si quieres saber la versión de Apache2 que ejecuto:
root@raspberrypi:~# aptitude show apache2
Paquete: apache2
Estado: instalado
Instalado automáticamente: no
Versión: 2.2.22-13+deb7u6
Prioridad: opcional
Sección: httpd
Desarrollador: Debian Apache Maintainers <debian-apache@lists.debian.org>
Arquitectura: armhf
Tamaño sin comprimir: 1.024
Depende de: apache2-mpm-worker (= 2.2.22-13+deb7u6) | apache2-mpm-prefork (= 2.2.22-13+deb7u6)
| apache2-mpm-event (= 2.2.22-13+deb7u6) | apache2-mpm-itk (= 2.2.22-13+deb7u6),
apache2.2-common (= 2.2.22-13+deb7u6)
Proporcionado por: apache2-mpm-event, apache2-mpm-itk, apache2-mpm-prefork, apache2-mpm-worker
Descripción: Apache HTTP Server metapackage
The Apache Software Foundation's goal is to build a secure, efficient and extensible HTTP
server as standards-compliant open source software. The result has long been the number one
web server on the Internet.
It features support for HTTPS, virtual hosting, CGI, SSI, IPv6, easy scripting and database
integration, request/response filtering, many flexible authentication schemes, and more.
Página principal: http://httpd.apache.org/
-
En la Orange Pi One todo OK
-
En este caso Apache está en la versión 2.4.10
root@orangepione:~# aptitude show apache2
Package: apache2
State: installed
Automatically installed: no
Version: 2.4.10-10+deb8u7
Priority: optional
Section: httpd
Maintainer: Debian Apache Maintainers <debian-apache@lists.debian.org>
Architecture: armhf
Uncompressed Size: 360 k
Depends: lsb-base, procps, perl, mime-support, apache2-bin (= 2.4.10-10+deb8u7),
apache2-utils (>= 2.4), apache2-data (= 2.4.10-10+deb8u7)
PreDepends: dpkg (>= 1.17.14)
Recommends: ssl-cert
Suggests: www-browser, apache2-doc, apache2-suexec-pristine |
apache2-suexec-custom
Conflicts: apache2.2-common (< 2.3~)
Breaks: libapache2-mod-macro (< 1:2.4.6-1~)
Replaces: apache2.2-common, libapache2-mod-macro (< 1:2.4.6-1~)
Provides: httpd, httpd-cgi
Description: Apache HTTP Server
The Apache HTTP Server Project's goal is to build a secure, efficient and
extensible HTTP server as standards-compliant open source software. The result
has long been the number one web server on the Internet.
Installing this package results in a full installation, including the
configuration files, init scripts and support scripts.
Homepage: http://httpd.apache.org/
Tags: role::metapackage, suite::apache
-
Gracias jantoni, voy a realizar una instalación nueva esta tarde y te digo, con el log de apache tambien tenia problemas, aparecia y al reinicio desaparecia, como si fuera temporal... raro raro raro
-
Bueno, vamos a ver donde falla la escopeta esta
aptitude show apache2
Paquete: apache2
Estado: instalado
Instalado automáticamente: no
Versión: 2.4.10-10+deb8u7
Prioridad: opcional
Sección: httpd
Desarrollador: Debian Apache Maintainers <debian-apache@lists.debian.org>
Arquitectura: armhf
Tamaño sin comprimir: 359 k
Depende de: lsb-base, procps, perl, mime-support, apache2-bin (=
2.4.10-10+deb8u7), apache2-utils (>= 2.4), apache2-data (=
2.4.10-10+deb8u7)
Predepende de: dpkg (>= 1.17.14)
Recomienda: ssl-cert
Sugiere: www-browser, apache2-doc, apache2-suexec-pristine |
apache2-suexec-custom
Tiene conflictos con: apache2.2-common (< 2.3~)
Rompe: libapache2-mod-macro (< 1:2.4.6-1~)
Reemplaza: apache2.2-common, libapache2-mod-macro (< 1:2.4.6-1~)
Proporciona: httpd, httpd-cgi
Descripción: Apache HTTP Server
The Apache HTTP Server Project's goal is to build a secure, efficient and
extensible HTTP server as standards-compliant open source software. The result
has long been the number one web server on the Internet.
Installing this package results in a full installation, including the
configuration files, init scripts and support scripts.
Página principal: http://httpd.apache.org/
lsb_release -a
No LSB modules are available.
Distributor ID: Raspbian
Description: Raspbian GNU/Linux 8.0 (jessie)
Release: 8.0
Codename: jessie
El log existe
/var/log/apache2 $ ls -l
total 4
-rw-r----- 1 root adm 0 ene 12 15:23 access.log
-rw-r----- 1 root adm 988 ene 12 15:23 error.log
-rw-r----- 1 root adm 0 ene 12 15:23 other_vhosts_access.log
El error.log, los otros dos vacios.
[Thu Jan 12 15:23:11.647700 2017] [mpm_event:notice] [pid 18085:tid 1996431360] AH00489: Apache/2.4.10 (Raspbian) configured -- resuming normal operations
[Thu Jan 12 15:23:11.648420 2017] [core:notice] [pid 18085:tid 1996431360] AH00094: Command line: '/usr/sbin/apache2'
[Thu Jan 12 15:23:31.588714 2017] [mpm_event:notice] [pid 18085:tid 1996431360] AH00491: caught SIGTERM, shutting down
[Thu Jan 12 15:23:33.100155 2017] [mpm_prefork:notice] [pid 19137] AH00163: Apache/2.4.10 (Raspbian) configured -- resuming normal operations
[Thu Jan 12 15:23:33.100781 2017] [core:notice] [pid 19137] AH00094: Command line: '/usr/sbin/apache2'
[Thu Jan 12 15:23:35.875944 2017] [mpm_prefork:notice] [pid 19137] AH00169: caught SIGTERM, shutting down
[Thu Jan 12 15:23:37.600095 2017] [mpm_prefork:notice] [pid 19239] AH00163: Apache/2.4.10 (Raspbian) configured -- resuming normal operations
[Thu Jan 12 15:23:37.600424 2017] [core:notice] [pid 19239] AH00094: Command line: '/usr/sbin/apache2'
Sin conectar a consola, apago y enciendo
sudo /etc/init.d/apache2 restart
[....] Restarting apache2 (via systemctl): apache2.serviceWarning: Unit file of apache2.service changed on disk, 'systemctl daemon-reload' recommended.
. ok
pi@raspberrypi:/var/log/apache2 $ systemctl daemon-reload
Failed to execute operation: Access denied
pi@raspberrypi:/var/log/apache2 $ sudo systemctl daemon-reload
pi@raspberrypi:/var/log/apache2 $ sudo /etc/init.d/apache2 stop
[ ok ] Stopping apache2 (via systemctl): apache2.service.
pi@raspberrypi:/var/log/apache2 $ sudo /etc/init.d/apache2 start
[ ok ] Starting apache2 (via systemctl): apache2.service.
pi@raspberrypi:/var/log/apache2 $
Yo alucino, ahora no pasa nada, no obstante me daba ese fallo ya tocando la configuración, voy a ir paso a paso a ver donde falla. Pues llevo ya 4 dias con esto.
No habrás entrado en mi RPI y me lo habras arreglado no jantoni? plau2
Seguiré informando.............
-
Empezamos, ya me parecia a mi raro
pi@raspberrypi:~ $ cd /var/log/apache2
-bash: cd: /var/log/apache2: No existe el fichero o el directorio
pi@raspberrypi:~ $ sudo /etc/init.d/apache2 start
[....] Starting apache2 (via systemctl): apache2.serviceWarning: Unit file of apache2.service changed on disk, 'systemctl daemon-reload' recommended.
Job for apache2.service failed. See 'systemctl status apache2.service' and 'journalctl -xn' for details.
failed!
pi@raspberrypi:~ $ sudo systemctl daemon-reload
pi@raspberrypi:~ $ sudo /etc/init.d/apache2 start
[....] Starting apache2 (via systemctl): apache2.serviceJob for apache2.service failed. See 'systemctl status apache2.service' and 'journalctl -xn' for details.
failed!
pi@raspberrypi:~ $ sudo systemctl status apache2.service
● apache2.service - LSB: Apache2 web server
Loaded: loaded (/etc/init.d/apache2)
Drop-In: /lib/systemd/system/apache2.service.d
└─forking.conf
Active: failed (Result: exit-code) since jue 2017-01-12 16:10:25 CET; 24s ago
Process: 794 ExecStart=/etc/init.d/apache2 start (code=exited, status=1/FAILURE)
ene 12 16:10:25 raspberrypi apache2[794]: Output of config test was:
ene 12 16:10:25 raspberrypi apache2[794]: AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1. Set the...is message
ene 12 16:10:25 raspberrypi apache2[794]: (2)No such file or directory: AH02291: Cannot access directory '/var/log/apache2/' for main error log
ene 12 16:10:25 raspberrypi apache2[794]: (2)No such file or directory: AH02291: Cannot access directory '/var/log/apache2/' for error log of vhost defined...ult.conf:1
ene 12 16:10:25 raspberrypi apache2[794]: AH00014: Configuration check failed
ene 12 16:10:25 raspberrypi apache2[794]: Action 'configtest' failed.
ene 12 16:10:25 raspberrypi apache2[794]: The Apache error log may have more information.
ene 12 16:10:25 raspberrypi systemd[1]: apache2.service: control process exited, code=exited status=1
ene 12 16:10:25 raspberrypi systemd[1]: Failed to start LSB: Apache2 web server.
ene 12 16:10:25 raspberrypi systemd[1]: Unit apache2.service entered failed state.
Hint: Some lines were ellipsized, use -l to show in full.
:; :; :; :; :;
Esto ya lo habia hecho y lo hago otra vez
pi@raspberrypi:/var/log $ sudo mkdir apache2
pi@raspberrypi:/var/log $ cd
pi@raspberrypi:~ $ sudo /etc/init.d/apache2 start
[ ok ] Starting apache2 (via systemctl): apache2.service.
Otra vez apaga, apaga, reinicia.....
Y no funciona de nuevo
pi@raspberrypi:~ $ sudo /etc/init.d/apache2 start
[....] Starting apache2 (via systemctl): apache2.serviceWarning: Unit file of ap ache2.service changed on disk, 'systemctl daemon-reload' recommended.
Job for apache2.service failed. See 'systemctl status apache2.service' and 'jour nalctl -xn' for details.
failed!
VAR/LOG/APACHE2 Ha vuelto a desaparecer
pi@raspberrypi:~ $ sudo systemctl daemon-reload
pi@raspberrypi:~ $ sudo systemctl status apache2.service
● apache2.service - LSB: Apache2 web server
Loaded: loaded (/etc/init.d/apache2)
Drop-In: /lib/systemd/system/apache2.service.d
└─forking.conf
Active: failed (Result: exit-code) since jue 2017-01-12 16:26:20 CET; 1min 0s ago
ene 12 16:26:20 raspberrypi apache2[668]: Output of config test was:
ene 12 16:26:20 raspberrypi apache2[668]: AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1. Set the...is message
ene 12 16:26:20 raspberrypi apache2[668]: (2)No such file or directory: AH02291: Cannot access directory '/var/log/apache2/' for main error log
ene 12 16:26:20 raspberrypi apache2[668]: (2)No such file or directory: AH02291: Cannot access directory '/var/log/apache2/' for error log of vhost defined...ult.conf:1
ene 12 16:26:20 raspberrypi apache2[668]: AH00014: Configuration check failed
ene 12 16:26:20 raspberrypi apache2[668]: Action 'configtest' failed.
ene 12 16:26:20 raspberrypi apache2[668]: The Apache error log may have more information.
ene 12 16:26:20 raspberrypi systemd[1]: apache2.service: control process exited, code=exited status=1
ene 12 16:26:20 raspberrypi systemd[1]: Failed to start LSB: Apache2 web server.
ene 12 16:26:20 raspberrypi systemd[1]: Unit apache2.service entered failed state.
Hint: Some lines were ellipsized, use -l to show in full.
pi@raspberrypi:~ $ cd /var/log
pi@raspberrypi:/var/log $ ls -l
total 136
-rw-r----- 1 root adm 1880 ene 12 16:27 auth.log
-rw-r--r-- 1 root root 3842 ene 1 1970 boot.log
-rw------- 1 root utmp 0 ene 1 1970 btmp
-rw-r----- 1 root adm 17149 ene 12 16:27 daemon.log
-rw-r----- 1 root adm 1074 ene 1 1970 debug
-rw-r----- 1 root adm 25016 ene 1 1970 kern.log
-rw-r----- 1 root adm 24077 ene 1 1970 messages
-rw-r----- 1 root adm 42599 ene 12 16:27 syslog
-rw-r----- 1 root adm 1084 ene 12 16:25 weewx.log
-rw-rw-r-- 1 root utmp 2688 ene 12 16:26 wtmp
Encuentro una referencia en logrotate
/var/log/apache2/*.log {
daily
missingok
rotate 14
compress
delaycompress
notifempty
create 640 root adm
sharedscripts
postrotate
if /etc/init.d/apache2 status > /dev/null ; then \
/etc/init.d/apache2 reload > /dev/null; \
fi;
endscript
prerotate
if [ -d /etc/logrotate.d/httpd-prerotate ]; then \
run-parts /etc/logrotate.d/httpd-prerotate; \
fi; \
endscript
}
y parece estar bien..........
-
¿Por que de todos los log que existen desaparecen la mitad de ellos entre el que está el de apache2 y no vuelven a aparecer?
pi@raspberrypi:/var/log $ ls -l
total 1144
-rw-r--r-- 1 root root 18292 ene 12 20:01 alternatives.log
drwxr-x--- 2 root adm 4096 ene 12 20:01 apache2
drwxr-xr-x 2 root root 4096 nov 25 18:23 apt
-rw-r----- 1 root adm 8085 ene 12 20:17 auth.log
-rw-r--r-- 1 root root 4168 ene 12 18:59 boot.log
-rw-r--r-- 1 root root 74848 nov 25 18:22 bootstrap.log
-rw------- 1 root utmp 0 nov 25 18:19 btmp
-rw-r----- 1 root adm 52146 ene 12 20:06 daemon.log
-rw-r----- 1 root adm 3781 ene 12 20:01 debug
-rw-r----- 1 root adm 31 nov 25 18:21 dmesg
-rw-r--r-- 1 root root 332093 ene 12 20:16 dpkg.log
-rw-r--r-- 1 root root 24024 nov 25 18:29 faillog
drwxr-xr-x 2 root root 4096 nov 25 18:21 fsck
-rw-r----- 1 root adm 78775 ene 12 18:59 kern.log
-rw-rw-r-- 1 root utmp 292292 ene 12 19:08 lastlog
-rw-r----- 1 root adm 76978 ene 12 20:06 messages
drwxr-xr-x 2 ntp ntp 4096 jul 26 00:36 ntpstats
drwxr-x--- 2 root adm 4096 jun 1 2016 samba
-rw-r----- 1 root adm 133692 ene 12 20:17 syslog
-rw-r----- 1 root adm 1024 ene 12 20:06 user.log
-rw-rw-r-- 1 root utmp 8832 ene 12 19:08 wtmp
otra vez reinstalado :; :; :; :; :;
-
Veamos.....las nuevas versiones de Apache2 tienen un problema con los ficheros temporales de log.
Si hiciste el apaño que yo recomendaba, que era editando /etc/init.d/apache2 el problema surge cuando por algún motivo intentamos reiniciar Apache2. No obstante Apache no se necesita reiniciar, salvo en contadas ocasiones.
En ese caso, la solución es reiniciar el sistema y todo funciona bien.
Si ese es tu caso, no hay problema, salvo que quieras que todo vaya como un reloj. Entonces toca editar el script y elaborarlo más, ya que el "apaño" que yo publiqué, como todo lo mio es para andar por casa.
La otra solución es la de eliminar en /etc/fstab la línea que hace que todo /var/log esté en memoria RAM en lugar de la tarjeta SD. Con eso se evitan todos los problemas de ese tipo Y eliminando el pequeño código insertado en /etc/init.d/apache2 claro está.
Recordad que tenemos /var/log en RAM o fichero temporal para evitar en la medida de lo posible las escrituras en la tarjeta SD y, por tanto, alargar todo lo posible su vida.
Saludos.
-
Si hiciste el apaño que yo recomendaba, que era editando /etc/init.d/apache2
La otra solución es la de eliminar en /etc/fstab la línea que hace que todo /var/log esté en memoria RAM en lugar de la tarjeta SD. Con eso se evitan todos los problemas de ese tipo Y eliminando el pequeño código insertado en /etc/init.d/apache2 claro está.
Recordad que tenemos /var/log en RAM o fichero temporal para evitar en la medida de lo posible las escrituras en la tarjeta SD y, por tanto, alargar todo lo posible su vida.
Saludos.
Voy eliminar en principio lo del /etc/fstab a ver si chuta de esa manera, en cuanto al apaño del /etc/init.d/apache2 no se a cual te refieres..........
-
Ahora que se que es eso pude buscar una posible solucion navegando por ahi y creo que es buena para seguir usando la ram para los logs, la otra opción seria cambiar el log de apache2 a otro lugar, pero la de este enlace me parece una buena solución
http://bernaerts.dyndns.org/linux/75-debian/50-debian-compactflash-tune-apache (http://bernaerts.dyndns.org/linux/75-debian/50-debian-compactflash-tune-apache)
que opinas jantoni?
-
Ummmmm......por probar no pasa nada.
Pero creo que no va a funcionar. Ese sistema es parecido al mío.
El problema es que actualmente, el sistema de directorios en RAM ha cambiado sustancialmente desde Wheezy al actual Jessie en Debian o Raspbian.
Ya lo explicaba en el foro antiguo......pero ahora mismo no recuerdo donde daban la alternativa. Pero no me gustó porque era más complejo que la solución aportada.
-
Pues lo dejamos como esta, si descubro algo ya lo posteo aqui. Gracias de nuevo
-
Cuando Apache2 se inicia no encuentra el directorio/var/log/apache2, el cual se crea despues y por tanto Apache2 no permanece ejecutandose, y el problema se soluciona también creando el directorio /var/log/apache2 antes de que Apache2 se inicie.
A lo largo del tiempo jantoni ha dado dos soluciones a este problema, que yo conozca.
La primera es modificar /etc/init.d/apache2 incluyendo las siguiente líneas marcadas en rojo:
..........
..........
ENV="env -i LANG=C PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
if [ "$APACHE_CONFDIR" != /etc/apache2 ] ; then
ENV="$ENV APACHE_CONFDIR=$APACHE_CONFDIR"
fi
if [ "$APACHE_ENVVARS" != "$APACHE_CONFDIR/envvars" ] ; then
ENV="$ENV APACHE_ENVVARS=$APACHE_ENVVARS"
fi
#Crea el directorio /var/log/apache2
if [ -d /var/log/apache2 ]
then
echo ""
else
mkdir /var/log/apache2
chmod 777 /var/log/apache2
fi
#edit /etc/default/apache2 to change this.
HTCACHECLEAN_RUN=auto
HTCACHECLEAN_MODE=daemon
HTCACHECLEAN_SIZE=300M
HTCACHECLEAN_DAEMON_INTERVAL=120
HTCACHECLEAN_PATH=/var/cache/apache2$DIR_SUFFIX/mod_cache_disk
HTCACHECLEAN_OPTIONS=""
.........
.........
Esta solución es la que yo estoy utilizando y creo que es la mejor, no obstante la segunda es modificar /etc/rc.local incluyendo las lineas en rojo:
#!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.
# Print the IP address
_IP=$(hostname -I) || true
if [ "$_IP" ]; then
printf "My IP address is %s\n" "$_IP"
fi
#Crea el directorio de log de Apache y lo inicia
/etc/init.d/apache2 stop
mkdir /var/log/apache2
/etc/init.d/apache2 start
exit 0
Saludos
-
Gracias Amon-K, de momento tengo anulado escribir en RAM, cuando tenga tiempo le meto mano plau2