OJS OCS OMP OHS

You are viewing the PKP Support Forum | PKP Home Wiki



some customizations lost after migrating servers

Are you responsible for making OJS work -- installing, upgrading, migrating or troubleshooting? Do you think you've found a bug? Post in this forum.

Moderators: jmacgreg, btbell, michael, bdgregg, barbarah, asmecher

Forum rules
What to do if you have a technical problem with OJS:

1. Search the forum. You can do this from the Advanced Search Page or from our Google Custom Search, which will search the entire PKP site. If you are encountering an error, we especially recommend searching the forum for said error.

2. Check the FAQ to see if your question or error has already been resolved.

3. Post a question, but please, only after trying the above two solutions. If it's a workflow or usability question you should probably post to the OJS Editorial Support and Discussion subforum; if you have a development question, try the OJS Development subforum.

some customizations lost after migrating servers

Postby dcomeaux » Mon Jun 24, 2013 9:47 am

Hi,

I was asked to move our instance to a new server and change the url from journals.(myuniversity).edu to library.myuniversity.edu/journals. i seem to have it working on the new server with a couple of exceptions. I wrote some custom php in the header.tpl file that calls a special css file just on the home page. For some reason this is not working. I uploaded the edited file several times and it appears to be there. Also the css file is there in its correct location. I was thinking it might be a cache issue. So I cleared the cache through the interface, and that did not fix it. I also manually deleted some cache files from the server but that did not help.

So my first question is ; could there be another cache folder or database table that need to be cleared? If so, can you direct me to it or them?

Also could there be something wrong with my code? This works on the curent server. I changed the base url to the new url in the config file.

{assign var="page" value=$smarty.server.PHP_SELF}
{assign var="home1" value="/index.php/"}
{if $page == $home1}
<link rel="stylesheet" type="text/css" href="{$baseUrl}/lib/pkp/styles/home.css">
{/if}

The new site is at library.tulane.edu/journals.

Thanks!
Dave
dcomeaux
 
Posts: 17
Joined: Sat Jan 19, 2013 3:22 pm

Re: some customizations lost after migrating servers

Postby asmecher » Mon Jun 24, 2013 10:00 am

Hi Dave,

I suspect the file permissions on cache/t_compile (or its contents) are incorrect. Delete all .php files from that directory and ensure that the directory has permissions set such that OJS will be able to create files there. You should see the files popping up automatically as you load various parts of the site.

If file permissions are set incorrectly, then deleting the cache files through the interface won't work (since the same permissions problem will affect the cache flush operation too).

Regards,
Alec Smecher
Public Knowledge Project Team
asmecher
 
Posts: 8470
Joined: Wed Aug 10, 2005 12:56 pm

Re: some customizations lost after migrating servers

Postby dcomeaux » Mon Jun 24, 2013 10:53 am

Thanks Alec,

The permissions are set to 775. Should that work? I just set the the permission to recurse into subdirectories.

Can any harm come from deleting the cached files off of the server? Right now I don't have site admin access. And by the way, can you tell me exactly what folders and/or database tables are cleared when you clear the data cache and template cache using the interface?

Thanks again,
Dave
dcomeaux
 
Posts: 17
Joined: Sat Jan 19, 2013 3:22 pm

Re: some customizations lost after migrating servers

Postby asmecher » Mon Jun 24, 2013 11:03 am

Hi Dave,

Flushing the data cache removes all files from cache/; flushing the template cache removes all files from cache/t_compile.

755 permissions are not necessarily enough. Many servers allow you to administer files under your own account, but run PHP scripts under another account, typically "www-data" or "apache". If the file's owner and group correspond with your account, but not "www-data" or "apache" or whatever the server uses, then 775 will not work. The best solution is to change file or group ownership -- don't be tempted to use 777 as it's not safe.

Regards,
Alec Smecher
Public Knowledge Project Team
asmecher
 
Posts: 8470
Joined: Wed Aug 10, 2005 12:56 pm

Re: some customizations lost after migrating servers

Postby dcomeaux » Mon Jun 24, 2013 1:37 pm

Hi Alec,

The cache folders are owned by Apache. So these should be owned by the user that runs the ojs system?

Thanks,
Dave
dcomeaux
 
Posts: 17
Joined: Sat Jan 19, 2013 3:22 pm

Re: some customizations lost after migrating servers

Postby asmecher » Mon Jun 24, 2013 1:47 pm

Hi Dave,

That depends on your server's SAPI configuration (CGI, FastCGI, mod_php, ...) and other details; there's no single answer for that beyond "they should be writable by the account your server runs your PHP scripts under."

Regards,
Alec Smecher
Public Knowledge Project Team
asmecher
 
Posts: 8470
Joined: Wed Aug 10, 2005 12:56 pm

Re: some customizations lost after migrating servers

Postby dcomeaux » Tue Jun 25, 2013 8:32 am

Hi Alec,

So if the cache is being written to, does that mean the permissions are not a problem? I deleted the cached files and I'm still not the changes I made, but I am seeing new files being created there. What else could be the problem?
dcomeaux
 
Posts: 17
Joined: Sat Jan 19, 2013 3:22 pm

Re: some customizations lost after migrating servers

Postby asmecher » Tue Jun 25, 2013 9:04 am

Hi Dave,

If files are being re-created there, then overly restrictive file permissions are not the problem. I'd look at your {if} statement next. Dump the value of $smarty.server.PHP_SELF and see if it's what you expect.

Regards,
Alec Smecher
Public Knowledge Project Team
asmecher
 
Posts: 8470
Joined: Wed Aug 10, 2005 12:56 pm

Re: some customizations lost after migrating servers

Postby dcomeaux » Tue Jun 25, 2013 9:58 am

Hi Alec,

I'm sorry, i'm new to Smarty. How do I dump the value? I tried an echo statement but that didn't work. I don't see a print or echo in a quick glance at the Smarty docs. Is this using Smarty 2 or 3 btw?
dcomeaux
 
Posts: 17
Joined: Sat Jan 19, 2013 3:22 pm

Re: some customizations lost after migrating servers

Postby asmecher » Tue Jun 25, 2013 10:07 am

Hi Dave,

This is Smarty 2. Use:
Code: Select all
{$smarty.server.PHP_SELF}
Regards,
Alec Smecher
Public Knowledge Project Team
asmecher
 
Posts: 8470
Joined: Wed Aug 10, 2005 12:56 pm

Re: some customizations lost after migrating servers

Postby dcomeaux » Tue Jun 25, 2013 11:29 am

I got it!!!!

I needed to change it to [value="/journals/index.php] to work, now that the application is in a subdirectory!

Thanks for all your help! You're totally awesome!!

Dave
dcomeaux
 
Posts: 17
Joined: Sat Jan 19, 2013 3:22 pm

Re: some customizations lost after migrating servers

Postby asmecher » Tue Jun 25, 2013 11:44 am

Hi Dave,

Glad you've got it going!

Regards,
Alec Smecher
Public Knowledge Project Team
asmecher
 
Posts: 8470
Joined: Wed Aug 10, 2005 12:56 pm

Re: some customizations lost after migrating servers

Postby dcomeaux » Tue Jun 25, 2013 12:42 pm

Hi again Alec,

i just have one more question ( i think).Is there an htaccess file or something that can redirect hits to journals.tulane.edu to library.tulane.edu/journals in OJS? Or do I need to ask our sys admin to redirect it with Apache? I don't see an htaccess file in the root of OJS. (I looked in the documentation but don't see any guidance.)

Thanks,
Dave
dcomeaux
 
Posts: 17
Joined: Sat Jan 19, 2013 3:22 pm

Re: some customizations lost after migrating servers

Postby asmecher » Tue Jun 25, 2013 3:27 pm

Hi Dave,

The main OJS index.php script is in the /journals subdirectory, correct? You could put an index.php script in the root directory containing a simple redirect, or use a .htaccess file to accomplish the same, or edit your Apache configuration. See https://kb.mediatemple.net/questions/242/How+do+I+redirect+my+site+using+a+.htaccess+file%3F or http://stackoverflow.com/questions/768431/how-to-make-a-redirect-in-php.

Regards,
Alec Smecher
Public Knowledge Project Team
asmecher
 
Posts: 8470
Joined: Wed Aug 10, 2005 12:56 pm


Return to OJS Technical Support

Who is online

Users browsing this forum: Bing [Bot] and 4 guests

cron