Resolved: apache2 error : /etc/apache2/envvars: No such file or directory
By mistake I deleted /etc/apache2 directory. So I thought reinstall is the only option I have, then I removed apache2 package with all config files.
#apt-get purge apache2
Now I am trying to install apache2 package
#apt-get install apache2
But system is giving following error.
Error :
debian:~# apt-get install apache2
Reading package lists… Done
Building dependency tree
Reading state information… Done
The following extra packages will be installed:
apache2-mpm-worker apache2-utils apache2.2-common libapr1 libaprutil1 libpq5
Suggested packages:
apache2-doc apache2-suexec apache2-suexec-custom
The following NEW packages will be installed:
apache2 apache2-mpm-worker apache2-utils apache2.2-common libapr1 libaprutil1 libpq5
0 upgraded, 7 newly installed, 0 to remove and 123 not upgraded.
Need to get 0B/1837kB of archives.
After this operation, 6160kB of additional disk space will be used.
Do you want to continue [Y/n]? y
Selecting previously deselected package libapr1.
(Reading database … 90320 files and directories currently installed.)
Unpacking libapr1 (from …/libapr1_1.2.12-5_amd64.deb) …
Selecting previously deselected package libpq5.
Unpacking libpq5 (from …/libpq5_8.3.7-0lenny1_amd64.deb) …
Selecting previously deselected package libaprutil1.
Unpacking libaprutil1 (from …/libaprutil1_1.2.12+dfsg-8+lenny3_amd64.deb) …
Selecting previously deselected package apache2-utils.
Unpacking apache2-utils (from …/apache2-utils_2.2.9-10+lenny3_amd64.deb) …
Selecting previously deselected package apache2.2-common.
Unpacking apache2.2-common (from …/apache2.2-common_2.2.9-10+lenny3_amd64.deb) …
Selecting previously deselected package apache2-mpm-worker.
Unpacking apache2-mpm-worker (from …/apache2-mpm-worker_2.2.9-10+lenny3_amd64.deb) …
Selecting previously deselected package apache2.
Unpacking apache2 (from …/apache2_2.2.9-10+lenny3_all.deb) …
Processing triggers for man-db …
Setting up libapr1 (1.2.12-5) …
Setting up libpq5 (8.3.7-0lenny1) …
Setting up libaprutil1 (1.2.12+dfsg-8+lenny3) …
Setting up apache2-utils (2.2.9-10+lenny3) …
Setting up apache2.2-common (2.2.9-10+lenny3) …
Setting up apache2-mpm-worker (2.2.9-10+lenny3) …
ERROR: Module cgid does not exist!
ERROR: Module cgid does not exist!
It looks like you’ve deleted /etc/apache2/mods-available/cgid.load, so mod_cgid cannot be enabled. To fix this, please purge and reinstall apache2.2-common.
/etc/init.d/apache2: line 44: /etc/apache2/envvars: No such file or directory
invoke-rc.d: initscript apache2, action “start” failed.
Setting up apache2 (2.2.9-10+lenny3) …
Can anybody tell me how to make it correct.
I found the hack to resolve this issue:
After googling number of forums and blogs, one place I found small one liner bash script which has resolved this issue.
sudo apt-get remove –purge $(dpkg -l apache* | grep ii | awk ‘{print $2}’) && sudo apt-get install apache2.
loading...
loading...
