0

I remove apache from my machine following these steps:

sudo apt-get remove apache2*

sudo apt-get autoremove

sudo rm -Rf /etc/apache2

I was able to remove it successfully but when I tried to install it again I got this error:

/etc/init.d/apache2: 64: .: Can't open /etc/apache2/envvars /etc/init.d/apache2: 76: .: Can't open /etc/apache2/envvars ERROR: APACHE_PID_FILE needs to be defined in /etc/apache2/envvars invoke-rc.d: initscript apache2, action "restart" failed. 

I tried to fix it whit this command

sudo apt-get --purge --reinstall install apache2

but I got the same error.

1 Answer 1

0

apt-get remove does not remove configuration files, and you probably touched that file and messed it up so reinstalling without purging configuration will not work. So try this approach instead:

apt-get purge apache2 

and then:

apt-get install apache2 

envvars file comes in apache2 package and default should include all the necessary variables, you can brwose and check it yourself from envvars search at packages.ubuntu.com

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.