Author Topic: Problems with apache2 on debian 9  (Read 2081 times)

Gattopardo

  • Lord of the sith
  • Overseaing the building of the death star
Problems with apache2 on debian 9
« on: 13 March, 2019, 10:16:58 pm »
Installed debian 9 on a dell xps 8300 i5, tonight connected the computer internet to update and install the drivers for the video card.  The video card is a Asus EAH5450, which is an Ati radeon card.  Updated the drivers with https://linuxconfig.org/how-to-install-amdgpu-drivers-on-debian-9-stretch-linux guide.  Didn't do the testing as the monitor stopped putting up messages of wrong configuration.

Now am getting this:
Quote
root@debian:/home/dell# apt-get -o DPkg::Options::="--force-confmiss" --reinstall install apache2
Reading package lists... Done
Building dependency tree       
Reading state information... Done
0 upgraded, 0 newly installed, 1 reinstalled, 0 to remove and 0 not upgraded.
4 not fully installed or removed.
Need to get 0 B/236 kB of archives.
After this operation, 0 B of additional disk space will be used.
(Reading database ... 165254 files and directories currently installed.)
Preparing to unpack .../apache2_2.4.25-3+deb9u6_amd64.deb ...
Unpacking apache2 (2.4.25-3+deb9u6) over (2.4.25-3+deb9u6) ...
Setting up apache2 (2.4.25-3+deb9u6) ...
Job for apache2.service failed because the control process exited with error code.
See "systemctl status apache2.service" and "journalctl -xe" for details.
invoke-rc.d: initscript apache2, action "start" failed.
● apache2.service - The Apache HTTP Server
   Loaded: loaded (/lib/systemd/system/apache2.service; enabled; vendor preset: enabled)
   Active: failed (Result: exit-code) since Wed 2019-03-13 21:08:58 GMT; 5ms ago
  Process: 3993 ExecStart=/usr/sbin/apachectl start (code=exited, status=1/FAILURE)
 Main PID: 598 (code=exited, status=0/SUCCESS)

Mar 13 21:08:58 debian systemd[1]: Starting The Apache HTTP Server...
Mar 13 21:08:58 debian apachectl[3993]: AH00534: apache2: Configuration erro…ed.
Mar 13 21:08:58 debian apachectl[3993]: Action 'start' failed.
Mar 13 21:08:58 debian apachectl[3993]: The Apache error log may have more i…on.
Mar 13 21:08:58 debian systemd[1]: apache2.service: Control process exited,…us=1
Mar 13 21:08:58 debian systemd[1]: Failed to start The Apache HTTP Server.
Mar 13 21:08:58 debian systemd[1]: apache2.service: Unit entered failed state.
Mar 13 21:08:58 debian systemd[1]: apache2.service: Failed with result 'exi…de'.
Hint: Some lines were ellipsized, use -l to show in full.
Processing triggers for systemd (232-25+deb9u9) ...
Processing triggers for man-db (2.7.6.1-2) ...
Setting up 389-admin (1.1.43-1+b1) ...
Job for dirsrv-admin.service failed because the control process exited with error code.
See "systemctl status dirsrv-admin.service" and "journalctl -xe" for details.
invoke-rc.d: initscript dirsrv-admin, action "start" failed.
● dirsrv-admin.service - 389 Administration Server.
   Loaded: loaded (/lib/systemd/system/dirsrv-admin.service; disabled; vendor preset: enabled)
   Active: failed (Result: exit-code) since Wed 2019-03-13 21:08:59 GMT; 5ms ago
  Process: 4249 ExecStart=/usr/sbin/apache2 -k start -f /etc/dirsrv/admin-serv/httpd.conf (code=exited, status=1/FAILURE)

Mar 13 21:08:59 debian systemd[1]: Starting 389 Administration Server....
Mar 13 21:08:59 debian apache2[4249]: AH00558: apache2: Could not reliably …sage
Mar 13 21:08:59 debian apache2[4249]: (2)No such file or directory: AH02291… log
Mar 13 21:08:59 debian apache2[4249]: AH00014: Configuration check failed
Mar 13 21:08:59 debian systemd[1]: dirsrv-admin.service: Control process ex…us=1
Mar 13 21:08:59 debian systemd[1]: Failed to start 389 Administration Server..
Mar 13 21:08:59 debian systemd[1]: dirsrv-admin.service: Unit entered faile…ate.
Mar 13 21:08:59 debian systemd[1]: dirsrv-admin.service: Failed with result…de'.
Hint: Some lines were ellipsized, use -l to show in full.
dpkg: error processing package 389-admin (--configure):
 subprocess installed post-installation script returned error exit status 1
dpkg: dependency problems prevent configuration of 389-dsgw:
 389-dsgw depends on 389-admin; however:
  Package 389-admin is not configured yet.

dpkg: error processing package 389-dsgw (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of 389-ds-console:
 389-ds-console depends on 389-admin; however:
  Package 389-admin is not configured yet.

dpkg: error processing package 389-ds-console (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of 389-ds:
 389-ds depends on 389-admin; however:
  Package 389-admin is not configured yet.
 389-ds depends on 389-ds-console; however:
  Package 389-ds-console is not configured yet.
 389-ds depends on 389-dsgw; however:
  Package 389-dsgw is not configured yet.

dpkg: error processing package 389-ds (--configure):
 dependency problems - leaving unconfigured
Errors were encountered while processing:
 389-admin
 389-dsgw
 389-ds-console
 389-ds
E: Sub-process /usr/bin/dpkg returned an error code (1)

Tried google and tried stopping and starting the apache2 so decided on a reinstall.

Any ideas?

Kim

  • Timelord
    • Fediverse
Re: Problems with apache2 on debian 9
« Reply #1 on: 14 March, 2019, 12:22:16 pm »
Any clues in the apache error log?  Probably in /var/log/apache2/error.log

Re: Problems with apache2 on debian 9
« Reply #2 on: 14 March, 2019, 01:07:06 pm »
Looks like a bug in the 389-admin package:

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

I think the underlying issue is that 389-admin is attempting to start its own instance of apache but that some manual configuration is required before it will start.

Gattopardo

  • Lord of the sith
  • Overseaing the building of the death star
Re: Problems with apache2 on debian 9
« Reply #3 on: 14 March, 2019, 06:24:48 pm »
Looks like a bug in the 389-admin package:

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

I think the underlying issue is that 389-admin is attempting to start its own instance of apache but that some manual configuration is required before it will start.

Looked through the bug list and this has been fixed, so wondering what I am doing wrong.

Any clues in the apache error log?  Probably in /var/log/apache2/error.log

Will get a copy.

It is annoying that this install has now failed to produce a useable computer.

Re: Problems with apache2 on debian 9
« Reply #4 on: 14 March, 2019, 06:54:48 pm »
The bug is not fixed in the version of the 389-admin package in Debian stable.

The package 389-admin appears to have been removed from the next Debian release:

https://tracker.debian.org/pkg/389-admin

Do you need 389-admin? Do you need the special 389-admin instance of apache to run?  If you just want standard apache then you could remove 389-admin, or you could disable the 389-admin instance of apache:

systemctl disable dirsrv-admin.service

Gattopardo

  • Lord of the sith
  • Overseaing the building of the death star
Re: Problems with apache2 on debian 9
« Reply #5 on: 17 March, 2019, 04:26:47 pm »
Hello

Any clues in the apache error log?  Probably in /var/log/apache2/error.log

Here is the error log
Quote
GNU nano 2.7.4                   File: error.log                             

[Wed Mar 13 20:27:14.930050 2019] [mpm_event:notice] [pid 26542:tid 14070197135$
[Wed Mar 13 20:27:14.930137 2019] [core:notice] [pid 26542:tid 140701971353664]$
[Wed Mar 13 20:37:27.168585 2019] [mpm_event:notice] [pid 26542:tid 14070197135$
[Wed Mar 13 20:38:29.390049 2019] [mpm_event:notice] [pid 598:tid 1406973298975$
[Wed Mar 13 20:38:29.505200 2019] [core:notice] [pid 598:tid 140697329897536] A$
[Wed Mar 13 20:58:37.059512 2019] [mpm_event:notice] [pid 598:tid 1406973298975$

                                [ Read 6 lines ]
^G Get Help  ^O Write Out ^W Where Is  ^K Cut Text  ^J Justify   ^C Cur Pos
^X Exit      ^R Read File ^\ Replace   ^U Uncut Text^T To Spell  ^_ Go To Line

Though I'd add the apache2.conf
Quote
# This is the main Apache server configuration file.  It contains the
# configuration directives that give the server its instructions.
# See http://httpd.apache.org/docs/2.4/ for detailed information about
# the directives and /usr/share/doc/apache2/README.Debian about Debian specific
# hints.
#
#
# Summary of how the Apache 2 configuration works in Debian:
# The Apache 2 web server configuration in Debian is quite different to
# upstream's suggested way to configure the web server. This is because Debian's
# default Apache2 installation attempts to make adding and removing modules,
# virtual hosts, and extra configuration directives as flexible as possible, in
# order to make automating the changes and administering the server as easy as
# possible.

# It is split into several files forming the configuration hierarchy outlined
# below, all located in the /etc/apache2/ directory:
#
#   /etc/apache2/
#   |-- apache2.conf
#   |   `--  ports.conf
#   |-- mods-enabled
#   |   |-- *.load
#   |   `-- *.conf
#   |-- conf-enabled
#   |   `-- *.conf
#    `-- sites-enabled
#       `-- *.conf
#
#
# * apache2.conf is the main configuration file (this file). It puts the pieces
#   together by including all remaining configuration files when starting up the
#   web server.
#
# * ports.conf is always included from the main configuration file. It is
#   supposed to determine listening ports for incoming connections which can be
#   customized anytime.
#
# * Configuration files in the mods-enabled/, conf-enabled/ and sites-enabled/
#   directories contain particular configuration snippets which manage modules,
#   global configuration fragments, or virtual host configurations,
#   respectively.
#
#   They are activated by symlinking available configuration files from their
#   respective *-available/ counterparts. These should be managed by using our
#   helpers a2enmod/a2dismod, a2ensite/a2dissite and a2enconf/a2disconf. See
#   their respective man pages for detailed information.
#
# * The binary is called apache2. Due to the use of environment variables, in
#   the default configuration, apache2 needs to be started/stopped with
#   /etc/init.d/apache2 or apache2ctl. Calling /usr/bin/apache2 directly will not
#   work with the default configuration.


# Global configuration
#

#
# ServerRoot: The top of the directory tree under which the server's
# configuration, error, and log files are kept.
#
# NOTE!  If you intend to place this on an NFS (or otherwise network)
# mounted filesystem then please read the Mutex documentation (available
# at <URL:http://httpd.apache.org/docs/2.4/mod/core.html#mutex>);
# you will save yourself a lot of trouble.
#
# Do NOT add a slash at the end of the directory path.
#
#ServerRoot "/etc/apache2"

#
# The accept serialization lock file MUST BE STORED ON A LOCAL DISK.
#
#Mutex file:${APACHE_LOCK_DIR} default

#
# The directory where shm and other runtime files will be stored.
#

DefaultRuntimeDir ${APACHE_RUN_DIR}

#
# PidFile: The file in which the server should record its process
# identification number when it starts.
# This needs to be set in /etc/apache2/envvars
#
PidFile ${APACHE_PID_FILE}

#
# Timeout: The number of seconds before receives and sends time out.
#
Timeout 300

#
# KeepAlive: Whether or not to allow persistent connections (more than
# one request per connection). Set to "Off" to deactivate.
#
KeepAlive On

#
# MaxKeepAliveRequests: The maximum number of requests to allow
# during a persistent connection. Set to 0 to allow an unlimited amount.
# We recommend you leave this number high, for maximum performance.
#
MaxKeepAliveRequests 100

#
# KeepAliveTimeout: Number of seconds to wait for the next request from the
# same client on the same connection.
#
KeepAliveTimeout 5


# These need to be set in /etc/apache2/envvars
User ${APACHE_RUN_USER}
Group ${APACHE_RUN_GROUP}

#
# HostnameLookups: Log the names of clients or just their IP addresses
# e.g., www.apache.org (on) or 204.62.129.132 (off).
# The default is off because it'd be overall better for the net if people
# had to knowingly turn this feature on, since enabling it means that
# each client request will result in AT LEAST one lookup request to the
# nameserver.
#
HostnameLookups Off

# ErrorLog: The location of the error log file.
# If you do not specify an ErrorLog directive within a <VirtualHost>
# container, error messages relating to that virtual host will be
# logged here.  If you *do* define an error logfile for a <VirtualHost>
# container, that host's errors will be logged there and not here.
#
ErrorLog ${APACHE_LOG_DIR}/error.log

#
# LogLevel: Control the severity of messages logged to the error_log.
# Available values: trace8, ..., trace1, debug, info, notice, warn,
# error, crit, alert, emerg.
# It is also possible to configure the log level for particular modules, e.g.
# "LogLevel info ssl:warn"
#
LogLevel warn

# Include module configuration:
IncludeOptional mods-enabled/*.load
IncludeOptional mods-enabled/*.conf

# Include list of ports to listen on
Include ports.conf


# Sets the default security model of the Apache2 HTTPD server. It does
# not allow access to the root filesystem outside of /usr/share and /var/www.
# The former is used by web applications packaged in Debian,
# the latter may be used for local directories served by the web server. If
# your system is serving content from a sub-directory in /srv you must allow
# access here, or in any related virtual host.
<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 None
   Require all granted
</Directory>

#<Directory /srv/>
#   Options Indexes FollowSymLinks
#   AllowOverride None
#   Require all granted
#</Directory>




# AccessFileName: The name of the file to look for in each directory
# for additional configuration directives.  See also the AllowOverride
# directive.
#
AccessFileName .htaccess

#
# The following lines prevent .htaccess and .htpasswd files from being
# viewed by Web clients.
#
<FilesMatch "^\.ht">
   Require all denied
</FilesMatch>


#
# The following directives define some format nicknames for use with
# a CustomLog directive.
#
# These deviate from the Common Log Format definitions in that they use %O
# (the actual bytes sent including headers) instead of %b (the size of the
# requested file), because the latter makes it impossible to detect partial
# requests.
#
# Note that the use of %{X-Forwarded-For}i instead of %h is not recommended.
# Use mod_remoteip instead.
#
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

# Include of directories ignores editors' and dpkg's backup files,
# see README.Debian for details.

# Include generic snippets of statements
IncludeOptional conf-enabled/*.conf

# Include the virtual host configurations:
IncludeOptional sites-enabled/*.conf

# vim: syntax=apache ts=4 sw=4 sts=4 sr noet

Gattopardo

  • Lord of the sith
  • Overseaing the building of the death star
Re: Problems with apache2 on debian 9
« Reply #6 on: 17 March, 2019, 04:41:53 pm »
The bug is not fixed in the version of the 389-admin package in Debian stable.

The package 389-admin appears to have been removed from the next Debian release:

https://tracker.debian.org/pkg/389-admin

Do you need 389-admin? Do you need the special 389-admin instance of apache to run?  If you just want standard apache then you could remove 389-admin, or you could disable the 389-admin instance of apache:

systemctl disable dirsrv-admin.service

No idea what the package is attached to.

Looked at https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=870032 and don't understand what to do:

Quote
Good evening,
I faced the same issue. In the end it turned out that I had to run:
a2dismod mpm_event
a2enmod mpm_worker

to change the mpm module as mpm_event was enabled by default and mpm_worker was
included by the dirsrv-admin config, but Apache can only run one and but needs
one to start.

Not sure how to include that into the package.

Best regards
Thore

Re: Problems with apache2 on debian 9
« Reply #7 on: 17 March, 2019, 09:22:17 pm »
apache2.conf is the wrong file as that is the config file for the normal apache instance. The 389-admin package is trying to run a separate instance of apache, apparently listening on port 9830, which uses a different config file (see the -f argument in the error message), namely:

/etc/dirsrv/admin-serv/httpd.conf

This file includes the other config files in the same directory: admserv.conf, console.conf, nss.conf

The bug report suggests that some manual configuration is necessary before the 389-admin instance will run, it suggests that 'setup-ds-admin' needs to be run but I have no idea what that does. There is a an example config file /usr/share/doc/389-admin/examples/adm.conf which is not an apache config but might be a setup-ds-admin config.

You might be able to debug the problem by running

/usr/sbin/apache2 -t -f /etc/dirsrv/admin-serv/httpd.conf

which will attempt to check the syntax of specified file.

It's a bit non-Debian for 389-admin to be running a separate instance of apache. A better Debian integration would probably have the standard apache instance listen on the extra port and have the necessary 389-admin config files be included by the standard config. Since the package has been removed from the next release I suspect there is little interest in fixing these problems.

Re: Problems with apache2 on debian 9
« Reply #8 on: 17 March, 2019, 09:34:21 pm »
Also you are looking in the wrong error log file. The file /etc/dirsrv/admin-serv/console.conf appears to put the error log at

/var/log/dirsrv/admin-serv/error

Gattopardo

  • Lord of the sith
  • Overseaing the building of the death star
Re: Problems with apache2 on debian 9
« Reply #9 on: 20 March, 2019, 01:54:48 pm »
apache2.conf is the wrong file as that is the config file for the normal apache instance. The 389-admin package is trying to run a separate instance of apache, apparently listening on port 9830, which uses a different config file (see the -f argument in the error message), namely:

/etc/dirsrv/admin-serv/httpd.conf

This file includes the other config files in the same directory: admserv.conf, console.conf, nss.conf

Tried to navigate to these files but admin-serv is an empty directory as the ls comand was coming up with nothing.

Quote
You might be able to debug the problem by running

/usr/sbin/apache2 -t -f /etc/dirsrv/admin-serv/httpd.conf

which will attempt to check the syntax of specified file.



Gives this output:

AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1. Set the 'ServerName' directive globally to suppress this message
(2)No such file or directory: AH02291: Cannot access directory '/var/log/dirsrv/admin-serv/' for main error log
AH00014: Configuration check failed
root@debian:/home/dell#

Re: Problems with apache2 on debian 9
« Reply #10 on: 20 March, 2019, 04:10:45 pm »
apache2.conf is the wrong file as that is the config file for the normal apache instance. The 389-admin package is trying to run a separate instance of apache, apparently listening on port 9830, which uses a different config file (see the -f argument in the error message), namely:

/etc/dirsrv/admin-serv/httpd.conf

This file includes the other config files in the same directory: admserv.conf, console.conf, nss.conf

Tried to navigate to these files but admin-serv is an empty directory as the ls comand was coming up with nothing.

You must be mistaken, you have accessed the httpd.conf file when you ran the command below (it would fail with 'Could not open configuration file' if the file did not exist):
Quote

Quote
You might be able to debug the problem by running

/usr/sbin/apache2 -t -f /etc/dirsrv/admin-serv/httpd.conf

which will attempt to check the syntax of specified file.



Gives this output:

AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1. Set the 'ServerName' directive globally to suppress this message
(2)No such file or directory: AH02291: Cannot access directory '/var/log/dirsrv/admin-serv/' for main error log
AH00014: Configuration check failed
root@debian:/home/dell#

That's why the 389-admin instance of apache is failing to start: the config file is not valid. You are seeing the same errors as in the Debian bug report. You could follow the bug report and fix the above errors but then I guess you will get to the next error, 'unable to create AdmldapInfo',  and I have no idea how to fix that.

389-ds is a redhat project https://directory.fedoraproject.org/ and the Debian integration appears to be less than ideal. The next version of Debian has a newer version of 389-ds and has dropped 389-admin.

Do you really need the 389-admin instance of apache listening on port 9830? If you only want the standard instance of apache listening on port 80 then I would recommend disabling or removing 389-admin. If you really want the 389-admin instance then you will need to create a valid configuration file. I don't know what such a file would look like, I don't know if the 'setup-ds-admin' script is supposed to create it, and I don't know if the script works on Debian.