ccgi down
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Plusnet Community
- :
- Forum
- :
- Help with my Plusnet services
- :
- Everything else
- :
- Re: ccgi down
Re: ccgi down
20-03-2010 7:36 PM
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Report to Moderator
I used 'Agent Ransack' to search for all occurencies in my PHP files including all subdirectories, and then manually changed them.
For people to get a list of global server variables, they can use this (found on the internet):
<?PHP
foreach($_SERVER as $key_name => $key_value) {
print $key_name . " = " . $key_value . "<br>";
}
?>
It shows the variables available and their current values. People can then use their own search and replace methods if they want.
Tony
Re: ccgi down
20-03-2010 7:40 PM
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Report to Moderator
Can anyone tell me the rewrite rule to get rid of the ~username part of the ccgi url?
At present, I can get to my site with http://www.domain.co.uk/, but any further links are coming up as http://www.domain.co.uk/~username/. This is also appearing in the automatically-generated "base" statement on my pages.
Thanks,
Jon
Re: ccgi down
20-03-2010 11:58 PM
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Report to Moderator
The cgi-platform-php-upgrade-faq in the Customer Library cross-refers to that.
David
Re: ccgi down
21-03-2010 8:13 AM
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Report to Moderator
Going back to the register_globals problem, perhaps just doing the search and notifying the filenames still containing any global variables would help.
The user could then whittle down the list until it ran 'clean'.
I understand that this means work for someone writing the script, but it means a 'belt and braces' approach could be used before switch-off.
Tony
Re: ccgi down
21-03-2010 9:12 AM
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Report to Moderator
The problem was that I don't really understand what Gabe is talking about - .htaccess is completely dark to me!
As it happens, it looks like the problem had nothing to do with .htaccess, merely the way my CMS was getting the values from PHP's settings. I've made two sets of alterations to my code and it seems to be working fine now. (Now, PHP I understand...)
Thanks anyway!
Jon
Re: ccgi down
21-03-2010 11:47 AM
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Report to Moderator
Quote from: Astronut As it happens, it looks like the problem had nothing to do with .htaccess, merely the way my CMS was getting the values from PHP's settings. I've made two sets of alterations to my code and it seems to be working fine now. (Now, PHP I understand...)
Thanks for the feedback, glad to hear you got it working.
Are you happy to mention the CMS and what you changed? Could help others.
David
Re: ccgi down
21-03-2010 11:55 AM
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Report to Moderator
Quote from: Tony Going back to the register_globals problem, perhaps just doing the search and notifying the filenames still containing any global variables would help.
The user could then whittle down the list until it ran 'clean'.
@Tony
Yes, drawing attention to global variables used in $global_var_name style is a good suggestion. I'll discuss this with Plusnet.
David
Re: ccgi down
21-03-2010 9:31 PM
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Report to Moderator
I have two sites, neither of which is working. One is based on Joomla, and the other on Drupal. The Joomla one is giving a joomla holding page, stating "The site is temporarily unavailable, please contact the administrator". The Drupal one is giving the message
"Server error!
The server encountered an internal error and was unable to complete your request. Either the server is overloaded or there was an error in a CGI script.
If you think this is a server error, please contact the webmaster.
Error 500"
Can anyone give me a potted history of what has happened. For example - have all files been restored from a backup? What about the database? PHP.ini? etc.
and what I am likely to need to do to fix it. So far, all I have tried is to change permissions of all files to 755.
Thanks for any help.
Re: ccgi down
21-03-2010 10:15 PM
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Report to Moderator
User files were moved to the new server unchanged, and databases weren't affected.
The FAQ explains some of the causes of Error 500 (perhaps a .htaccess option in your case?). Does that provide the help you need?
David
Re: ccgi down
21-03-2010 10:24 PM
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Report to Moderator
Quote from: spraxyt Yes, drawing attention to global variables used in $global_var_name style is a good suggestion. I'll discuss this with Plusnet.
There might be something that can be used as a starting point here
It is a global search and replace script, but it might be amendable so that it just uses the search section and outputs the filename. The search string and replace string are included as variables. Obviously it could be modified to search for all of the register variables in each file and then output the filename plus the list (perhaps).
Anyway, not knowing perl, I don't know how easy the amendment would be, but the code seems very terse, very like the UNIX commands e.g. grep.
Tony
Re: ccgi down
21-03-2010 10:42 PM
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Report to Moderator
Quote from: Crookwood it's throwing out ~username on each URL, which might confuse my google cache...
Which version of Joomla is this? I have a test install of 1.5.14, which I don't use or understand but the example pages seem to work with all three SEF options on and its not generating /~username in the url. Or am I missing something?
Gabe
Re: ccgi down
21-03-2010 10:55 PM
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Report to Moderator
Aims:
To avoid the problem with ~username ending up in PHP variables and causing problems with POSTs, etc. - and avoid the ~username appearing in the url after you POST.
To avoid the need for more than one custom php.ini file to cover all folders.
(A side effect is that sites will run without resetting permissions on php files, though they should still be reset for security.)
Method:
This is a Marmite method (some won't like it at all and it may not work perfectly for every situataion). It uses a wrapper script to reset certain PHP variables. The php.ini for the wrapper then covers all PHP files in all folders.
First create a wrapper script:
<?php
$_ENV["SCRIPT_NAME"]=$PHP_SELF=$_SERVER['PHP_SELF']=$_SERVER["SCRIPT_NAME"]=$_SERVER["REQUEST_URI"];
$_ENV["SCRIPT_FILENAME"]=$_SERVER["SCRIPT_FILENAME"]='/files/homeX/username'.$_SERVER["REQUEST_URI"];
ereg('^/~username(.*)/([^/]*\.php)$', $_ENV["REDIRECT_URL"], $wrap_url);
chdir('/share/storage/0X/us/username'.$wrap_url{1});
include $wrap_url{2};
?>
Edit the above, replacing "/files/homeX/username" in line 2, "username" in line 3 and "/share/storage/0X/us/username" in line 4. "username" is your username and the other strings may be found by placing a <a href="http://community.plus.net/forum/index.php/topic,83568.msg696223.html#msg696223">php.ini file</a> along side a phpinfo() file in your root folder.
<?php
phpinfo();
?>
Chmod the phpinfo file 0700 and call it in a browser. The first string appears under PHP Variables, against _SERVER["SCRIPT_FILENAME"] (just the bit up to username). The second will appear at the top, against "Loaded Configuration File" (again, just the bit up to username).
Name the file "phpwrapper.php", place it in your root folder alongside the php.ini file and chmod it 0700.
Then create a .htaccess file
RewriteEngine on
RewriteBase /
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^(.+[^/])$ $1/ [R,L]
RewriteCond %{REQUEST_URI} \.php$
RewriteCond %{REQUEST_FILENAME} -f
RewriteCond %{REQUEST_URI} !^/~username/phpwrapper\.php
RewriteRule .* phpwrapper.php
replace "username" and place the file in your root folder.
Call the phpinfo file again and notice that the relevant PHP variables have changed. Place the phpinfo file in another folder, call it and notice that register_globals is still off.
The rewrite rules in .htaccess can be combined with others. For instance, to run a Wordpress blog from a subfolder, while giving the appearance that it's in the root, you could use something like:
RewriteEngine on
RewriteBase /
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^(.+[^/])$ $1/ [R,L]
RewriteCond %{HTTP_HOST} ^ccgi\.yourdomain\.co\.uk$ [NC]
RewriteCond %{REQUEST_URI} !^/~username/wordpress/
RewriteRule (.*) /wordpress/$1
RewriteCond %{REQUEST_URI} \.php$
RewriteCond %{REQUEST_FILENAME} -f
RewriteCond %{REQUEST_URI} !^/~username/phpwrapper\.php
RewriteRule .* phpwrapper.php
and change the Wordpress address to http://ccgi.yourdomain.co.uk in Settings.
If your site uses .htaccess files in subfolders then the wrapper rewrites will also need to be added to those files, with the wrapper referenced as ../phpwrapper.php (adding more ../ for each folder level down).
Ok, I hope that hasn't just confused things. It's only an option.
Gabe
Re: ccgi down
21-03-2010 11:01 PM
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Report to Moderator
I am running an oldish version due to template compatibility - 1.0.11. I can access the admin backend seemingly without problem. However, trying to access the main site, I get the site error message outlined above. Permissions are set globally to 755. I've tried 700/710 as in the FAQ, and then the backend breaks as well.
As far as I can tell, there is no .htaccess file. I have a PHP.ini file.
EDIT - renaming the php.ini to php.ini.old seems to have fixed the problem.
Re: ccgi down
22-03-2010 12:06 AM
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Report to Moderator
Quote from: Tony
Quote from: spraxyt Yes, drawing attention to global variables used in $global_var_name style is a good suggestion. I'll discuss this with Plusnet.
There might be something that can be used as a starting point here
@Tony
Thanks for that link. The Perl program action is to find all files with a '.html' extension (easily changed), read each of them in turn into memory, globally replace a specified 'from' string with a 'to' string and write each file out again. The writer mentioned needing to change some 30000 pages, which could take a long time - running the script unattended in the background was suggested, not an option for us.
For our requirements a shell script employing 'grep' run on the server might be faster, though there are potentially a lot of global variables to search for and run time could be an issue (for impatient users).
David
Re: ccgi down
22-03-2010 4:26 PM
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Report to Moderator
Quote from: Bob The platform should now be back up and the announcements are on their way...
Bob - According to the forum ccgi should now be up and running. I host a website (www.1ststpetersseascouts.co.uk) using Joomla 1.5.8 via the PlusNet ccgi service which is no longer working since the upgrade. I have carried out some testing including removing my .htaccess and find I can run a 'test.php' in the root folder but can not run it from a subfolder. Can you explain why this is please.
I am very frustrated as the site has been running for about 18 months with no issues and suddenly it will not work since the upgrade. Please can you help?
(Note: I have put a temporary HTML based message on the site to inform of the problem so if you try and access the site this is NOT the Joomla site).
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page