You need to change two apache configuration files:
File 1:
sudo vim /etc/apache2/apache2.conf
Change line:
<Directory /var/www/>
To
Stay like this:
<Directory /home/usuario/diretorio_que_vc_quiser/>
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
</Directory>
File 2:
$ sudo vim /etc/apache2/sites-available/000-default.conf
ou
$ sudo vim /etc/apache2/sites-available/default.conf
Change line:
DocumentRoot /var/www
for
DocumentRoot /home/usuario/diretorio_que_vc_quiser/
Don’t forget to restart apache later:
$ sudo service apache2 restart
In
sites-enabled
there is a link000-default
pointing to the file in question? How are the permissions of the new folder that should serve as root and its archive index.html (try to set755
)? Finally don’t forget to reset the server after modifying its settings (sudo service apache2 restart
). More information about the procedures can be found at Ubuntu Documentation: HTTPD - Apache2 Web Server (in English)– Anthony Accioly