Webmastersite.net
Register Log In

Server move problem
Moving knowledgebase between servers fails - template sets problem?

Comments on Server move problem

blloyd
Award winning copywriter

Usergroup: Member
Joined: Jan 27, 2016
Location: UK

Total Topics: 1
Total Comments: 5
blloyd
Server move problem
Posted Jan 27, 2016 - 5:44 PM:

Following a catastrophic failure of the server hosting the knowledgebase script, I copied the contents of the web server folder and the mySQL database to a brand new server instance. I have verified that Apache is running correctly, and that the database has been restored correctly into mySQL.

When I navigate to the homepage on the new server however, I just get a blank page with the text:

"You do not have any template sets!"

I have checked the file structure and the template folder and all its contents are present as expected.

Can anyone help?

Thanks!
blloyd
Award winning copywriter

Usergroup: Member
Joined: Jan 27, 2016
Location: UK

Total Topics: 1
Total Comments: 5
blloyd
Update - fixed!
Posted Jan 28, 2016 - 2:43 AM:

The cause of this problem is down to file paths.

On the original server running Apache 2.2, the knowledge base script was installed at /var/www/kb

On the new server running Apache 2.4, the knowledge base was installed at /var/www/html/kb

I updated config.php at /var/www/html/kb to reflect the new file path, but it made no difference - I still got the 'templates' error message.

In the end I had to change the DocumentRoot path in the Apache config file at /etc/apache2/sites-available/000-default.conf from /var/www/html to /var/www and then restart Apache to apply the change.

Next, I had to move the knowledge base folder from /var/www/html to /var/www

At this point the knowledge base could be viewed, although there was an error message relating to permissions on several cache files. The message advised changing permissions on the directory to '666' but this DOES NOT WORK. You will need to change permissions to '777' or you lose access to the knowledge base altogether.

It would appear that my version of the knowledge base script does not handle file paths gracefully, and there is no way to change them should you move servers. For some users this will be a major problem because it means changing their entire web server infrastructure to suit the knowledge base script.
blloyd
Award winning copywriter

Usergroup: Member
Joined: Jan 27, 2016
Location: UK

Total Topics: 1
Total Comments: 5
blloyd
UPDATE - NOT FIXED!!!
Posted Jan 28, 2016 - 5:51 AM:

Annoyingly when the server was restarted, the problem came back and now I cannot access anything in my knowledge base again. All I get is a blank screen with 'You do not have any template sets' displayed in the top-left corner.

I have checked all of the configuration changes made in the post above and nothing has changed, so it looks like the problem is with the knowledge base script rather than my environment this time.

Very annoying.
Paul
developer

Usergroup: Administrator
Joined: Dec 20, 2001
Location: Diamond Springs, California

Total Topics: 61
Total Comments: 7867
Paul
Posted Jan 28, 2016 - 6:05 AM:

CHMODing a directory to 666 will lock you out of that directory. When you set PHP to run as a different user than your active user, directories need to be 777, files 666, though files being 777 is okay on some servers (other servers will prevent you viewing files that have executable set). But it's much better to simply set up the web server so that PHP runs as your account user so that you don't have to think about permissions at all: scripts.webmastersite.net/w...ions-easier-suphp-441.html
If you can't configure the server to make permissions easy, you can recursively sudo chmod -R 777 /var/www/ to be sure that it'll have enough permissions (not ideal but easier than re-checking each file and directory).

Moving from /var/www/html to /var/www is inadvisable on a distro that defaults to /var/www/html. Leave the web root where the web server wants it and edit the config.php path. You say you tried that, but if it didn't work there must be a reason for that (perhaps something as simple as the changes to the file not being saved because of permissions, or editing the wrong copy of the file, or a typo). My own development PC paths are /var/www/html.

This isn't a script problem, the messages you're getting are defintely due to paths or permissions or some server misconfiguration (that's the only scenarios that can ever cause those messages), but I can help you anyway by having a look to see if I can spot the problem if you fill out the inspection request form: http://www.wsnkb.com/inspection.html

Configuring your own web server is tricky business though which I can't fully support (not an expert at it myself), and you can find shared hosting for a couple dollars a month that'll run WSN fine.
blloyd
Award winning copywriter

Usergroup: Member
Joined: Jan 27, 2016
Location: UK

Total Topics: 1
Total Comments: 5
blloyd
Posted Jan 28, 2016 - 6:11 AM:

Thanks for the feedback Paul but I can say with 100% certainty that the changes to $dirurl and $uploadpath in config.php ARE being saved, but have no effect whatsoever.
blloyd
Award winning copywriter

Usergroup: Member
Joined: Jan 27, 2016
Location: UK

Total Topics: 1
Total Comments: 5
blloyd
Posted Jan 28, 2016 - 6:18 AM:

I should also note that of the 3 websites moved to the new server, the knowledge base is the only one not to have failed the transfer.
Paul
developer

Usergroup: Administrator
Joined: Dec 20, 2001
Location: Diamond Springs, California

Total Topics: 61
Total Comments: 7867
Paul
Posted Jan 28, 2016 - 11:44 PM:

Can you view the servertest.php file in your browser? http://localhost/servertest.php -- does it load, and does it show any failures?

blloyd wrote:
Thanks for the feedback Paul but I can say with 100% certainty that the changes to $dirurl and $uploadpath in config.php ARE being saved, but have no effect whatsoever.


Is there a tweaks.php file present? Almost nobody has ever used the option, but there is a 'pathtoconfig' tweaks.php option which allows specifying a different config.php path -- so if you'd set that, it would make it possible that the config.php you need to edit is located somewhere other than the base directory of WSN KB.

If not, well, there are thousands of installations running millions of pages right now which are all relying on those config.php values and would all be showing errors if they weren't able to read those values (which are not cached by the script anywhere else, they're read directly each time). You're positive you don't have two copies so that you might be editing a different one than the one that you're visiting in your browser?

You aren't integrating membership with another script or another copy of WSN, are you?

The fact that you were able to temporarily make it work suggests to me that either your problem is that the server doesn't like the /var/www path and resets to wanting /var/www/html on reboot, or permissions are reassigned in some way on reboot. But I'm not a server admin. The errors you saw about cache files would be solved easily by chmoding the /cache/ subdirectory to 777 -- or if the cache subdirectory didn't get copied (it might've failed to transfer because it can have tens of thousands of small files in it), just create an empty one as 777.

blloyd wrote:
I should also note that of the 3 websites moved to the new server, the knowledge base is the only one not to have failed the transfer.


Did you mean it was the only one to fail the transfer, or as you wrote did the other sites fail? If they failed, do you have any leads on why?
Search thread for
Download thread as
  • 0/5
  • 1
  • 2
  • 3
  • 4
  • 5



Sorry, you don't have permission to post posts. Log in, or register if you haven't yet.