multiple apache instances don't start after reboot

Bug #1627339 reported by Horst Platz on 2016-09-24
18
This bug affects 3 people
Affects Status Importance Assigned to Milestone
Apache2 Web Server
Fix Released
Unknown
apache2 (Ubuntu)
Undecided
Unassigned

Bug Description

multiple apache instances don't start after reboot without the default apache enabled.

:~# sh /usr/share/doc/apache2/examples/setup-instance xxx
:~# sh /usr/share/doc/apache2/examples/setup-instance yyy

:~# systemctl enable apache2-xxx
:~# systemctl enable apache2-yyy

disable default installed apache because ist should only the template for the suffix apaches

:~# systemctl disable apache2

:~# shutdown -r now

/var/run/apache2 ist now no longer available because tmpfs

:~# cat /var/log/apache2-zzz/error.log
[...]
[Sat Sep 24 11:10:00.566132 2016] [core:error] [pid 2229] AH00100: apache2: could not log pid to file /var/run/apache2/apache2-xxx.pid
[...]

solution

:~# vim /etc/apache2-xxx/envvars
:~# vim /etc/apache2-yyy/envvars
[...]
#export APACHE_PID_FILE=/var/run/apache2/apache2$SUFFIX.pid
export APACHE_PID_FILE=/var/run/apache2$SUFFIX/apache2$SUFFIX.pid

or rather in /etc/apache2/envvars

CVE References

description: updated
Horst Platz (hp-localhorst) wrote :
tags: added: apache2

The attachment "patch for /etc/apache2/envvars" seems to be a patch. If it isn't, please remove the "patch" flag from the attachment, remove the "patch" tag, and if you are a member of the ~ubuntu-reviewers, unsubscribe the team.

[This is an automated message performed by a Launchpad user owned by ~brian-murray, for any issues please contact him.]

tags: added: patch

Hi,
I was able to confirm your finding.

Following the setup one can check with a simple restart of the service that
a) the issue occurs
b) get fixed by the change to envvars

Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in apache2 (Ubuntu):
status: New → Confirmed

File to fix is part of packaging debian/config-dir/envvars

Ok, done with my initial analysis. Thank you a lot for this great bug report!

This bug is present in Debian too. So it would be best fixed in Debian, and then Ubuntu will pick it up on the next merge.

Would you mind filing a bug with Debian please?

tags: added: bitesize needs-upstream-report
Horst Platz (hp-localhorst) wrote :

ok and thx should be now

https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=838932

kind regards horst

Changed in apache2:
status: Unknown → New
Horst Platz (hp-localhorst) wrote :
Download full text (5.4 KiB)

simliar problem with proxy_balancer / slotmem_shm

in my further on configuration with prox_balancer. i figured out a
another start/reboot problem with proxy_balancer configuration.

remember

:~# systemctl disable apache2
default apache is disabled -> reboot -> /var/run/apache2/ don't exist

:~# sh /usr/share/doc/apache2/examples/setup-instance proxy-balancer
Setting up /etc/apache2-proxy-balancer ...
Setting up /etc/init.d/apache2-proxy-balancer ...
Setting up symlinks: a2enmod-proxy-balancer a2dismod-proxy-balancer a2ensite-proxy-balancer a2dissite-proxy-balancer a2enconf-proxy-balancer a2disconf-proxy-balancer apache2ctl-proxy-balancer
Setting up /etc/logrotate.d/apache2-proxy-balancer and /var/log/apache2-proxy-balancer ...

:~# systemctl enable apache2-proxy-balancer
apache2-proxy-balancer.service is not a native service, redirecting to systemd-sysv-install
Executing /lib/systemd/systemd-sysv-install enable apache2-proxy-balancer

:~# cd /etc/apache2-proxy-balancer/

:~# vim sites-enabled/proxy-balancer.conf
[...]
<Proxy balancer://twoways/>
    BalancerMember https://192.168.168.10/
    BalancerMember https://192.168.168.20/
    ProxySet lbmethod=bytraffic
</Proxy>
[...]
ProxyPass /site-twoways/ balancer://twoways/
[...]

:~# a2enmod-proxy-balancer proxy_balancer
Considering dependency proxy for proxy_balancer:
Enabling module proxy.
Considering dependency alias for proxy_balancer:
Module alias already enabled
Considering dependency slotmem_shm for proxy_balancer:
Enabling module slotmem_shm.
Enabling module proxy_balancer.
To activate the new configuration, you need to run:
  service apache2-proxy-balancer restart

:~# a2enmod-proxy-balancer lbmethod_bytraffic
Considering dependency proxy_balancer for lbmethod_bytraffic:
Considering dependency proxy for proxy_balancer:
Module proxy already enabled
Considering dependency alias for proxy_balancer:
Module alias already enabled
Considering dependency slotmem_shm for proxy_balancer:
Module slotmem_shm already enabled
Module proxy_balancer already enabled
Enabling module lbmethod_bytraffic.
To activate the new configuration, you need to run:
  service apache2-proxy-balancer restart

:~# apache2ctl-proxy-balancer configtest
Syntax OK

:~# service apache2-proxy-balancer start
Job for apache2-proxy-balancer.service failed because the control process exited with error code. See "systemctl status apache2-proxy-balancer.service" and "journalctl -xe" for details.

:~# cat /var/log/apache2-proxy-balancer/error.log
[...]
[Fri Oct 21 20:44:33.144445 2016] [slotmem_shm:error] [pid 2120] (2)No such file or directory: AH02611: create: apr_shm_create(/var/run/apache2/slotmem-shm-p6c23514b.shm) failed
[Fri Oct 21 20:44:33.144483 2016] [proxy_balancer:emerg] [pid 2120] (2)No such file or directory: AH01179: balancer slotmem_create failed
[Fri Oct 21 20:44:33.144487 2016] [:emerg] [pid 2120] AH00020: Configuration Failed, exiting

the module slotmem_shm has only .load files no .conf files

:~# ls -la mods-enabled/
[...]
lrwxrwxrwx 1 root root 34 Okt 21 20:40 slotmem_shm.load -> ../mods-available/slotmem_shm.load

https://httpd.apache.org/docs/trunk/mod/mod_slotmem_shm.html

in the dokum...

Read more...

Changed in apache2:
status: New → Fix Released
Launchpad Janitor (janitor) wrote :
Download full text (5.4 KiB)

This bug was fixed in the package apache2 - 2.4.23-7ubuntu1

---------------
apache2 (2.4.23-7ubuntu1) zesty; urgency=medium

  * Merge from Debian unstable. Remaining changes:
    - debian/{control, apache2.install, apache2-utils.ufw.profile,
      apache2.dirs}: Add ufw profiles.
    - debian/apache2.py, debian/apache2-bin.install: Add apport hook.
    - debian/rules: Fix cross-building by passing
      DEB_{HOST,BUILD}_GNU_TYPE to configure.
    - debian/patches/086_svn_cross_compiles: Backport several cross
      fixes from upstream
    - d/index.html, d/icons/ubuntu-logo.png, d/apache2.postrm: replace
      Debian with Ubuntu on default page.
    - Don't build experimental http2 module for LTS:
      + debian/control: removed libnghttp2-dev Build-Depends (in universe).
      + debian/config-dir/mods-available/http2.load: removed.
      + debian/rules: removed proxy_http2 from configure.
    - Correct systemd-sysv-generator behavior by customizing some
      parameters:
      + d/apache2-systemd.conf: add a drop-in file to specify some
        parameters for the systemd unit (type=Forking and
        RemainsAfterExit=no), this allow a correct state synchronisation
        between systemctl status and actual state of apache2 daemon.
      + d/apache2.install: place the apache2-systemd.conf file in the
        correct location.

apache2 (2.4.23-7) unstable; urgency=medium

  * Make apache2-dev depend on openssl 1.0, too. Closes: #844160
  * Move DefaultRuntimeDir and pid file for multi-instances to
    /var/run/apache2-xxx. Thanks to Horst Platz for the debugging.
    Closes: #838932 LP: #1627339
  * Fix systemd unit naming for multi-instances.
  * Tweak embedded .tar.gz some more to build reproducibly.

apache2 (2.4.23-6) unstable; urgency=medium

  * One more tweak for reproducible build. Thanks to Daniel Shahaf for the
    patch. Closes: #839977
  * Avoid building with openssl 1.1 for now. See #828236

apache2 (2.4.23-5) unstable; urgency=low

  * Team upload.

  [ Stefan Fritsch ]
  * Tweak creation of .tar.gz embedded in preinst to get reproducible
    build.

  [ Raphaël Hertzog ]
  * Add systemd unit files. Closes: #798430
  * Improve a2enmod to enable apache-htcacheclean with systemctl and let
    it enable '<email address hidden>' for multi-instance
    support.
  * Improve setup-instance to rely on the systemd <email address hidden> for
    multi-instance support.
  * Drop /lib/systemd/system/apache2.service.d/forking.conf now that we have
    proper native systemd support.
  * Modify handling of /etc/init.d/apache-htcacheclean to have a usual
    Default-Start value but instead we disable it manually in the postinst.
    That way "systemctl enable apache-htcacheclean" works.
  * Add some lintian overrides for non-problems (two update-rc.d calls in
    postinst, and a .js file with a very long line).

apache2 (2.4.23-4) unstable; urgency=medium

  * Fix pre-inst script for new installations. Closes: #834169

apache2 (2.4.23-3) unstable; urgency=low

  * Fix conffiles that may have got the wrong content during upgrade from
    wheezy to early jessie versions. Closes: #794933
  * Also restore re-introduced *.load fil...

Read more...

Changed in apache2 (Ubuntu):
status: Confirmed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.