现在它是'/var/www/html',但我希望它是'/home/pi/FTP'
我可能可以在配置文件中更改它,但我无法找到它,提前感谢您。
您必须编辑 apache2.conf 和 000-default.conf 才能更改 apache 的文档根目录。
Apache服务器安装在var/www/html上。这是 apache 的默认根目录。
要么更改 Apache 的根目录,要么将项目移动到/var/www/html。
要更改 Apache 的根目录,请运行:
CD/etc/apache2/sites-available
然后使用以下命令打开 000-default.conf 文件:
nano 000-default.conf
编辑"文档根目录"选项:
DocumentRoot /path/to/my/project
然后重新启动 apache 服务器:
sudo service apache2 restart