Re: [Dorset] Making a Python File Available for Download

2016-03-08 Thread Terry Coles
On Tuesday 08 March 2016 19:44:13 Ralph Corderoy wrote:

Crossover !

> OK, I expected you to do it within something matching just the *.py
> files.  :-)

I was originally, but I removed it when I couldn't get it to work using None 
as the instruction.
 
> Try instead,
> 
> RemoveHandler py
> 
> That should cancel any handler that's been installed for it, leaving
> everything else alone.

See my other post.

> If there's still problems, the whole of the directory's .htaccess file
> would be handy, assuming it contains nothing private.

There was no .htaccess file originally.  In fact, there are no .htaccess files 
in any directory except this one.  When I first produced my website (about 20 
years ago), I did it to teach myself html.  At the time it was html V3 and I 
did the whole thing with a basic editor and one or two scripts provided by 
some imaging tool or another.

I knew nothing about config files, let alone .htaccess.

-- 

Terry Coles



--
Next meeting:  Bournemouth, Tuesday, 2016-04-05 20:00
Meets, Mailing list, IRC, LinkedIn, ...  http://dorset.lug.org.uk/
New thread:  mailto:dorset@mailman.lug.org.uk / CHECK IF YOU'RE REPLYING
Reporting bugs well:  http://goo.gl/4Xue / TO THE LIST OR THE AUTHOR


Re: [Dorset] Making a Python File Available for Download

2016-03-08 Thread Terry Coles
On Tuesday 08 March 2016 19:22:54 Terry Coles wrote:
> That seemed to suppress indexing.

Fixed it.  This is what worked:

Options +Indexes


SetHandler default-handler


I think that without the file filtering SetHandler turned off all the scripts, 
including the one that indexes the directory :-)

-- 

Terry Coles



--
Next meeting:  Bournemouth, Tuesday, 2016-04-05 20:00
Meets, Mailing list, IRC, LinkedIn, ...  http://dorset.lug.org.uk/
New thread:  mailto:dorset@mailman.lug.org.uk / CHECK IF YOU'RE REPLYING
Reporting bugs well:  http://goo.gl/4Xue / TO THE LIST OR THE AUTHOR


Re: [Dorset] Making a Python File Available for Download

2016-03-08 Thread Ralph Corderoy
Hi Terry,

> > Try
> >
> > SetHandler default-handler
>
> That seemed to suppress indexing.

OK, I expected you to do it within something matching just the *.py
files.  :-)

Try instead,

RemoveHandler py

That should cancel any handler that's been installed for it, leaving
everything else alone.

> It might have worked if I'd been able to see the file to click on :-)

You can manually enter the URL in the browser by tacking the filename
onto the end of the directory's URL.

If there's still problems, the whole of the directory's .htaccess file
would be handy, assuming it contains nothing private.

Cheers, Ralph.

--
Next meeting:  Bournemouth, Tuesday, 2016-04-05 20:00
Meets, Mailing list, IRC, LinkedIn, ...  http://dorset.lug.org.uk/
New thread:  mailto:dorset@mailman.lug.org.uk / CHECK IF YOU'RE REPLYING
Reporting bugs well:  http://goo.gl/4Xue / TO THE LIST OR THE AUTHOR


Re: [Dorset] Making a Python File Available for Download

2016-03-08 Thread Terry Coles
On Tuesday 08 March 2016 19:12:23 Ralph Corderoy wrote:
> Try
> 
> SetHandler default-handler

That seemed to suppress indexing.

It might have worked if I'd been able to see the file to click on :-)

-- 

Terry Coles



--
Next meeting:  Bournemouth, Tuesday, 2016-04-05 20:00
Meets, Mailing list, IRC, LinkedIn, ...  http://dorset.lug.org.uk/
New thread:  mailto:dorset@mailman.lug.org.uk / CHECK IF YOU'RE REPLYING
Reporting bugs well:  http://goo.gl/4Xue / TO THE LIST OR THE AUTHOR


Re: [Dorset] Making a Python File Available for Download

2016-03-08 Thread Ralph Corderoy
Hi Terry,

> SetHandler None 

Try

SetHandler default-handler

Cheers, Ralph.

--
Next meeting:  Bournemouth, Tuesday, 2016-04-05 20:00
Meets, Mailing list, IRC, LinkedIn, ...  http://dorset.lug.org.uk/
New thread:  mailto:dorset@mailman.lug.org.uk / CHECK IF YOU'RE REPLYING
Reporting bugs well:  http://goo.gl/4Xue / TO THE LIST OR THE AUTHOR


Re: [Dorset] Making a Python File Available for Download

2016-03-08 Thread Terry Coles
On Tuesday 08 March 2016 17:50:23 Andrew Montgomery-Hurrell wrote:
> I'd grep your webserver config files for any mentions of ".py" and comment
> out the offending (and related) lines. I imagine that for some reason it's
> configured to serve .py files as cgi scripts, rather than serving them as
> text/plain.

My webserver is a managed one through One and One and I don't seem to have 
direct access to the Apache config file.  The Help is a bit sparse on the One 
and One site, but the way to do it seems to be through the use of a .htaccess 
file located in the directory containing the script (or the one above) with an 
appropriate entry.

I managed to allow indexing of the directories containing the files using:

Options +Indexes

  but I couldn't find anything that worked for disabling scripts.  One site 
indicated that:

SetHandler None 

  should work, but it doesn't for me.

Can anyone tell me the right incantation?  I tried the Apache website, but I 
didn't find it very easy to navigate.

-- 

Terry Coles



--
Next meeting:  Bournemouth, Tuesday, 2016-04-05 20:00
Meets, Mailing list, IRC, LinkedIn, ...  http://dorset.lug.org.uk/
New thread:  mailto:dorset@mailman.lug.org.uk / CHECK IF YOU'RE REPLYING
Reporting bugs well:  http://goo.gl/4Xue / TO THE LIST OR THE AUTHOR


Re: [Dorset] Making a Python File Available for Download

2016-03-08 Thread Andrew Montgomery-Hurrell
I'd grep your webserver config files for any mentions of ".py" and comment
out the offending (and related) lines. I imagine that for some reason it's
configured to serve .py files as cgi scripts, rather than serving them as
text/plain.

On Tue, 8 Mar 2016 at 17:44 Terry Coles  wrote:

> Hi,
>
> I've been building a small repository of software and documentation on my
> website, but keep getting an error when I try to download a Python file:
>
> 
> Internal Server Error
>
> The server encountered an internal error or misconfiguration and was
> unable to
> complete your request.
>
> Please contact the server administrator, and inform them of the time the
> error
> occurred, and anything you might have done that may have caused the error.
>
> More information about this error may be available in the server error log.
>
> Additionally, a 404 Not Found error was encountered while trying to use an
> ErrorDocument to handle the request.
> 
>
> I'm assuming that the error is because the server is trying to execute the
> script instead of making it available because I am able to download all the
> other files that I've put up there.
>
> Is there any way that I can do this without renaming the file to something
> other than filename.py?
>
> I suppose if all else fails I could compress it.
>
> --
>
> Terry Coles
>
>
>
> --
> Next meeting:  Bournemouth, Tuesday, 2016-04-05 20:00
> Meets, Mailing list, IRC, LinkedIn, ...  http://dorset.lug.org.uk/
> New thread:  mailto:dorset@mailman.lug.org.uk / CHECK IF YOU'RE REPLYING
> Reporting bugs well:  http://goo.gl/4Xue / TO THE LIST OR THE AUTHOR
>
--
Next meeting:  Bournemouth, Tuesday, 2016-04-05 20:00
Meets, Mailing list, IRC, LinkedIn, ...  http://dorset.lug.org.uk/
New thread:  mailto:dorset@mailman.lug.org.uk / CHECK IF YOU'RE REPLYING
Reporting bugs well:  http://goo.gl/4Xue / TO THE LIST OR THE AUTHOR


[Dorset] Making a Python File Available for Download

2016-03-08 Thread Terry Coles
Hi,

I've been building a small repository of software and documentation on my 
website, but keep getting an error when I try to download a Python file:


Internal Server Error

The server encountered an internal error or misconfiguration and was unable to 
complete your request.

Please contact the server administrator, and inform them of the time the error 
occurred, and anything you might have done that may have caused the error.

More information about this error may be available in the server error log.

Additionally, a 404 Not Found error was encountered while trying to use an 
ErrorDocument to handle the request.


I'm assuming that the error is because the server is trying to execute the 
script instead of making it available because I am able to download all the 
other files that I've put up there.

Is there any way that I can do this without renaming the file to something 
other than filename.py?

I suppose if all else fails I could compress it.

-- 

Terry Coles



--
Next meeting:  Bournemouth, Tuesday, 2016-04-05 20:00
Meets, Mailing list, IRC, LinkedIn, ...  http://dorset.lug.org.uk/
New thread:  mailto:dorset@mailman.lug.org.uk / CHECK IF YOU'RE REPLYING
Reporting bugs well:  http://goo.gl/4Xue / TO THE LIST OR THE AUTHOR