Apache 2 configtest failed: File name too long - apache2

I run an apache2 webserver locally on a raspberry-pi with raspbian distro.
It worked without a problem until suddenly it can't be started anymore with
sudo /etc/init.d/apache2 start, which yields the following error:
[....] Starting apache2 (via systemctl): apache2.serviceJob for
apache2.service failed. See 'systemctl status apache2.service' and
'journalctl -xn' for details. failed!
Removing and reinstalling with apt-get doesn't solve it.systemctl status shows the following entries:
> Apr 22 11:27:16 raspberrypi apache2[18234]: [344B blob data] Apr 22
> 11:27:16 raspberrypi apache2[18234]: [293B blob data] Apr 22 11:27:16
> raspberrypi apache2[18234]: [293B blob data] Apr 22 11:27:16
> raspberrypi apache2[18234]: [293B blob data] Apr 22 11:27:16
> raspberrypi apache2[18234]: [293B blob data] Apr 22 11:27:16
> raspberrypi apache2[18234]: Action 'configtest' failed. Apr 22
> 11:27:16 raspberrypi apache2[18234]: The Apache error log may have
> more information. Apr 22 11:27:16 raspberrypi systemd[1]:
> apache2.service: control process exited, code=exited status=1 Apr 22
> 11:27:16 raspberrypi systemd[1]: Failed to start LSB: Apache2 web
> server. Apr 22 11:27:16 raspberrypi systemd[1]: Unit apache2.service
> entered failed state.
journalctl -xn yields:
> -- Logs begin at Sun 2017-04-23 07:06:12 UTC, end at Sun 2017-04-23 12:38:48 UTC. -- Apr 23 12:38:30 raspberrypi apache2[3292]: [2.0K blob
> data] Apr 23 12:38:30 raspberrypi apache2[3292]: [1.7K blob data] Apr
> 23 12:38:30 raspberrypi apache2[3292]: Action 'configtest' failed. Apr
> 23 12:38:30 raspberrypi apache2[3292]: The Apache error log may have
> more information. Apr 23 12:38:31 raspberrypi systemd[1]:
> apache2.service: control process exited, code=exited status=1 Apr 23
> 12:38:31 raspberrypi systemd[1]: Failed to start LSB: Apache2 web
> server.
> -- Subject: Unit apache2.service has failed
> -- Defined-By: systemd
> -- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
> --
> -- Unit apache2.service has failed.
> --
> -- The result is failed. Apr 23 12:38:31 raspberrypi systemd[1]: Unit apache2.service entered failed state. Apr 23 12:38:31 raspberrypi
> sudo[3278]: pam_unix(sudo:session): session closed for user root Apr
> 23 12:38:48 raspberrypi sudo[3345]: pi : TTY=pts/0 ;
> PWD=/etc/apache2/conf-enabled ; USER=root ; COMMAND=/bin/journalctl
> -xn Apr 23 12:38:48 raspberrypi sudo[3345]: pam_unix(sudo:session): session opened for user root by pi(uid=0)
Unfortunately the apache error.log contains no useful information whatsoever. But if i run apache2 configtest I get a "File name too long" error.
Strangely even after formatting my sdcard and putting a fresh copy of the distribution image on it and reinstalling apache2 the error remains.
What can I do?

Related

apache2 restart problem on ubuntu 20.04 LTS

I had installed nginx but now i uninstalled the nginx facing this problem
when i run command "system start apache2"
it through the massage run "journalctl -xeu apache2.service" to check error massage when i run the above command it give following massage
Oct 29 17:37:32 localhost apachectl[37192]: (98)Address already in use: AH00072: make_sock: could not bind to address [::]:80
Oct 29 17:37:32 localhost apachectl[37192]: (98)Address already in use: AH00072: make_sock: could not bind to address 0.0.0.0:80
Oct 29 17:37:32 localhost apachectl[37192]: no listening sockets available, shutting down
Oct 29 17:37:32 localhost apachectl[37192]: AH00015: Unable to open logs
Oct 29 17:37:32 localhost apachectl[37189]: Action 'start' failed.
Oct 29 17:37:32 localhost apachectl[37189]: The Apache error log may have more information.
Oct 29 17:37:32 localhost systemd[1]: apache2.service: Control process exited, code=exited, status=1/FAILURE
I am not able to start my apache2 server

systemctl start postgresql-13 start failed

enter image description here
I am trying to install netboxtool but when i try to start postgesql it giving me below errors.Selinux already disabled.
[1][root#it ~]# systemctl start postgresql-13 Job for postgresql-13.service failed because the control process exited with error code. See "systemctl status postgresql-13.service" and "journalctl -xe" for details. [root#it ~]# journalctl -xe -- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- Unit session-6.scope has finished starting up.
-- The start-up result is done. Apr 09 19:32:45 it sshd[2686]: pam_unix(sshd:session): session opened for user root by (uid=0) Apr 09 19:32:45 it systemd-logind[641]: New session 6 of user root. -- Subject: A new session 6 has been created for user root -- Defined-By: systemd -- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel -- Documentation: http://www.freedesktop.org/wiki/Software/systemd/multiseat
-- A new session with the ID 6 has been created for the user root.
-- The leading process of the session is 2686. Apr 09 19:32:50 it polkitd[1383]: Registered Authentication Agent for unix-process:2714:612049 (system bus name :1.38 [/usr/bin/pkttyagent --notify-fd 5 --fallbac Apr 09 19:32:50 it systemd1: Starting PostgreSQL 13 database server... -- Subject: Unit postgresql-13.service has begun start-up -- Defined-By: systemd -- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- Unit postgresql-13.service has begun starting up. Apr 09 19:32:50 it postgresql-13-check-db-dir[2720]: "/var/lib/pgsql/13/data/" is missing or empty. Apr 09 19:32:50 it postgresql-13-check-db-dir[2720]: Use "/usr/pgsql-13/bin/postgresql-13-setup initdb" to initialize the database cluster. Apr 09 19:32:50 it postgresql-13-check-db-dir[2720]: See /usr/share/doc/postgresql13-13.6/README.rpm-dist for more information. Apr 09 19:32:50 it systemd1: postgresql-13.service: control process exited, code=exited status=1 Apr 09 19:32:50 it systemd1: Failed to start PostgreSQL 13 database server. -- Subject: Unit postgresql-13.service has failed -- Defined-By: systemd -- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- Unit postgresql-13.service has failed.
-- The result is failed. Apr 09 19:32:50 it systemd1: Unit postgresql-13.service entered failed state. Apr 09 19:32:50 it systemd1: postgresql-13.service failed. Apr 09 19:32:50 it polkitd[1383]: Unregistered Authentication Agent for unix-process:2714:612049 (system bus name :1.38, object path /org/freedesktop/PolicyKit1/A lines 2130-2166/2166 (END)
The error states that the default data directory /var/lib/pgsql/13/data is missing. Check if that exists and create it.

Cannot start Apache2 server on RaspberryPi 4

I installed Apache2 on Raspberry Pi4 B but it is not starting. If anyone had the same issue, please let me know the solution.
Created symlink /etc/systemd/system/multi-user.target.wants/apache2.service → /lib/systemd/system/apache2.service.
Created symlink /etc/systemd/system/multi-user.target.wants/apache-htcacheclean.service → /lib/systemd/system/apache-htcacheclean.service.
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 Mon 2021-06-07 21:07:32 EEST; 22ms ago
Docs: https://httpd.apache.org/docs/2.4/
Process: 30140 ExecStart=/usr/sbin/apachectl start (code=exited, status=127)
Jun 07 21:07:32 raspberrypi systemd[1]: Starting The Apache HTTP Server...
Jun 07 21:07:32 raspberrypi apachectl[30140]: /usr/sbin/apachectl: 174: /usr/sbin/apachectl: /usr/sbin/apache2: not found
Jun 07 21:07:32 raspberrypi apachectl[30140]: Action 'start' failed.
Jun 07 21:07:32 raspberrypi apachectl[30140]: The Apache error log may have more information.
Jun 07 21:07:32 raspberrypi systemd[1]: apache2.service: Control process exited, code=exited, status=127/n/a
Jun 07 21:07:32 raspberrypi systemd[1]: apache2.service: Failed with result 'exit-code'.
Jun 07 21:07:32 raspberrypi systemd[1]: Failed to start The Apache HTTP Server.
Processing triggers for man-db (2.8.5-2) ...
Processing triggers for systemd (241-7~deb10u4+rpi1) ...
Problem solved with:
sudo apt install --reinstall apache2-bin
sudo service apache2 start

MSSQL Service failed to start on ubuntu

Every time i checked the MSSQL service is failing i have over 5 GB memory on my virtual server. I have changed the sql port to 1533.
r*****k:~# sudo systemctl status mssql-server
● mssql-server.service - Microsoft SQL Server Database Engine
Loaded: loaded (/lib/systemd/system/mssql-server.service; enabled; vendor preset: enabled)
Active: inactive (dead) (Result: exit-code) since Fri 2017-11-17 15:39:39 UTC; 1min 37s ago
Process: 4906 ExecStart=/opt/mssql/bin/sqlservr (code=exited, status=255)
Main PID: 4906 (code=exited, status=255)
Nov 17 15:39:39 SV0*****com systemd[1]: mssql-server.service: Unit entered failed state.
Nov 17 15:39:39 SV0*****com systemd[1]: mssql-server.service: Failed with result 'exit-code'.
Nov 17 15:39:39 SV0*****.com systemd[1]: mssql-server.service: Service hold-off time over, scheduling restart.
Nov 17 15:39:39 SV0*****.com systemd[1]: Stopped Microsoft SQL Server Database Engine.
Nov 17 15:39:39 SV0*****.com systemd[1]: mssql-server.service: Start request repeated too quickly.
Nov 17 15:39:39 SV0*****.com systemd[1]: Failed to start Microsoft SQL Server Database Engine.
r*****k:/var/opt/mssql# cat mssql.conf
> [EULA] accepteula = Y</br>
>
> [network] ipaddress = 6*.*1.1*2.*8 kerberoskeytabfile =
> /var/opt/mssql/secrets/mssql.keytab tcpport = 1533
>
> [memory] memorylimitmb = 3328
>
> [filelocation] defaultdatadir = /tmp/data
Anyone can help to stable the mssql service on the vm.
Does your Ubuntu server have the firewall enabled? If so, it may be blocking port 1533, which is preventing the service from starting on that custom port.
You may want to look in /var/log/messages for additional information as well.

Nagios is active on CLI but not running on Web Interface

Good morning,
I have a problem with my Nagios configuration. This is the response of service nagios status :
root#SRV-SUPERVISION-BT:~# service nagios status
● nagios.service - LSB: Starts and stops the Nagios monitoring server
Loaded: loaded (/etc/init.d/nagios)
Active: active (running) since ven. 2016-06-17 09:47:46 CEST; 41min ago
Process: 458 ExecStart=/etc/init.d/nagios start (code=exited, status=0/SUCCESS)
CGroup: /system.slice/nagios.service
├─533 /usr/local/nagios/bin/nagios -d /usr/local/nagios/etc/nagios...
├─553 /usr/local/nagios/bin/nagios --worker /usr/local/nagios/var/...
├─555 /usr/local/nagios/bin/nagios --worker /usr/local/nagios/var/...
├─556 /usr/local/nagios/bin/nagios --worker /usr/local/nagios/var/...
├─558 /usr/local/nagios/bin/nagios --worker /usr/local/nagios/var/...
├─559 /usr/local/nagios/bin/nagios --worker /usr/local/nagios/var/...
├─560 /usr/local/nagios/bin/nagios --worker /usr/local/nagios/var/...
└─623 /usr/local/nagios/bin/nagios -d /usr/local/nagios/etc/nagios...
juin 17 09:47:46 SRV-SUPERVISION-BT nagios[533]: nerd: Channel opathchecks r...y
juin 17 09:47:46 SRV-SUPERVISION-BT nagios[533]: nerd: Fully initialized and...!
juin 17 09:47:46 SRV-SUPERVISION-BT nagios[533]: wproc: Successfully registe...r
juin 17 09:47:46 SRV-SUPERVISION-BT nagios[533]: wproc: Registry request: na...3
juin 17 09:47:46 SRV-SUPERVISION-BT nagios[533]: wproc: Registry request: na...8
juin 17 09:47:46 SRV-SUPERVISION-BT nagios[533]: wproc: Registry request: na...9
juin 17 09:47:46 SRV-SUPERVISION-BT nagios[533]: wproc: Registry request: na...6
juin 17 09:47:46 SRV-SUPERVISION-BT nagios[533]: wproc: Registry request: na...0
juin 17 09:47:46 SRV-SUPERVISION-BT nagios[533]: wproc: Registry request: na...5
juin 17 09:47:48 SRV-SUPERVISION-BT nagios[533]: Successfully launched comma...3
Hint: Some lines were ellipsized, use -l to show in full.
But when I'm going on the web interface, Nagios Core is not running.
The configtest command is also right :
root#SRV-SUPERVISION-BT:~# service nagios configtest
Nagios Core 4.1.1
Copyright (c) 2009-present Nagios Core Development Team and Community Contributors
Copyright (c) 1999-2009 Ethan Galstad
Last Modified: 08-19-2015
License: GPL
Website: https://www.nagios.org
Reading configuration data...
Read main config file okay...
Read object config files okay...
Running pre-flight check on configuration data...
Checking objects...
Checked 8 services.
Checked 1 hosts.
Checked 1 host groups.
Checked 0 service groups.
Checked 1 contacts.
Checked 1 contact groups.
Checked 24 commands.
Checked 5 time periods.
Checked 0 host escalations.
Checked 0 service escalations.
Checking for circular paths...
Checked 1 hosts
Checked 0 service dependencies
Checked 0 host dependencies
Checked 5 timeperiods
Checking global event handlers...
Checking obsessive compulsive processor commands...
Checking misc settings...
Total Warnings: 0
Total Errors: 0
Things look okay - No serious problems were detected during the pre-flight check
Object precache file created:
/usr/local/nagios/var/objects.precache
Also, this is the right of my /usr/local/nagios/var:
root#SRV-SUPERVISION-BT:/usr/local/nagios/bin# ls /usr/local/nagios/var -l
total 88
drwxrwsr-x 2 nagios nagios 4096 juin 16 23:59 archives
-rw-r--r-- 1 nagios nagios 34 juin 17 11:00 nagios.configtest
-rw-r--r-- 1 nagios nagios 4 juin 17 09:47 nagios.lock
-rw-r--r-- 1 nagios nagios 3007 juin 17 10:47 nagios.log
-rw-r--r-- 1 nagios nagios 12665 juin 17 09:47 objects.cache
-rw-r--r-- 1 nagios nagios 12665 juin 17 11:00 objects.precache
-rw------- 1 nagios nagios 13062 juin 17 10:47 retention.dat
drwxrwsr-x 2 nagios nagcmd 4096 juin 17 09:47 rw
drwxr-sr-x 3 root nagios 4096 juin 3 08:28 spool
-rw-rw-r-- 1 nagios nagios 13485 juin 17 11:26 status.dat
I'm on Debian :
root#SRV-SUPERVISION-BT:~# uname -a
Linux SRV-SUPERVISION-BT 3.16.0-4-amd64 #1 SMP Debian 3.16.7-ckt25-2 (2016-04-08) x86_64 GNU/Linux
I do not understand the problem. If anyone can help me, thanks in advance.
First you must install fcgiwrap:
Depending on your distribution you should use your package manager.
Then, you should enable cgi module in your Web Server, for examle, in apache:
Finally, restart apache and it´s should be work.
You must install/run fcgiwrap and use it in your web-server apache/nginx/..

Resources