Apache configuration files live in /etc/apache2
. You can use the cd
command to change to the appropriate directory:
cd /etc/apache2
There are several ways to edit configuration files. The easiest to learn is nano
. You'll also probably need to use sudo
to edit Apache's configuration. Thus:
sudo nano apache2.conf
You need to change Apache's DocumentRoot
directive (or VirtualDocumentRoot
). Which file it is in depends on your specific configuration. I'd recommend looking first in /etc/apache2/apache2.conf
as well as whatever may be in /etc/apache2/sites-enabled
.
If you search the Apache website for DocumentRoot
, you'll find a lot of useful documentation. In general, Apache's documentation is quite good.
After you make changes to the configuration, you'll have to restart Apache for them to take effect:
sudo service apache2 restart
EDIT
I just realized something important: Since when you upgraded you blindly answered each question without finding out what you were doing first, it's highly likely that you hosed your Apache configuration, and there are probably quite a few things wrong beyond this one issue. (You may have also hosed the configuration of other software on the machine, as well.) I'd recommend that you get /etc/apache2
from backup and carefully compare the two versions to decide how to reconstruct your configuration. If you don't have backup, then you'll have a lot of fun!
One key difference between Linux and Windows: Windows installers ask lots of pointless questions, leading to the "next, next, next" phenomenon. But Linux tends not to ask pointless questions. So if it asks a question, be careful how you answer it, because it is probably important.
EDIT 2
Wait a second. The files ending in .dpkg-old
are the versions of the files pre upgrade. They should contain the correct configuration. You can probably compare them with the non-suffixed files to discover the correct configuration.
Use the diff
command to see the differences between two files. Use nano
to edit a file, and cp
to make a copy of a file (or a backup in case something goes wrong). mv
will move or rename a file, and rm
will permanently delete a file without confirmation and without a recycle bin. So be careful. To learn how to use a command, use man
: e.g., man diff
.
Best Answer
The default DocumentRoot for Apache is
/var/www/html/
(without theindex/
) since Ubuntu 14.04 and/var/www/
in older Ubuntu versions.