• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

Resolved cgi-bin location where is directory no option to change

Zardiw

Basic Pleskian
Hi.

On a new Dedicated Server and none of my .pl perl scripts in the cgi-bin work.

It's because the server is looking for them in the /var/www/cgi-bin directory, and of course they are not there.

My sites/webpages all look for them in the httpdocs/cgi-bin directory......where my scripts have been executing on all the sites I moved to this new server.

Have done a lot of research........At one time there was a PHP Settings field in the Plesk GUI that let you set the directory location of the cgi-bin........but that option is no more apparently.

Much of the info I found is old also.

Also read something about .pl/perl scripts not being allowed to run unless they are in a cgi-bin in the www/ directory.

Bottom Line, I'd like to know how to make the server look at the cgi-bin in the web folder, i.e. httpdocs/cgi-bin and allow them to execute there.

Thanks for any help................z
 
Hi Zardiw,

pls. post your current settings from

=> HOME > Subscriptions > YOUR-DOMAIN.COM > Hosting Settings ( YOUR CGI - settings, pls. )
=> HOME > Subscriptions > YOUR-DOMAIN.COM > Apache & nginx Settings ( YOUR "Handlers" settings, pls. )

=> HOME > Service Plans > YOUR-SERVICE-PLAN-NAME > Hosting Parameters ( YOUR CGI - settings, pls. )

=> HOME > Tools & Settinbgs > PHP Settings

=> Pls. check, that your CGI - handler is enabled, by checking it with the command ( logged in as user "root" over SSH ):
Code:
plesk bin php_handler --list
... and ENABLE a disabled CGI - handler with for example:
Code:
plesk bin php_handler --enable -id cgi
or
Code:
plesk bin php_handler --enable -id plesk-php56-cgi


You are able to set "CUSTOM" settings for your scripts, as described at:

=> Apache and Nginx Settings ( => Configuring Apache Handlers )


If you still have issues/errors/problems, when using a CGI - script, pls. don't forget to post the corresponding log - entries for further investigations!
 
Thank you for answering:

It turns out I did not have the CGI Support box checked. I thought it was one or the other on cgi-bin/fastcgi.

Once I checked it, the server is using the cgi-bin in httpdocs. (see image below of hosting settings)

I still can't find where to set the cgi-bin location, but it's working anyway. Maybe the default is the httpdocs dir.

Below is some of the data you asked for......and for anybody else that has this problem.

Under the PHP settings there is an option for base dir .......Unclear what that setting does, but it seems to select where something is located.....Root, or Web space?

Error Log Msg:

AH01264: script not found or unable to stat: /var/www/cgi-bin/countit.pl

Hosting Settings:

ywsakScreenHunter078.jpg


PHP Settings:

tnpqbPHPSettings.jpg
 
PS. Here is the current handler status report......it shows cgi disabled, but fastcgi enabled.
Everything is working now with these handlers enabled/disabled.

foffdHandlers.jpg


z
 
Hi Zardiw,

it shows cgi disabled, but fastcgi enabled
Pls. note, that the PHP - Handler "CGI" and "MODULE" are insecure and should not be used anymore - but it is sometimes essential to investigate all possible root causes and that's why I mentioned this as well. ;)

I still can't find where to set the cgi-bin location, but it's working anyway. Maybe the default is the httpdocs dir.
CGI - scripts can be run within each folder inside the "webroot" - definition ( by default ) of your domain/subdomain.

Under the PHP settings there is an option for base dir .......Unclear what that setting does, but it seems to select where something is located.....Root, or Web space?
"open_basedir" are the allowed paths, where PHP is able to be executed. Pls. read more at => PHP: Beschreibung der php.ini-Direktiven des Sprachkerns - Manual
 
Back
Top