Koozali.org: home of the SME Server

Obsolete Releases => SME Server 8.x => Topic started by: genisys on November 05, 2012, 04:58:12 AM

Title: Move Wordpress from /opt to Primary Ibay
Post by: genisys 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
Title: Re: Move Wordpress from /opt to Primary Ibay
Post by: genisys 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
Title: Re: Move Wordpress from /opt to Primary Ibay
Post by: mmccarn 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
Title: Re: Move Wordpress from /opt to Primary Ibay
Post by: genisys 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?
Title: Re: Move Wordpress from /opt to Primary Ibay
Post by: janet 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).
Title: Re: Move Wordpress from /opt to Primary Ibay
Post by: genisys 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

Title: Re: Move Wordpress from /opt to Primary Ibay
Post by: janet 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.
Title: Re: Move Wordpress from /opt to Primary Ibay
Post by: genisys 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
Title: Re: Move Wordpress from /opt to Primary Ibay
Post by: janet 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.
Title: Re: Move Wordpress from /opt to Primary Ibay
Post by: genisys 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.
Title: Re: Move Wordpress from /opt to Primary Ibay
Post by: genisys on November 06, 2012, 04:49:21 AM
The webpage isn't displaying, but all contents are (wordpress files)
Title: Re: Move Wordpress from /opt to Primary Ibay
Post by: genisys 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.
Title: Re: Move Wordpress from /opt to Primary Ibay
Post by: janet 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.
Title: Re: Move Wordpress from /opt to Primary Ibay
Post by: genisys 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
Title: Re: Move Wordpress from /opt to Primary Ibay
Post by: genisys 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....
Title: Re: Move Wordpress from /opt to Primary Ibay
Post by: janet on November 18, 2012, 11:55:29 PM
genisys

You can select your Forum user profile, and then request group memberdhip for the Document Team.
When processed by contribs admin, you will have edit access to the Wiki.
You can then create a sme8 section in the Wordpress wiki article and add your procedure there.
Others can review & correct if necessary.
It's easy to use the wiki editor, just follow the formatting codes already used.
Look at other articles for examples or read the wiki help.

Otherwise publish your info here in the forum & hopefully someone will pick it up and add it to the wiki.

In my opinion it's almost as easy to publish directly to the wiki and then put a link here.

Of course people would like to read what steps you use, it's your contribution to contribs.org, that's tbe way it works, if everybody does a little bit, then a lot gets done.
So  please do, thanks.
Title: Re: Move Wordpress from /opt to Primary Ibay
Post by: genisys on November 23, 2012, 06:04:40 AM
Thanks Mary, I have updated the SME 8 contribs QA page with my steps. The link is here:

http://wiki.contribs.org/SME8.0_Contribs_QA#smeserver-wordpress

Unfortunately, I haven't successfully moved the wordpress page to my main domain yet. I did get the page to display, however all the images were broken and wp-admin was completely gone. I'll continue to work on it and when I figure it out, I'll update the above link.

Nick
Title: Re: Move Wordpress from /opt to Primary Ibay
Post by: Lowell Fuher on February 23, 2013, 08:13:58 AM
Nick,
Any thoughts on an uploading graphic file error - "Missing a temporary folder."?
I upgraded to 3.5.1 from the get go on my second attempt - and still run into this error. Seems like everything else works, just cant add graphics.
Title: Re: Move Wordpress from /opt to Primary Ibay
Post by: genisys on February 23, 2013, 11:08:02 AM
Hi Moe,
I did not run into that error at all. I never did figure out how to move WordPress into the main ibay either. I always had problems with it when I did. My home server is down for "maintenance" for awhile unfortunately, so I can't test anything right now. I do admin an SME Server at work, but it is not using WordPress. Sorry, wish I could help!

Nick