[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Problem Running Python with Apache2 on Debian



I cannot get a python file to execute from html in Apache2 running on Debian 11.  I will attempt to provide enough information:
This is my HTML code:     <table><tr>
<td><a href="Albums.html">Return</a></td>
<td><a                </a></td>
<td><a href="1-22-2005-L.html">See Large Pictures</a></td>
</tr></table>

<button> <a href="/var/cgi-bin/slide-show.py">Slide Show</a></button>
When I click the button I get a Firefox message:




The beginning of the Python code looks like this:
#!/var/cgi-bin python3
"""Display a slideshow from a list of filenames"""

import os
import tkinter

import cgitb
cgitb.enable()

from itertools import cycle
from PIL import Image, ImageTk


class Slideshow(tkinter.Tk):
    """Display a slideshow from a list of filenames"""
    def __init__(self, images, slide_interval):
The owner of the file is root and the permissions are  -rwxr-xr-r
My /etc/apache2/cong-enabled/cgi-enabled.conf file looks like this:
<Directory "var/cgi-bin">
    Options +ExecCGI
    Allow from all
    AddHandler cgi-script .cgi .pl .py .rb
</Directory>

Any help would be appreciated.

PNG image


Reply to: