16
WeeWX / Re:Apache2 no reinicia
« en: 15 de Enero del 2017, 21:30:01 pm »
Gracias Amon-K, de momento tengo anulado escribir en RAM, cuando tenga tiempo le meto mano
![plau2 plau2](https://forum.meteoclimatic.net/Smileys/aaron/aplaude2.gif)
Esta sección te permite ver todos los posts escritos por este usuario. Ten en cuenta que sólo puedes ver los posts escritos en zonas a las que tienes acceso en este momento.
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.
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
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.
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
/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
}
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
/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
[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'
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 $