Help with an incomplete Apache 2 installation on Ubuntu 14.04 x32 droplet

Posted February 25, 2015 9.2k views

My installation of apache2 is incomplete, and after a lot of googling, purging, and reinstalling I am still in the same place. During installation my console prints

Setting up apache2 (2.4.7-1ubuntu4.1) …
Enabling module mpm_event.
cp: cannot stat ‘/usr/share/apache2/default-site/index.html’: No such file or directory
dpkg: error processing package apache2 (–configure):
subprocess installed post-installation script returned error exit status 1
Processing triggers for ureadahead (0.100.0-16) …
Processing triggers for ufw (0.34~rc-0ubuntu2) …
Errors were encountered while processing:
E: Sub-process /usr/bin/dpkg returned an error code (1)

Not sure where to go from here, as I’ve already uninstalled and reinstalled apache 2 quite a few times at this point. Any help with this would be deeply appreciated, I’d like to get this install over with so I can continue with the tutorial.
Thanks in advance,

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Submit an Answer
1 answer

That file should be part of the apache2-data package. Which should be pulled in automatically as a dependency of the apache2 package.

# dpkg -S /usr/share/apache2/default-site/index.html
apache2-data: /usr/share/apache2/default-site/index.html

I’d suggest trying to completely purge Apache, and then reinstall. Had you used the --purge already?

sudo apt-get remove --purge apache2 apache2-data apache2-utils
sudo apt-get install apache2

Let us know how that goes. If it doesn’t work, share any error when uninstalling.

  • Thanks, I used purge before but I did not add the ‘apache2-data apache2 utils’ part. I uninstalled those packages and this time I used the commands you suggested. It seems my installation went smoothly since there were no error messages. However, when I did the spot check by visiting my public IP address, the default Apache web page was not displayed. I then restarted the web server via ’$ sudo /etc/init.d/apache2 restart’, and revisited the page, but it still shows only my droplet name and IP address. The last message my console gave me during the installation was

    Enabling site 000-default.
    Processing triggers for ureadahead (0.100.0-16) …
    Processing triggers for ufw (0.34~rc-0ubuntu2) …


    My question is, are those the correct messages that should be shown at the end of an installation? At this point I am unsure if my installation is complete and my configuration correct since the default html page is not showing when I visit my IP.
    Thanks for your help,