我正在使用 Ubuntu windows 10 bash,我想将项目从/mnt/i/Projects/Template 移动到位于/var/www/html 的 Apache 服务器上运行。
我尝试将文件夹从直接复制到新文件夹,但不幸的是我收到了一个错误:
cp -r /mnt/i/Projects/Template ~/var/www/html/
cp: target '/root/var/www/html/' is not a directory
我想用 Apache 测试这些模板,并尝试直接更改 Apache。
我做的另一个测试:
root@DESKTOP-4PBGG1N:/var/www# ls -ld ~/var ~/var/www ~/var/www/html
ls: cannot access '/root/var': No such file or directory
ls: cannot access '/root/var/www': No such file or directory
ls: cannot access '/root/var/www/html': No such file or directory
最佳答案
首先,apache 服务器的目录不在根目录中,它只是“/var/www/html”。如果它仍然不起作用,您可能没有安装 apache,您可以通过运行这两行“lsb_release -a”和“sudo apt-get install apache2”来完成此操作。尝试启动 apache 服务器时会出现错误(使用“sudo service apache2 start”),但只要忽略它,您仍然可以毫无问题地使用它。希望它有帮助;)
关于linux - cp : target '/root/var/www/html/' is not a directory,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57029976/