Apache2: I can server cgi files or .HTML but not both

  • Thread starter Thread starter Matt A
  • Start date Start date
M

Matt A

I am struggling with Apache2 configuration to serve CGI (.py) and .HTML files on the same website.

if I run 'a2enmod cgi' my .py files can be served but my HTML Files can't be served. if I run 'a2dismod cgi' my .py files CAN'T be served but my HTML files CAN.

my html files are in:

/var/www/html/

my .py files are in:

/usr/lib/cgi-bin/

I hope the ScriptAlias takes care of the CGI

my /etc/apache2/apache2.conf file is as follows:

Code:
<Directory />
    Options FollowSymLinks
    AllowOverride None
    Require all denied
</Directory>

<Directory /usr/share>
    AllowOverride None
    Require all granted
</Directory>


ScriptAlias "cgi-bin" "/usr/lib/cgi-bin"

<Directory /var/www/html/>
    Options Indexes FollowSymLinks
    AllowOverride None
    Require all granted
#   AddHandler cgi-script .py
#   SetHandler cgi-script

</Directory>


#<Directory /srv/>
#   Options Indexes FollowSymLinks
#   AllowOverride None
#   Require all granted
#</Directory>


<Directory /var/www/html/>
        Options ExecCGI
        SetHandler cgi-script
</Directory>

<Directory /var/www/html/>
        Options +ExecCGI
        AddHandler cgi-script .py
</Directory>

Grateful for any help

Continue reading...
 
Back
Top Bottom