EditWrx Knowledge Base Home
 Search       Login   Register   Members   Help   Home 
Search by username

EditWrx Knowledge Base > FAQ (Frequently Asked Questions) > Installation Issues > Parent/Child restting parent permissions

Parent/Child restting parent permissions
 Moderated by: Keith  
 New Topic   Reply   Print 
AuthorPost
Keith
Moderator
 

Joined: Fri Apr 8th, 2005
Location:  
Posts: 578
 Posted: Sun Feb 3rd, 2008 05:39 pm
 Quote  Reply 
On some parent/child installations a reboot of the server is resetting the permissions on the home folder of the parent installation. That permission must be set to 0755 to allow a child installation to access the files in the parent. Below is a fix that will automatically detect that the home folder has incorrect permissions and reset the permission.

This requires adding code to the wrx.cgi in the parent and the child, and editing routines.txt in both installations.

1) access the CHILD installation's environment variables (wrx.cgi?environment). Check the varaiables to see if there is a REQUEST_URI variable that contains the domain path to wrx.cgi and the ?environment query string (e.g. REQUEST_URI=/editwrx/wrx.cgi?environment). Some servers may name that variable something else.  What is important is that you identify the name of the variable that contains the domain path to wrx.cgi and the ?environment query string. If it is something other than REQUEST_URI remember what it is, you'll need it later.

2) Open wrx.cgi in the CHILD installation. At the bottom of the file there is a subroutine sub no_root. Change that name to sub xno_root to disable it. Then add the following replacement subroutine


sub no_root{
$URL_TO_PARENT_WRX_CGI='http://YOURDOMAIN/editwrx/wrx.cgi';
$URL=$URL_TO_PARENT_WRX_CGI."?resetMODE=".$ENV{'HTTP_HOST'}.$ENV{'REQUEST_URI'};
 print "Content-type: text/htmlnn";
 print qq~<script type="text/javascript">location="$URL"</script>~;
exit;
}


 

change YOURDOMAIN to the url to your PARENT domain and if neccessary change the url so it points to the parent wrx.cgi. IF you need to, change REQUEST_URI in that code to the name of the variable you found in step 1.

3) Open /library/routines.txt in the CHILD installation. Down around line 525 you'll find a line containing while(<WW>){ . Below that line add a new line containing s`<script.+script>``;

4) Open wrx.cgi on the PARENT installation. At the bottom of the file add the following subroutine


sub resetMODE{
 $path=$ENV{'DOCUMENT_ROOT'};
 chmod(0755,"$path");
 $URL="http://".$param1;
 print "Content-type: text/htmlnn";
 print qq~<script type="text/javascript">location="$URL"</script>~;
 exit;
}




5) Open /library/routines.txt in the PARENT installation. Down around line 525 you'll find a line containing while(<WW>){ . Below that line add a new line containing s`<script.+script>``;

Updates after 6.20.080201 will contain the additional code in the routines.txt.

BTW, if you want to disable being able to see the environment variables by using wrx.cgi?environment you can do that by adding a $noenvironment=1; variable to wrx.cgi above the ############ line.

Last edited on Fri Feb 8th, 2008 01:27 am by Keith


 Current time is 05:08 pm




Powered by WowBB 1.62 - Copyright © 2003-2004 Aycan Gulez