Location and path for common cgi-bin

 
Post new topic   Reply to topic    Aprelium Forum Index -> FastCGI/CGI
View previous topic :: View next topic  
Author Message
James Cook
-


Joined: 13 Oct 2018
Posts: 1
Location: Michigan USA

PostPosted: Tue Oct 16, 2018 4:37 pm    Post subject: Location and path for common cgi-bin Reply with quote

I'm new to Abyss, moving form OSX Server.

My server has had all cgi scripts located in /Library/WebServer/CGI-Executables.

With Abyss I've only been able to avoid 404 errors on the cgi when I locate the scripts in a cgi-bin directory within the root folder of every site.

Is there a way to have all cgi scripts in one location, and how would I enter it in the Scripting Parameters?
_________________
Jim
Back to top View user's profile Send private message
admin
Site Admin


Joined: 03 Mar 2002
Posts: 835

PostPosted: Wed Nov 14, 2018 5:01 pm    Post subject: Re: Location and path for common cgi-bin Reply with quote

James Cook wrote:
I'm new to Abyss, moving form OSX Server.

My server has had all cgi scripts located in /Library/WebServer/CGI-Executables.

With Abyss I've only been able to avoid 404 errors on the cgi when I locate the scripts in a cgi-bin directory within the root folder of every site.

Is there a way to have all cgi scripts in one location, and how would I enter it in the Scripting Parameters?


The idea is to use aliases to "share" the same physical location on the hard drive among several sites.

For each of your hosts which will use the CGI scripts in that folder, do the following:


  • Open the console, press the "Configure" button associated with the host to change

  • Select "Aliases"

  • Add a new alias defined as follows:
    Code:
    Virtual Path: /cgi-bin
        Real Path: /Library/WebServer/cgi-bin


  • Press "OK".


Now we'll make the .cgi files inside /cgi-bin executable or handled by Perl in Abyss Web Server:


If your .cgi is a Perl script, you could declare Perl support as explained in https://aprelium.com/abyssws/perl.html#mac .

Or:

If all .cgi files in /cgi-bin are correctly set as executables using the Finder (file properties) or the following command:

Code:
chmod +x *.cgi


and if all of them have a shebang line as their first line which looks like:

Code:
#!/usr/bin/perl


then the files are executable by the operating system and we'll only need to let Abyss Web Server know that the *.cgi files in /cgi-bin are executable CGI scripts. For that, open "Scripting Parameters" and add in the "Script Paths" table the following path:

Code:
/cgi-bin/*.cgi


Or even a more specific value like:

Code:
/cgi-bin/myscript.cgi


Press "OK" and restart the host. This should be enough for the host to act as expected.[/list]
_________________
Follow @abyssws on Twitter
Subscribe to our newsletter
_________________
Forum Administrator
Aprelium - https://aprelium.com
Back to top View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Aprelium Forum Index -> FastCGI/CGI All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB phpBB Group