Ubuntu – Unable to find apache2 directory inside /etc in Ubuntu 16.04

16.04Apache2

I am trying to install Apache in Ubuntu 16.04. I followed the steps from How To Install Linux, Apache, MySQL, PHP (LAMP) stack on Ubuntu 16.04.

I ran the following commands:

sudo apt-get update    
sudo apt-get install apache2

When trying to run the next command:

sudo apache2ctl configtest

I get an error as follows:

apache2: Could not open configuration file /etc/apache2/apache2.conf: No such file or directory
Action 'configtest' failed.

I checked my /etc directory and there is no such directory named as /apache2.

Best Answer

I recommend you to reinstall apache2. In this way he should create the folder with all the default files.

sudo apt-get purge apache2 
sudo apt-get install apache2 
Related Question