在Ubuntu 10.04上恢复/etc/init.d/apache2

在我的Web服务器configuration故障排除中,我经历了一个卸载apache2并重新安装的过程。 我不小心删除了负责启动和停止apache服务的文件/etc/init.d/apache2

我已经尝试重新安装应该放置该文件的apache2.2-common包,但它仍然不存在。

我怎样才能完全重新安装Apache? 标准的apt-get removeapt-get install不会给我那个文件。

 sudo apt-get -o DPkg::Options::="--force-confmiss" --reinstall install apache2.2-common 

这将让你用清除包来replaceconfiguration文件。 删除软件包的使用

 sudo apt-get purge apache2.2-common 

然后以正常的方式安装apache:

 sudo apt-get install apache2 

我希望这有帮助

您不需要先删除软件包。 只需重新安装它:

 sudo apt-get install --reinstall apache2.2-common