Restoring ‘apache2’ Directory on Ubuntu 15.04

This post shows you how to restore ‘ directory‘ if you have accidentally removed it or modified some of its files like ‘000-default.conf‘ or any other file and now you want to restore it to its default state then you are at a right place.

I’m not making this post fatter and thinner one by adding a lot of theory and heavy amount of text. Just go straight forward and follow steps described as below.

Caution: We are using the word ‘restore’ in a loose sense, actually we will download the directory from the Application Repository not restore the deleted one. I am not providing any kind of guarantee if you mistakenly deleted your precious data or made any other harm for yourself by running the wrong commands instead. It would be all up to you and will be considered your mistake if something harmful happened for you by following this tutorial.

1. Remove the ‘apache2’ Directory

If you haven’t removed the ‘apache2‘ directory accidentally or deliberately then keep reading and follow this step. In case of you have deleted the ‘apache2′ directory then skip this step and go ahead to step 2.

Let’s get started! First of all you need to remove ‘apache2’ directory completely and permanently from your system. To do this run the following command which will remove the apache2 directory from the /etc/ directory:

sudo rm -R /etc/apache2

Cool, its simple enough!

2. Restore the ‘apache2’ Directory

Now, after removing the ‘apache2‘ directory permanently from the /etc/ directory we need to restore (download from Ubuntu Application Repository) this directory, run the following command in your terminal to restore it:

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

All is done, now just go back to your Files and you can see ‘apache2‘ directory exists in /etc/.

If you found this post useful then I think you must share it with your friends and/or colleagues. Tell them that you have solved your problem for which you sought help from them.

Having any problem? If you are facing some problems in this regard and are unable to restore ‘apache2‘ directory then please tell us the error you are encountering via comments and we’ll help you to overcome the problems and errors. 

Related Posts
In this post I am going to show you how to change your root directory in Ubuntu 15.04. If you further want to know about root directory read my blog What ...
READ MORE
Installing LAMP Stack on Ubuntu and Debian in Just 3 Steps
In this post you'll learn how to setup LAMP Stack on Ubuntu and/or Debian in just 3 easy to follow steps. I'm not making the post fatter, thinner and filled with ...
READ MORE
Understanding Root Directory, Testing PHP Engine and Installing PHP Extensions on Ubuntu
In my previous post, Installing LAMP Stack on Ubuntu and Debian in Just 3 Steps, you've learned how to install LAMP Stack on Ubuntu. In this post we'll: learn what is Root ...
READ MORE
Installing PHP/MySQL on Windows 8.1 Using WAMP Server 2 Step by Step – 1
Installing PHP, Apache Server and seems to be very difficult and almost tiresome for the beginners and some times for average developers as well. But don't worry we have ...
READ MORE
Installing PHP/MySQL on Windows 8.1 Using WAMP Server 2 Step by Step – 2
Step 2: Browsing the Local Server on your Web BrowserNow to make sure that the WAMP Server has been installed successfully follow the following steps.Double click the WAMP Server icon ...
READ MORE
Changing the Root Directory on Ubuntu 15.04
Installing LAMP Stack on Ubuntu and Debian in
Understanding Root Directory, Testing PHP Engine and Installing
Installing PHP/MySQL on 8.1 Using WAMP Server
Installing PHP/MySQL on Windows 8.1 Using WAMP Server

Leave a Reply

Your email address will not be published. Required fields are marked *