Running perl scripts outside cgi-bin

Discussion in 'General' started by Andrew Martin, Nov 17, 2023.

  1. Andrew Martin

    Andrew Martin New Member

    Hi,

    I know this has been asked before but I am still struggling to get it working.
    When I try to access a perl script the browser attempts to download it.
    I did try
    ScriptAlias /cgi-bin/ /var/www/clients/client1/{DOMAIN}/web

    but no luck.
    Any help would be much appreciated.
     
  2. Taleman

    Taleman Well-Known Member HowtoForge Supporter

    Did you try in ISPConfig Panel website Domain tab turn on cgi and perl?
     
    ahrasis likes this.
  3. Andrew Martin

    Andrew Martin New Member

    Yes , sorry my question was not well worded. What I am trying to do is run perl scripts outside cgi-bin.
    So I would like to run example.com/hello/hello.pl for example.
    I saw an earlier post suggesting ScriptAlias /cgi-bin/ /var/www/clients/client1/{DOMAIN}/web but that has not helped.
     
  4. till

    till Super Moderator Staff Member ISPConfig Developer

    You can e.g. try configuring something like "AddHandler cgi-script .pl" for the whole host in the apache directives field of the website. But I've not used cgi scripts in websites for a very long time, so I don't have any current detailed instructions at hand. An alternative can be to use mod_perl (if that still exists) and then configure a perl handler for that site using apache directives field.
     
    ahrasis likes this.
  5. Andrew Martin

    Andrew Martin New Member

    Thanks Tim, I managed to get the result I wanted - run perl scripts in a directory other than cgi-bin.
    On the remote chance someone will find it helpful this is what I added to Apache2 directives.

    <Directory "/var/www/clients/client1/web1/web/garden">
    Options +ExecCGI
    AddHandler cgi-script .pl
    </Directory>
    ScriptAlias "/cgi-bin/" "/var/www/clients/client1/web1/web/garden/"

    where htttp://example.com/garden/prog.pl resides.

    Cheers & thank you all for your assistance,

    Andrew
     

Share This Page