cancel
Showing results for 
Search instead for 
Did you mean: 

ccgi down

Ben_Brown
Grafter
Posts: 2,839
Registered: ‎13-06-2007

Re: ccgi down

Are there an .htaccess file in the directory you are trying to run the script from? .htaccess files can be in any directory, and if one is behaving differently than the root directory it's most likely to be an .htaccess file that's causing the issue.
spraxyt
Resting Legend
Posts: 10,063
Thanks: 674
Fixes: 75
Registered: ‎06-04-2007

Re: ccgi down

Quote from: scottp
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.

Do you get a "Premature end of script headers" Error 500 when you try to run the script in the subfolder?
If you do the cause could be the script itself not being executable, or the subfolder it is in being writeable by 'group' or 'other'.
More information at item 6) in the upgrade FAQ
David
David
digbyhouse
Newbie
Posts: 5
Registered: ‎22-03-2010

Re: ccgi down

I've got a problem with my python CGI scripts since the new ccgi service started - instead of executing the script my browser offers to download it. I guess Apache isn't recognizing python files as valid scripts.
Anyone know how to fix this?
Thanks,
Alan
Gabe
Grafter
Posts: 767
Registered: ‎29-10-2008

Re: ccgi down

Quote from: digbyhouse
I guess Apache isn't recognizing python files as valid scripts.

Just tested a simple hello world and it seems okay:
#!/usr/bin/python
print "Content-Type: text/html\n\n"
print "<HTML>"
print "<HEAD>"
print "<TITLE>Hello World</TITLE>"
print "</HEAD>"
print "<BODY>"
print "<h2>Hello, World!</h2>"
print "</BODY>"
print "</HTML>"

hello.cgi chmod 0700
Gabe
scottp
Newbie
Posts: 2
Registered: ‎22-03-2010

Re: ccgi down

Quote from: Ben
Are there an .htaccess file in the directory you are trying to run the script from? .htaccess files can be in any directory, and if one is behaving differently than the root directory it's most likely to be an .htaccess file that's causing the issue.

Thank you.  Obvious really when one thinks about it.  There was another .htaccess as you suggested.  I remarked out the 'Options +FollowSymLinks' and the site is back up and running.
tonycollinet
Grafter
Posts: 1,140
Thanks: 5
Registered: ‎14-08-2007

Re: ccgi down

Trying to debug my drupal site. Looking for .htaccess. Can't find any using filezilla, but read that incorrect server configuration can hide .htaccess from filezilla.
I tried copying an empty .htaccess.txt file into a folder, and sure enough it dissappears from the file listing. This pages suggests that this is a server setup problem.
http://forum.filezilla-project.org/viewtopic.php?f=2&t=7059
Can someone have a look at this.
Thanks.
Tony_W
Grafter
Posts: 745
Registered: ‎11-08-2007

Re: ccgi down

I don't know about filezilla, but I'm sure it will be a setting in it that is hiding .htaccess.
I use WS_FTP and can only see the .htacces if I put a    -a    in the box on the extreme right hand sire if the user interface. The -a means show all files.
Look here for how to do it with filezilla.
Tony
Ben_Brown
Grafter
Posts: 2,839
Registered: ‎13-06-2007

Re: ccgi down

Quote from: collinet
Looking for .htaccess. Can't find any using filezilla, but read that incorrect server configuration can hide .htaccess from filezilla.

It's not incorrect configuration, it's standard behaviour on UNIX systems to hide files which start with a '.' character. I've not used filezilla, but I think I've seen on a post in here that there is an option to force it to show these hidden files.
spraxyt
Resting Legend
Posts: 10,063
Thanks: 674
Fixes: 75
Registered: ‎06-04-2007

Re: ccgi down

To show hidden files in FileZilla select the option mentioned in the quote.
Quote from: spraxyt
Because Unix regards files whose names begin with a dot as hidden, your FTP client might not show them unless told to. For example in FileZilla one has to select Force showing hidden files on the server menu. You are likely to find such a file in your HTTP root directory (/) but one could reside in any directory to control that directory.
Windows does not handle such files gracefully if they are downloaded to (or created on) a Windows PC. The usual approach is to call them htaccess.txt on Windows, upload them like that then use your FTP client to rename them to .htaccess in situ.

David
David
tonycollinet
Grafter
Posts: 1,140
Thanks: 5
Registered: ‎14-08-2007

Re: ccgi down

I don't think that option exists in the latest version of filezilla. At least I've not been able to find it. Instead it has a file filtering system - all of which is turned off.
Tony_W
Grafter
Posts: 745
Registered: ‎11-08-2007

Re: ccgi down

@collinet  - Have you tried the link I put in my post?
It says it works for version 2 and 3
Tony
spraxyt
Resting Legend
Posts: 10,063
Thanks: 674
Fixes: 75
Registered: ‎06-04-2007

Re: ccgi down

The version of FileZilla I use is 3.3.2.1 which was released a couple of days ago. That has Force showing hidden files as the last option on the Server menu. I have it ticked and can see my hidden files.
David
Edit: File filtering is on the View menu on my version.
David
tonycollinet
Grafter
Posts: 1,140
Thanks: 5
Registered: ‎14-08-2007

Re: ccgi down

Quote from: Tony
@collinet  - Have you tried the link I put in my post?
It says it works for version 2 and 3
Tony

Thanks and sorry - I saw the screenshot for version 2, but missed the one below it for version 3. The perils of skim reading. I can now see .htacess files.
tonycollinet
Grafter
Posts: 1,140
Thanks: 5
Registered: ‎14-08-2007

Re: ccgi down

OK - .htaccess now renamed to old.htaccess.old, and the site works again.   Kiss

However, the htaccess was part of the Drupal distribution. Am I likely to find things which don't work, as a result of completely disabling it. Is there an easy way (I am no expert) of identifying which lines in .htaccess would cause the problem.

Thanks again.
EDIT: Here it is if any kind soul would like to cast their eye over it....  Wink
Quote
#
# Apache/PHP/Drupal settings:
#
# Protect files and directories from prying eyes.
<FilesMatch "\.(engine|inc|info|install|module|profile|test|po|sh|.*sql|theme|tpl(\.php)?|xtmpl|svn-base)$|^(code-style\.pl|Entries.*|Repository|Root|Tag|Template|all-wcprops|entries|format)$">
  Order allow,deny
</FilesMatch>
# Don't show directory listings for URLs which map to a directory.
Options -Indexes
# Follow symbolic links in this directory.
Options +FollowSymLinks
# Make Drupal handle any 404 errors.
ErrorDocument 404 /index.php
# Force simple error message for requests for non-existent favicon.ico.
<Files favicon.ico>
  # There is no end quote below, for compatibility with Apache 1.3.
  ErrorDocument 404 "The requested file favicon.ico was not found.
</Files>
# Set the default handler.
DirectoryIndex index.php
# Override PHP settings. More in sites/default/settings.php
# but the following cannot be changed at runtime.
# PHP 4, Apache 1.
<IfModule mod_php4.c>
  php_value magic_quotes_gpc                0
  php_value register_globals                0
  php_value session.auto_start              0
  php_value mbstring.http_input            pass
  php_value mbstring.http_output            pass
  php_value mbstring.encoding_translation  0
</IfModule>
# PHP 4, Apache 2.
<IfModule sapi_apache2.c>
  php_value magic_quotes_gpc                0
  php_value register_globals                0
  php_value session.auto_start              0
  php_value mbstring.http_input            pass
  php_value mbstring.http_output            pass
  php_value mbstring.encoding_translation  0
</IfModule>
# PHP 5, Apache 1 and 2.
<IfModule mod_php5.c>
  php_value magic_quotes_gpc                0
  php_value register_globals                0
  php_value session.auto_start              0
  php_value mbstring.http_input            pass
  php_value mbstring.http_output            pass
  php_value mbstring.encoding_translation  0
</IfModule>
# Requires mod_expires to be enabled.
<IfModule mod_expires.c>
  # Enable expirations.
  ExpiresActive On
  # Cache all files for 2 weeks after access (A).
  ExpiresDefault A1209600
  # Do not cache dynamically generated pages.
  ExpiresByType text/html A1
</IfModule>
# Various rewrite rules.
<IfModule mod_rewrite.c>
  RewriteEngine on
  # If your site can be accessed both with and without the 'www.' prefix, you
  # can use one of the following settings to redirect users to your preferred
  # URL, either WITH or WITHOUT the 'www.' prefix. Choose ONLY one option:
  #
  # To redirect all users to access the site WITH the 'www.' prefix,
  # (http://example.com/... will be redirected to http://www.example.com/...)
  # adapt and uncomment the following:
  # RewriteCond %{HTTP_HOST} ^example\.com$ [NC]
  # RewriteRule ^(.*)$ http://www.example.com/$1 [L,R=301]
  #
  # To redirect all users to access the site WITHOUT the 'www.' prefix,
  # (http://www.example.com/... will be redirected to http://example.com/...)
  # uncomment and adapt the following:
  # RewriteCond %{HTTP_HOST} ^www\.example\.com$ [NC]
  # RewriteRule ^(.*)$ http://example.com/$1 [L,R=301]
  # Modify the RewriteBase if you are using Drupal in a subdirectory or in a
  # VirtualDocumentRoot and the rewrite rules are not working properly.
  # For example if your site is at http://example.com/drupal uncomment and
  # modify the following line:
  # RewriteBase /drupal
  #
  # If your site is running in a VirtualDocumentRoot at http://example.com/,
  # uncomment the following line:
  # RewriteBase /
  # Rewrite URLs of the form 'x' to the form 'index.php?q=x'.
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteCond %{REQUEST_URI} !=/favicon.ico
  RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]
</IfModule>
# $Id: .htaccess,v 1.90.2.3 2008/12/10 20:04:08 goba Exp $
Gabe
Grafter
Posts: 767
Registered: ‎29-10-2008

Re: ccgi down

Try it without:
Options -Indexes
Options +FollowSymLinks
DirectoryIndex index.php
The ifmodules won't because they aren't, but if any of the php_values are essential, you can use a custom php.ini.
and uncomment whichever of the rewriteBase lines applies
I think. See how it goes.
Gabe