Unable to copy contents of Wordpress directory to root

New to Debian (Or Linux in general)? Ask your questions here!

Unable to copy contents of Wordpress directory to root

Postby geekyfreaky » 2018-12-14 18:10

I'm a total newbie at this! I have a virtual machine running Debian 9. I have LAMP installed.

I am following the instructions at this link to install WordPress: https://www.adminbyaccident.com/gnu-lin ... amp-stack/

I am now at this step:

We now copy the contents of the wordpress directory to the web server root.

Code: Select all
albert@debian:~/wordpress$ sudo cp -a ~/wordpress/* /var/www/html
[sudo] password for albert:
albert@debian:~/wordpress$


However, when I try this (I don't use "sudo" because it's not installed on Debian by default), I get the following error message:

Code: Select all
root@debianlinux:/home/lanalee# cp -a ~/wordpress/* /var/www/html
cp: cannot stat '/root/wordpress*': No such file or directory


Someone please help me!!! Thank you so much.
geekyfreaky
 
Posts: 2
Joined: 2018-12-14 17:30

Re: Unable to copy contents of Wordpress directory to root

Postby 4D696B65 » 2018-12-14 18:16

geekyfreaky wrote:I am following the instructions at this link to install WordPress: https://www.adminbyaccident.com/gnu-lin ... amp-stack/

Any reason you don't use the debian way?
https://wiki.debian.org/WordPress
User avatar
4D696B65
 
Posts: 2231
Joined: 2009-06-28 06:09

Re: Unable to copy contents of Wordpress directory to root

Postby geekyfreaky » 2018-12-14 18:26

4D696B65 wrote:
geekyfreaky wrote:I am following the instructions at this link to install WordPress: https://www.adminbyaccident.com/gnu-lin ... amp-stack/

Any reason you don't use the debian way?
https://wiki.debian.org/WordPress


Used that link as a recommendation from an IT person I know.
Any ideas on how to proceed?
geekyfreaky
 
Posts: 2
Joined: 2018-12-14 17:30

Re: Unable to copy contents of Wordpress directory to root

Postby bw123 » 2018-12-14 18:38

means file is not present at path you told cp to find it at.
https://duckduckgo.com/html/?q=cp+cannot+stat

nobody knows were you untarred it to, try this
https://duckduckgo.com/html/?q=linux+cli+find
Last edited by bw123 on 2018-12-14 18:44, edited 1 time in total.
User avatar
bw123
 
Posts: 3675
Joined: 2011-05-09 06:02
Location: TN_USA

Re: Unable to copy contents of Wordpress directory to root

Postby Bulkley » 2018-12-14 18:44

geekyfreaky wrote:Any ideas on how to proceed?


Go to the link that 4D696B65 gave you. Start at step 1, Packages Installation and follow directions.
Bulkley
 
Posts: 5703
Joined: 2006-02-11 18:35

Re: Unable to copy contents of Wordpress directory to root

Postby GarryRicketson » 2018-12-14 18:54

Agreed, it would be better to follow the link to the debian wiki, ...
It looks to me , some how when you login as root, you switch to root's home:
/root
cp: cannot stat '/root/wordpress*': No such file or directory

You must be in the directory where the file is, or have the right path to it, in the cp command.
You can verify what directory you are actually in with the 'pwd' command.
'man pwd' for details. It also might be to your advantage to look at 'man cp ' as well,
example:
Code: Select all
garry% ksh
garry$ pwd
/home/garry
garry$ login root
Password:
garry# pwd
/root
garry#
 

As you can see when I logged in as root, it changes to root's home dir. How did you get root access, if you can not use sudo ? Normally using 'su', would not change directories, but that has changed on Debian, now you need to use 'su - ' ..In any event, it is all ways good to check what dir you are in, that is what 'pwd' is for.
User avatar
GarryRicketson
 
Posts: 5237
Joined: 2015-01-20 22:16
Location: Durango, Mexico

Re: Unable to copy contents of Wordpress directory to root

Postby Segfault » 2018-12-14 22:53

Code: Select all
root@debianlinux:/home/lanalee# cp -a ~/wordpress/* /var/www/html

Well, as seen here the files are in /home/lanalee, but the command as used will look for them in /root/wordpress/. That's incorrect use of '~'.
Segfault
 
Posts: 850
Joined: 2005-09-24 12:24


Return to Beginners Questions

Who is online

Users browsing this forum: No registered users and 4 guests

fashionable