cancel
Showing results for 
Search instead for 
Did you mean: 

ccgi down

mouseblack
Dabbler
Posts: 17
Thanks: 1
Registered: ‎17-03-2008

Re: ccgi down

Thanks for that ninjanik.
Bit confused by the ~username bit.
I access my cgi directly by cgi.username.force9.co.uk/folder/
But if I enter RewriteCond %{REQUEST_URI} !^/~username/folder/ it doesn't work - what does the ~ represent ?
When I upload the .htaccess it breaks the direct cgi access - if I delete the .htaccess I can navigate directly but then I don't have the domain forwarding...

EDIT: If I remove the Options +FollowSymlinks I can navigate directly to my folders but when I enter the www.534nm.co.uk I now get 403 access forbidden
ninjanik
Newbie
Posts: 9
Registered: ‎03-08-2007

Re: ccgi down


Quote
But if I enter RewriteCond %{REQUEST_URI} !^/~username/folder/ it doesn't work - what does the ~ represent ?

"When prepended to a particular username, the tilde indicates that user's home directory" (straight from http://en.wikipedia.org/wiki/Tilde ; Smiley )
In your original post it looks like you were trying to redirect to the folder "534"  from  www.534nm.co.uk ?
Gabes post on page 2 explains why the ~username is now required. Hopefully he / or someone with more experience than me will be able to offer some better help.


pkfraser
Newbie
Posts: 5
Registered: ‎05-08-2007

Re: ccgi down

Hope you can help... the PHP files on our root directory have recently started displaying this error message.
"Server error! The server encountered an internal error and was unable to complete your request. Error message: Premature end of script headers: index.php If you think this is a server error, please contact the webmaster. Error 500"
Saying that the same PHP files runs fine in a sub directory. All the permissions are all set as '755' and we have disabled the .htaccass file...
See example http://www.promanade.co.uk - http://www.promanade.co.uk/test
Any help would be much appreciated.
spraxyt
Resting Legend
Posts: 10,063
Thanks: 674
Fixes: 75
Registered: ‎06-04-2007

Re: ccgi down

For me the domain URL displays a normal HTML page including Our site is currently undergoing maintenance. Using the test folder URL I get
Quote
Warning: include() [function.include]: Failed opening 'templates/homepage.php' for inclusion (include_path='.:/usr/share/php:/usr/share/pear') in /share/storage/ (user file path omitted) /test/index.php  on line 144

plus the failed to open stream message because templates/homepage.php was not found.
Hope that helps.
David
David
mouseblack
Dabbler
Posts: 17
Thanks: 1
Registered: ‎17-03-2008

Re: ccgi down

Thanks again  ninjanik
Don't know if it was me or if plusnet have been tweaking, but finally if it will help anyone else, the following is now working for me !
RewriteEngine on
RewriteBase /
RewriteCond %{HTTP_HOST} ^www.534.co.uk$ [nc]
RewriteCond %{REQUEST_URI} !^/~username/534/
RewriteRule (.*) /534/$1

And that ~username is exactly that - the ~ followed by my username.
I deleted the Options +FollowSymlinks
Ben_Brown
Grafter
Posts: 2,839
Registered: ‎13-06-2007

Re: ccgi down

Hi,
Try it without the RewriteBase and see if that works for you.
pkfraser
Newbie
Posts: 5
Registered: ‎05-08-2007

Re: ccgi down

David
Our fault - we had set up a "holding" message because of the problems.  Now reset back to the index.php file...
What I don't understand is why the script file executes in the subfolder but not in the root?
spraxyt
Resting Legend
Posts: 10,063
Thanks: 674
Fixes: 75
Registered: ‎06-04-2007

Re: ccgi down

OK; on the domain URL I now get the Premature end of script headers: index.php  followed by Error 500. Same missing template message from the test folder.
Are you sure you've eliminated the following as the cause of the domain problem?
[quote=http://community.plus.net/forum/index.php/topic,84451.0.html]
8.) I'm getting a server 500 error when trying to browse to my web site.
The most common reason for this error is where customers are using .htaccess directives that are not compatible with the new servers.  The new platform allows .htaccess to override only: FileInfo, AuthConfig and Limit directive types. This is much more secure but may cause some formerly-allowed directives to fail e.g. IndexIgnore must be removed. For more information about this, please refer to the forum post here. If you're receiving this error then you should also check that your permissions adhere to the limitations detailed above.
9.) I'm getting a 'Premature end of script headers: index.php' error, what does it mean?
Check that your file permissions and any .htaccess files adhere to the limitations set out above. You should also check that you're using compatible environment variables. See here for more information.
David
Crookwood
Newbie
Posts: 5
Registered: ‎03-10-2009

Re: ccgi down

So my Joomla site is still causing me problems...
I've identified that the problem is with the .htaccess file that worked OK before.  The problem is that the SEF settings in joomla don't work anymore (remapping of URLs).
The old .htacess was this:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
##  Can be commented out if causes errors, see notes above.
Options +FollowSymLinks
#
#  mod_rewrite in use
RewriteEngine On

#  Uncomment following line if your webserver's URL
#  is not directly related to physical file paths.
#  Update Your Joomla! Directory (just / for root)
#RewriteBase /

########## Begin - Joomla! core SEF Section
#
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !^/index.php
RewriteCond %{REQUEST_URI} (/|\.php|\.html|\.htm|\.feed|\.pdf|\.raw|/[^.]*)$  [NC]
RewriteRule (.*) index.php
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization},L]
#
########## End - Joomla! core SEF Section
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The new one requires that  Options +FollowSymLinks is commented out, or it fails. However after this, I can't get it to rewrite the URLs.  I read Gabes note about the ~username, and have tried adding this to the 3rd RewriteCond ( with my own username), but with no avail.
I assume that mod_rewrite is installed?
Any help would be greatly appreciated, as I've been down for a week now and am getting very grey!
Gabe
Grafter
Posts: 767
Registered: ‎29-10-2008

Re: ccgi down

Quote from: Crookwood
So my Joomla site is still causing me problems...

Looks like you might need to uncomment the RewriteBase / line and if Joomla's in a folder make it RewriteBase /foldername
Gabe
Crookwood
Newbie
Posts: 5
Registered: ‎03-10-2009

Re: ccgi down

Thanks Gabe, I appreciate your input.
Unfortunately, this (uncomment rewritebase) doesn't seem to alter anything.
Basically the site is working  fine, but the SEF modules outputs english filenames rather than php variables.  Because I've encoded all of my links to these english names, without the redirection, they don't link.
I don't know what joomla module does the SEF work, but the rewriting doesn't work.  It used to work fine on the old platform, but doesn't with the new platform. Everything else is the same. I've altered the permissions to 750 ( was 755 before), the recomended  710 locks the site out. I can investigate this later, but at present, the site works apart from the URL re-writing.  I'm getting 404 or 500 errors. The only difference I can see is that the ~username gets inserted into all the URLs. This may be the problem, but I don't know how to erradicate it.
Any ideas?
Crookwood
Newbie
Posts: 5
Registered: ‎03-10-2009

Re: ccgi down

Ok, update:
The rewrite base, has done something.  My browser cache and an irregularity in joomla's links was confusing some of the pages.
So now it's working, thank you. Except it's throwing out ~username on each URL, which might confuse my google cache...
I'm guessing this is an .htaccess rule, but I'm not an expert. Any suggestions welcome!
spraxyt
Resting Legend
Posts: 10,063
Thanks: 674
Fixes: 75
Registered: ‎06-04-2007

Re: ccgi down

Just looked at sef.php, one of the modules in the joomlasef package. I noticed it strips the filename from $_SERVER['PHP_SELF'] for internal use, but on the new platform that leaves what I assume is an unwanted /~username. You could try customising a copy of all *.php modules by globally replacing references to PHP_SELF by SCRIPT_URL which does not have the /~username prefix.
Not the ideal solution perhaps, but might well fix the problem, at least to get you going.
David
David
Tony_W
Grafter
Posts: 745
Registered: ‎11-08-2007

Re: ccgi down

With all of the problems associated with e.g. $PHP_SELF and other global variables there will be a multitude of web sites that fall over when 'register_globals' is switched off.
Is it possible to generate a standard cgi script - of the kind that Gabe produced for altering permissions - that we can run which looks for all of the global variables in every PHP file and substitutes the preferred version  e.g. $_SERVER['SCRIPT_URL']?
There aren't that many global variables and it would save people missing one in their own (complex) website. Also, some people who have installed off-the-shelf packages and do not understand the code, could still get one other obstacle out of the way.
Tony
spraxyt
Resting Legend
Posts: 10,063
Thanks: 674
Fixes: 75
Registered: ‎06-04-2007

Re: ccgi down

I would imagine off-the-shelf packages long ago stopped relying on global_variables being on, so current versions of these should be OK.
For ones own code a competent editor should be able to do a global search for variables the user knows have been used. I'd be wary of unchecked replacements made by a script.
The problem with certain environment variables having a /~username prefix is not connected with the global_variables setting. I hope before too long Plusnet will be able to remove that prefix so pre-ccgi change behaviour is re-established. I regard changing to a different variable as a stop-gap measure to get things working until this is fixed.
David
David