seraph
seraph

Reputation: 350

Issues with moving WordPress folder to var/www/html (before/after)

I am trying to install WordPress on my virtual machine following the official guide at here

Somehow I could not move my wordpress file to the respective folder var/www/html.

The following error are given.

cp: cannot stat ‘~r’: No such file or directory
cp: cannot create regular file ‘/var/www/html/index.php’: Permission denied
cp: cannot create regular file ‘/var/www/html/license.txt’: Permission denied
cp: cannot create regular file ‘/var/www/html/readme.html’: Permission denied
cp: cannot create regular file ‘/var/www/html/wp-activate.php’: Permission denied
cp: omitting directory ‘/home/caleb/wordpress/wp-admin’
cp: cannot create regular file ‘/var/www/html/wp-blog-header.php’: Permission denied
cp: cannot create regular file ‘/var/www/html/wp-comments-post.php’: Permission denied
cp: cannot create regular file ‘/var/www/html/wp-config.php’: Permission denied
cp: cannot create regular file ‘/var/www/html/wp-config.php~’: Permission denied
cp: cannot create regular file ‘/var/www/html/wp-config-sample.php’: Permission denied
cp: omitting directory ‘/home/caleb/wordpress/wp-content’
cp: cannot create regular file ‘/var/www/html/wp-cron.php’: Permission denied
cp: omitting directory ‘/home/caleb/wordpress/wp-includes’
cp: cannot create regular file ‘/var/www/html/wp-links-opml.php’: Permission denied
cp: cannot create regular file ‘/var/www/html/wp-load.php’: Permission denied
cp: cannot create regular file ‘/var/www/html/wp-login.php’: Permission denied
cp: cannot create regular file ‘/var/www/html/wp-mail.php’: Permission denied
cp: cannot create regular file ‘/var/www/html/wp-settings.php’: Permission denied
cp: cannot create regular file ‘/var/www/html/wp-signup.php’: Permission denied
cp: cannot create regular file ‘/var/www/html/wp-trackback.php’: Permission denied
cp: cannot create regular file ‘/var/www/html/xmlrpc.php’: Permission denied

So after checking the location, I found that I don't have a var/www/html folder due to me removing apache2 previously in a LEMP installation guide.

So I tried to reinstall apache via

sudo apt-get install apache2

After installing, I found that the var/www/html is now available. But still I could not copy the files into the respective folder without using sudo, which is not mentioned in the guide. After copying the files into the var/www/html directory, I am supposed to access my IP address to continue with WordPress installation. Which I failed as well, as the browser directed me to Nginx just like in the LEMP guide instead of WordPress installation page in the WordPress guide. Any idea?

Edit: Tried stopping Nginx service and it does not work. (Does not redirect me to WordPress page)

TL/DR: WordPress folder does not move to var/www/html like how the guide did, and after using sudo to move the folder, localhost does not go to WordPress installation page.

Upvotes: 2

Views: 2221

Answers (1)

Mike Ciffone
Mike Ciffone

Reputation: 371

You should have to use sudo to move anything into /var/www/html/.

Use mv not cp

sudo mv /example.com /var/www/html/

Upvotes: 2

Related Questions