Moving WordPress To New Directory
-
Hi guys!
A friend is paying huge amounts of money (thousands) for webhosting with GoDaddy and they asked me to build them a Linux box (CentOS6) to host their wordpress website locally at their home business.
I couldn’t find a default ‘public_html’ folder on a fresh install of Linux but I noticed that everything web related wanted to install in /var/www/html/ by default.
The default location for WordPress to install to is /var/www/html/ but on the GoDaddy linux box it was installed to /home/username/public_html/ and so when I move the files to the default install location it complains that the files are in the wrong location, and when I move it to the correct location in the error logs it then gives me permissions errors.
Has anyone tried to move a WordPress website without the use of CPanel / WHM? They have it at the GoDaddy end but they don’t want to pay for it in the new install (US$425 per year just for something they will only use once or twice) so I’m having a bit of bother.
Does anyone know how to change the default install location or change the links in the website so it looks at the default website location instead?
I see that the /etc/httpd/conf/httpd.conf file says it should be in /var/www/html/ folder.
I’m using this code to install LAMP:
sudo yum install httpd sudo service httpd start sudo yum install mysql-server sudo service mysqld start /usr/bin/mysql_secure_installation sudo yum install php php-mysql sudo chkconfig httpd on sudo chkconfig mysqld on mysql -u root –p CREATE DATABASE database_name; CREATE USER database_user@localhost IDENTIFIED BY 'password'; GRANT ALL PRIVILEGES ON database_name.* TO database_user@localhost IDENTIFIED BY 'password'; FLUSH PRIVILEGES; database_name < database_name.sql exit
I’m using this code to install WordPress:
sudo yum install php-gd sudo service httpd restart cd ~ wget https://www.ads-software.com/latest.tar.gz tar xzvf latest.tar.gz sudo rsync -avP ~/wordpress/ /var/www/html/ mkdir /var/www/html/wp-content/uploads sudo chown -R apache:apache /var/www/html/* cd /var/www/html cp wp-config-sample.php wp-config.php nano wp-config.php
Can I change the /var/www/html/ to /home/username/public_html/ ?
If I try to go to my local IP address will it find it? Will WordPress figure it all out by itself or do I have to change the /etc/httpd/conf/httpd.conf file?
I tried the export / import tool but the WXR XML file was too big to import (5MB, max limit 2MB), and even then it apparently doesn’t import the theme which is important because it is a custom-made theme and the website breaks without it.
Without blowing away my CentOS install, is it possible to uninstall WordPress if I’ve put it into the wrong location?
- The topic ‘Moving WordPress To New Directory’ is closed to new replies.