How can I change the site file directory for an apache server? (Raspberry Pi)

Viewed 9555

Right now it's '/var/www/html' but I want it to be '/home/pi/FTP'

I can probably just change it in the config file, but i can't manage to find it, thank you in advance.

1 Answers

You'll have to edit apache2.conf and 000-default.conf to change the document root of apache.

The Apache server is installed on var/www/html.This is the default root directory of apache.

Either change the root directory of Apache or move the project to /var/www/html.

To change Apache's root directory, run:

cd /etc/apache2/sites-available

Then open the 000-default.conf file using the command:

nano 000-default.conf

Edit the DocumentRoot option:

DocumentRoot /path/to/my/project

Then restart the apache server:

sudo service apache2 restart

Related