Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

In my web-server configuration troubleshooting I went through a process of uninstalling apache2 and reinstalling it. I accidentally removed the file /etc/init.d/apache2 which is responsible for starting and stopping the apache service.

I've tried reinstalling the apache2.2-common package which is supposed to place the file, but it is still not present.

How can I do a complete reinstall of Apache? The standard apt-get remove and apt-get install doesn't give me that file back.

share|improve this question

closed as off topic by mdpc, Michael Hampton, Ward, Khaled, dunxd Feb 11 '13 at 10:15

Questions on Server Fault are expected to relate to professional server, networking, or related infrastructure administration within the scope defined by the community. Consider editing the question or leaving comments for improvement if you believe the question can be reworded to fit within the scope. Read more about reopening questions here.If this question can be reworded to fit the rules in the help center, please edit the question.

add comment

2 Answers

up vote 1 down vote accepted
sudo apt-get -o DPkg::Options::="--force-confmiss" --reinstall install apache2.2-common

This will let you replace config file with out purging package. To remove package use

sudo apt-get purge apache2.2-common

and then install apache the normal way:

sudo apt-get install apache2

I hope this helps

share|improve this answer
    
Yes, it's back!!! :D –  Jackson Gariety Feb 11 '13 at 4:27
add comment

You don't need to delete the package first. Just reinstall it:

sudo apt-get install --reinstall apache2.2-common
share|improve this answer
    
Does not fix my problem, but thanks. –  Jackson Gariety Feb 11 '13 at 4:26
    
It would if I put in the right package name. :) –  Michael Hampton Feb 11 '13 at 4:37
    
Read this line of my question: "I've tried reinstalling the apache2.2-common package which is supposed to place the file, but it is still not present." That did not solve the problem. –  Jackson Gariety Feb 11 '13 at 6:19
add comment

Not the answer you're looking for? Browse other questions tagged or ask your own question.