alfirdaous
November 24th, 2016, 05:47 AM
I tried to install the mod-evasiv from this link (http://www.techrepublic.com/blog/smb-technologist/secure-your-apache-server-from-ddos-slowloris-and-dns-injection-attacks/), then the apache2 does NOT work at all, it says:
env: apache2ctl: No such file or directory
I tried so many commands line to resolve it, but by the end I removed the apache2 then try to reinstall it:
# apt-get install apache2
Reading package lists... Done
Building dependency tree
Reading state information... Done
apache2 is already the newest version.
You might want to run 'apt-get -f install' to correct these:
The following packages have unmet dependencies:
apache2 : Depends: apache2-mpm-worker (= 2.2.22-1ubuntu1.11) but it is not going to be installed or
apache2-mpm-prefork (= 2.2.22-1ubuntu1.11) but it is not going to be installed or
apache2-mpm-event (= 2.2.22-1ubuntu1.11) but it is not going to be installed or
apache2-mpm-itk (= 2.2.22-1ubuntu1.11) but it is not going to be installed
Depends: apache2.2-common (= 2.2.22-1ubuntu1.11) but it is not going to be installed
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).
Then as said to try the command apt-get -f install:
Do you want to continue [Y/n]?
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
LANGUAGE = (unset),
LC_ALL = (unset),
LC_CTYPE = "UTF-8",
LANG = "en_GB.UTF-8"
are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
locale: Cannot set LC_CTYPE to default locale: No such file or directory
locale: Cannot set LC_ALL to default locale: No such file or directory
debconf: DbDriver "config": /var/cache/debconf/config.dat is locked by another process: Resource temporarily unavailable
(Reading database ... 194092 files and directories currently installed.)
Unpacking apache2.2-bin (from .../apache2.2-bin_2.2.22-1ubuntu1.11_amd64.deb) ...
dpkg: error processing /var/cache/apt/archives/apache2.2-bin_2.2.22-1ubuntu1.11_amd64.deb (--unpack):
trying to overwrite '/usr/lib/apache2/modules/mod_authnz_ldap.so', which is also in package apache2-bin 2.4.16-4+deb.sury.org~precise+4
dpkg-deb: error: subprocess paste was killed by signal (Broken pipe)
Unpacking apache2.2-common (from .../apache2.2-common_2.2.22-1ubuntu1.11_amd64.deb) ...
dpkg: error processing /var/cache/apt/archives/apache2.2-common_2.2.22-1ubuntu1.11_amd64.deb (--unpack):
trying to overwrite '/usr/share/apache2/default-site/index.html', which is also in package apache2-data 2.4.16-4+deb.sury.org~precise+4
dpkg-deb: error: subprocess paste was killed by signal (Broken pipe)
Unpacking apache2-mpm-worker (from .../apache2-mpm-worker_2.2.22-1ubuntu1.11_amd64.deb) ...
dpkg: error processing /var/cache/apt/archives/apache2-mpm-worker_2.2.22-1ubuntu1.11_amd64.deb (--unpack):
trying to overwrite '/usr/sbin/apache2', which is also in package apache2-bin 2.4.16-4+deb.sury.org~precise+4
Processing triggers for ureadahead ...
Processing triggers for ufw ...
Errors were encountered while processing:
/var/cache/apt/archives/apache2.2-bin_2.2.22-1ubuntu1.11_amd64.deb
/var/cache/apt/archives/apache2.2-common_2.2.22-1ubuntu1.11_amd64.deb
/var/cache/apt/archives/apache2-mpm-worker_2.2.22-1ubuntu1.11_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
The service is not recognized:
# service apache2 status
apache2: unrecognized service
My configuration is:
# lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 12.04.5 LTS
Release: 12.04
Codename: precise
How can I get back the apache2?
Thanks in advance
env: apache2ctl: No such file or directory
I tried so many commands line to resolve it, but by the end I removed the apache2 then try to reinstall it:
# apt-get install apache2
Reading package lists... Done
Building dependency tree
Reading state information... Done
apache2 is already the newest version.
You might want to run 'apt-get -f install' to correct these:
The following packages have unmet dependencies:
apache2 : Depends: apache2-mpm-worker (= 2.2.22-1ubuntu1.11) but it is not going to be installed or
apache2-mpm-prefork (= 2.2.22-1ubuntu1.11) but it is not going to be installed or
apache2-mpm-event (= 2.2.22-1ubuntu1.11) but it is not going to be installed or
apache2-mpm-itk (= 2.2.22-1ubuntu1.11) but it is not going to be installed
Depends: apache2.2-common (= 2.2.22-1ubuntu1.11) but it is not going to be installed
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).
Then as said to try the command apt-get -f install:
Do you want to continue [Y/n]?
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
LANGUAGE = (unset),
LC_ALL = (unset),
LC_CTYPE = "UTF-8",
LANG = "en_GB.UTF-8"
are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
locale: Cannot set LC_CTYPE to default locale: No such file or directory
locale: Cannot set LC_ALL to default locale: No such file or directory
debconf: DbDriver "config": /var/cache/debconf/config.dat is locked by another process: Resource temporarily unavailable
(Reading database ... 194092 files and directories currently installed.)
Unpacking apache2.2-bin (from .../apache2.2-bin_2.2.22-1ubuntu1.11_amd64.deb) ...
dpkg: error processing /var/cache/apt/archives/apache2.2-bin_2.2.22-1ubuntu1.11_amd64.deb (--unpack):
trying to overwrite '/usr/lib/apache2/modules/mod_authnz_ldap.so', which is also in package apache2-bin 2.4.16-4+deb.sury.org~precise+4
dpkg-deb: error: subprocess paste was killed by signal (Broken pipe)
Unpacking apache2.2-common (from .../apache2.2-common_2.2.22-1ubuntu1.11_amd64.deb) ...
dpkg: error processing /var/cache/apt/archives/apache2.2-common_2.2.22-1ubuntu1.11_amd64.deb (--unpack):
trying to overwrite '/usr/share/apache2/default-site/index.html', which is also in package apache2-data 2.4.16-4+deb.sury.org~precise+4
dpkg-deb: error: subprocess paste was killed by signal (Broken pipe)
Unpacking apache2-mpm-worker (from .../apache2-mpm-worker_2.2.22-1ubuntu1.11_amd64.deb) ...
dpkg: error processing /var/cache/apt/archives/apache2-mpm-worker_2.2.22-1ubuntu1.11_amd64.deb (--unpack):
trying to overwrite '/usr/sbin/apache2', which is also in package apache2-bin 2.4.16-4+deb.sury.org~precise+4
Processing triggers for ureadahead ...
Processing triggers for ufw ...
Errors were encountered while processing:
/var/cache/apt/archives/apache2.2-bin_2.2.22-1ubuntu1.11_amd64.deb
/var/cache/apt/archives/apache2.2-common_2.2.22-1ubuntu1.11_amd64.deb
/var/cache/apt/archives/apache2-mpm-worker_2.2.22-1ubuntu1.11_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
The service is not recognized:
# service apache2 status
apache2: unrecognized service
My configuration is:
# lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 12.04.5 LTS
Release: 12.04
Codename: precise
How can I get back the apache2?
Thanks in advance