Koozali.org: home of the SME Server

Move Wordpress from /opt to Primary Ibay

Offline genisys

  • *
  • 46
  • +0/-0
Move Wordpress from /opt to Primary Ibay
« on: November 05, 2012, 04:58:12 AM »
Hello all -

I have successfully installed WordPress via the contrib here: http://wiki.contribs.org/Wordpress.

I then found that downloaded themes were not displaying properly (blank white pages), so I updated WordPress manually with the .tar file from their website and everything is working great now, however I'd like to have this page be my main web page (Primary ibay).

Referencing Mary's comments near the end of the below topic, I'm wondering what WordPress config files I would need to modify in order to move the /wordpress directory out of /opt and into my Primary ibay.  I think I'd like to do this, rather than creating a link, but I'm very open to suggestions. This is the first that I've played with WordPress, so I'm very new to it. I couldn't find any posts that were more detailed than the below and just looking for a few more details.

http://forums.contribs.org/index.php/topic,45476.msg221003.html#msg221003

Thanks,
Nick

Offline genisys

  • *
  • 46
  • +0/-0
Re: Move Wordpress from /opt to Primary Ibay
« Reply #1 on: November 05, 2012, 05:00:28 AM »
I may have posted this too soon, as I may need to review this further:

http://codex.wordpress.org/Changing_The_Site_URL

Still, any advice you may have is appreciated.

Nick

Offline mmccarn

  • *
  • 2,657
  • +10/-0
Re: Move Wordpress from /opt to Primary Ibay
« Reply #2 on: November 05, 2012, 01:17:44 PM »
If the length of a wordpress site URL changes, you need to edit the associated database to re-write all posts and pages, because each post is stored as a string that begins with a string length value.

I wrote a script that I use to move wordpress around (actually, to use a SME server as a wordpress backup):
https://www.dropbox.com/s/xysh61fl35yo2dq/wp-backup.sh

That script depends on these two scripts, which are no longer available on the site where I found them last year.  There is no included license or copyright information:
https://www.dropbox.com/s/02d6yuuzbyf2hyj/db-fr.php

https://www.dropbox.com/s/mi823xyxl9x6wbc/commandline.class.php

On my system, these files are located here:
/root/scripts/wp-backup.sh
/root/scripts/db-fr.php
/root/scripts/include/commandline.class.php

Offline genisys

  • *
  • 46
  • +0/-0
Re: Move Wordpress from /opt to Primary Ibay
« Reply #3 on: November 05, 2012, 08:22:39 PM »
Thanks for the reply and the scripts mmccarn. I've copied and reviewed the scripts. It appears that I will have to create the wp-backup-init.sh first and put it in my Primary ibay so it can be referenced by the script.  Would I just use the root user for the "ssh user" variable in the script? If it's just copying from one directory to another, I wouldn't think that would be needed, would it?

Offline janet

  • *****
  • 4,812
  • +0/-0
Re: Move Wordpress from /opt to Primary Ibay
« Reply #4 on: November 05, 2012, 11:29:13 PM »
genisys

As I understand your requirements, you simply want to move the location of the wordpress application files from
/opt/wordpress
to
/home/e-smith/files/ibays/ibayname/html
and you are not changing the domain name that is used to access wordpress, then you do not need to run any special script.

Just use the move command or the move function in midnight commander (mc) to move the contents of /opt/wordpress to the ibay html folder.
Then configure the Domains panel in server manager to point the primary domain name to the ibay.
Go through the configuration settings within Wordpress ie login as admin & set Wordpress up accordingly with your required domain details etc.

I do not recall if other changes were needed. I had a quick look, and see that the contrib does create a httpd.conf alias template for /wordpress, but if you do not access the app as http://yourdomain.com/wordpress then I think this will have no effect (re the new ibay location). The Domain panel settings will direct content for http://yourdomain.com to the ibay where wordpress is located (whatever the name of the ibay is, without needing to use the /wordpress alias or suffix.

Just make sure Wordpress is configured correctly (via Wordpress admin login).
Please search before asking, an answer may already exist.
The Search & other links to useful information are at top of Forum.

Offline genisys

  • *
  • 46
  • +0/-0
Re: Move Wordpress from /opt to Primary Ibay
« Reply #5 on: November 05, 2012, 11:42:16 PM »
Hey Mary, it's about time you showed up.  :-P

Yep, I just want to move the wordpress site to ...../Primary/html  to overwrite my current page which was created with the "Create starter site" option in server manager. (it's just a few lines done as a test)

I'll try this when I get home and report back.

Thanks,
Nick


Offline janet

  • *****
  • 4,812
  • +0/-0
Re: Move Wordpress from /opt to Primary Ibay
« Reply #6 on: November 06, 2012, 12:16:45 AM »
genisys

I suggest you put the primary content (wordpress) in an ibay & use the Domains panel to redirect content.
There are reasons for and against, but personally I favour that approach.
Please search before asking, an answer may already exist.
The Search & other links to useful information are at top of Forum.

Offline genisys

  • *
  • 46
  • +0/-0
Re: Move Wordpress from /opt to Primary Ibay
« Reply #7 on: November 06, 2012, 04:08:20 AM »
Thanks Mary, I moved the contents of the /opt/wordpress directory into my new ibay as you suggested.  My permissions are incorrect right now, as I'm getting a "Forbidden: You don't have permission to access / on this server" message.

I've seen the correct permissions in previous pages that I've read, but I can't seem to find them again. Do I need to change ownership to www on all files?

Thanks

Offline janet

  • *****
  • 4,812
  • +0/-0
Re: Move Wordpress from /opt to Primary Ibay
« Reply #8 on: November 06, 2012, 04:28:31 AM »
genisys

To ask the obvious, is the ibay enabled (in server manager) for Internet access ?

Did you "move" the files, as that should have kept permissions etc unchanged.
Please search before asking, an answer may already exist.
The Search & other links to useful information are at top of Forum.

Offline genisys

  • *
  • 46
  • +0/-0
Re: Move Wordpress from /opt to Primary Ibay
« Reply #9 on: November 06, 2012, 04:48:17 AM »
Hi Mary,

Yep, I moved the entire directory. I did enable it for internet access and I was getting what appears to be a SME auto-configured index.html page stating this ibay has not yet been configured.  I renamed that and now when I browse to the ibay, I get the file browser, no wordpress webpage.

Offline genisys

  • *
  • 46
  • +0/-0
Re: Move Wordpress from /opt to Primary Ibay
« Reply #10 on: November 06, 2012, 04:49:21 AM »
The webpage isn't displaying, but all contents are (wordpress files)

Offline genisys

  • *
  • 46
  • +0/-0
Re: Move Wordpress from /opt to Primary Ibay
« Reply #11 on: November 06, 2012, 05:18:52 AM »
I am starting over at this point. I really screwed things up, then on a spontaneously stupid move, I wiped my files. I extracted new wordpress files, but now I can't access the database at all. This is just my home server that I'm setting up, so nothing serious, but now I won't be stopping until it's fixed. Could be a late night.

Offline janet

  • *****
  • 4,812
  • +0/-0
Re: Move Wordpress from /opt to Primary Ibay
« Reply #12 on: November 06, 2012, 05:56:47 AM »
genisys

Quote
I moved the entire directory.

You should have moved just the contents of the wordpress directory (and not the actual directory) into the ibay html folder

Quote
I wiped my files

Well you need to add the wordpress mysql db details into wp-config.php.

It's been a long time since I looked at wordpress, either do it manually, or that is probably best done using the db command
View the output of
config show wordpress
you will see the keys & their current settings

Then read the DB Command Tuturial Howto for further instructions if necessary to change or correct these settings,
eg
config setprop wordpress status disabled
config setprop wordpress DbName wordpress
& so on
then issue
signal-event post-upgrade
signal-event reboot

The golden rule is to ALWAYS make a copy of your folders & files before doing anything, just in case.

Just to be safe, you best make a copy of your mysql db NOW, minimally by copying
/var/lib/mysql/wordpress
to a safe location on your server, assuming nothing is using the databases ie they are not open.

There should be a mysql dump in the daily backup, as well as config files for wordpress, assuming you use one of the default backup solutions, it may be best to just restore the whole wordpress folder.

If you reinstall the wordpress contrib rpm, you risk overwriting the existing wordpress mysql db.
« Last Edit: November 06, 2012, 11:13:48 AM by mary »
Please search before asking, an answer may already exist.
The Search & other links to useful information are at top of Forum.

Offline genisys

  • *
  • 46
  • +0/-0
Re: Move Wordpress from /opt to Primary Ibay
« Reply #13 on: November 07, 2012, 04:28:53 AM »
Ok Mary, I think I'm back on track now. I've wiped everything, including the MySQL database and started over fresh with the reinstall of WordPress using this method:

yum --enablerepo=sme7contribs --enablerepo=smecontribs install smeserver-wordpress wordpress

http://wiki.contribs.org/Wordpress should be updated with the above command, because yum --enablerepo=smecontribs install smeserver-wordpress doesn't work. Or maybe slip a reference to http://wiki.contribs.org/SME8.0_Contribs_QA on that page.

Anyway, after a reboot, I am able to access the WordPress setup page, so I'll reconfigure everything and make backups. When that's done, I'll try again to move it and let you know how it goes.

Thanks for all your help.

Nick

Offline genisys

  • *
  • 46
  • +0/-0
Re: Move Wordpress from /opt to Primary Ibay
« Reply #14 on: November 18, 2012, 08:27:39 PM »
I have a full step by step written up, which uses the existing information in the wiki combined with what I've found to work for SME Server 8, if anyone wants it.  I haven't attempted to move the contents of /opt/wordpress to another ibay yet though....