CGI Scripts - Knowledge Base Archives - Hivelocity Hosting https://www.hivelocity.net/kb/tag/cgi-scripts/ Dedicated Servers, Private Cloud & Colocation Mon, 18 Dec 2023 21:50:01 +0000 en-US hourly 1 https://wordpress.org/?v=6.6 Prevent the user “nobody” from sending mail https://www.hivelocity.net/kb/how-can-i-prevent-the-user-nobody-from-sending-mail-2/ https://www.hivelocity.net/kb/how-can-i-prevent-the-user-nobody-from-sending-mail-2/#respond Sat, 13 Nov 2010 22:24:40 +0000 https://kb.hivelocity.net/?p=1875 Solution Login to WHM, Click on the “Tweak Settings” link under “Server Setup”. Within the mail section is a check box with the heading: “Prevent the user ‘nobody’ from sending out mail to remote addresses (php and cgi scripts generally run as nobody if you are not using phpsuexec and suexec respectively.)” Tick the check …

Prevent the user “nobody” from sending mail Read More »

The post Prevent the user “nobody” from sending mail appeared first on Hivelocity Hosting.

]]>
Solution

Login to WHM, Click on the “Tweak Settings” link under “Server Setup”. Within the mail section is a check box with the heading:

“Prevent the user ‘nobody’ from sending out mail to remote addresses (php and cgi scripts generally run as nobody if you are not using phpsuexec and suexec respectively.)”

Tick the check box and and apply the changes by clicking on the “Save” button at the bottom of the page.

The post Prevent the user “nobody” from sending mail appeared first on Hivelocity Hosting.

]]>
https://www.hivelocity.net/kb/how-can-i-prevent-the-user-nobody-from-sending-mail-2/feed/ 0
Fix Suexec breaking cgi scripts issue https://www.hivelocity.net/kb/suexec-is-breaking-my-cgi-scripts/ https://www.hivelocity.net/kb/suexec-is-breaking-my-cgi-scripts/#respond Sat, 13 Nov 2010 21:35:13 +0000 https://kb.hivelocity.net/?p=1832 Solution Fix cgi scripts that are returning a 500 error because of permissions : /scripts/fixsuexeccgiscripts This reads /usr/local/apache/logs/suexec_log and looks for errors and tries to fix them, though if you still get errors, tail that log file and see what the error is.  

The post Fix Suexec breaking cgi scripts issue appeared first on Hivelocity Hosting.

]]>
Solution

Fix cgi scripts that are returning a 500 error because of permissions : /scripts/fixsuexeccgiscripts This reads /usr/local/apache/logs/suexec_log and looks for errors and tries to fix them, though if you still get errors, tail that log file and see what the error is.

 

The post Fix Suexec breaking cgi scripts issue appeared first on Hivelocity Hosting.

]]>
https://www.hivelocity.net/kb/suexec-is-breaking-my-cgi-scripts/feed/ 0
Fix Plesk Webmail on Windows not loading and eventually timing out https://www.hivelocity.net/kb/how-to-fix-plesk-webmail-on-windows-not-loading-and-eventually-timing-out-4/ https://www.hivelocity.net/kb/how-to-fix-plesk-webmail-on-windows-not-loading-and-eventually-timing-out-4/#respond Sat, 13 Nov 2010 19:32:27 +0000 https://kb.hivelocity.net/?p=1719 Please check to make sure that IIS for webmail is set to parse PHP pages in CGI mode as it will not work with PHP in ISAPI mode. To verify PHP is running in CGI for webmail, go to IIS Manager -> Websites -> webmail -> properties. Select the home directory tab -> Configuration -> …

Fix Plesk Webmail on Windows not loading and eventually timing out Read More »

The post Fix Plesk Webmail on Windows not loading and eventually timing out appeared first on Hivelocity Hosting.

]]>
Please check to make sure that IIS for webmail is set to parse PHP pages in CGI mode as it will not work with PHP in ISAPI mode.

To verify PHP is running in CGI for webmail, go to IIS Manager -> Websites -> webmail -> properties.

Select the home directory tab -> Configuration -> Application mappings, ensure that the extension .php is being handled by the executable version of PHP which is in

“C:\Program Files\SWsoft\Plesk\Additional\Php\php.exe”.

 

The post Fix Plesk Webmail on Windows not loading and eventually timing out appeared first on Hivelocity Hosting.

]]>
https://www.hivelocity.net/kb/how-to-fix-plesk-webmail-on-windows-not-loading-and-eventually-timing-out-4/feed/ 0
How to configure cgi on IIS? https://www.hivelocity.net/kb/how-to-configure-cgi-on-iis/ https://www.hivelocity.net/kb/how-to-configure-cgi-on-iis/#respond Sat, 13 Nov 2010 07:30:33 +0000 https://kb.hivelocity.net/?p=1004 Here’s how you do it: Open IIS. (Click “Start”, “Administrative Tools”, “Internet Information Services”.) Right-click the web server and select “Properties”. (It should be the first computer in the left-hand pane. It most likely has an asterisk * next to it.) On the “Internet Information Services” tab (the first one you see), click the “Edit …

How to configure cgi on IIS? Read More »

The post How to configure cgi on IIS? appeared first on Hivelocity Hosting.

]]>
Here’s how you do it:
Open IIS. (Click “Start”, “Administrative Tools”, “Internet Information Services”.)
Right-click the web server and select “Properties”. (It should be the first computer in the left-hand pane. It most likely has an asterisk * next to

it.)
On the “Internet Information Services” tab (the first one you see), click the “Edit …” button next to “WWW Service” in the drop-down combo box

titled “Master Properties”.
Select the “Home Directory” tab.
Click the “Configuration …” button located near the lower right-hand side of the tab.
Check to make sure that the extension you are modifying is not already in the list!
Click the “Add” button.
Use the “Browse …” button to find the path to the executable you want to handle parsing files with the extension you are about to modify. (ex.

“C:\WINNT\System38\inetsrv\asp.dll” if you want to parse ASP code in the file; “C:\Perl\Perl.exe %s” if you want to parse the file as if it had a *.pl

extension. NOTE: Your paths will be different from mine.)
Add the extension you want to modify. (ex. “.css”, “.cgi”)
Change the verbs to “GET, POST, HEAD”. (I don’t know why. Just do it. It works.)
Click “OK” until you get all the way back to the main screen.
You will – most likely – have to restart the IIS service on the machine.

The post How to configure cgi on IIS? appeared first on Hivelocity Hosting.

]]>
https://www.hivelocity.net/kb/how-to-configure-cgi-on-iis/feed/ 0
How To Troubleshoot Your CGI Scripts – Internal Server Error 500 https://www.hivelocity.net/kb/how-to-troubleshoot-your-cgi-scripts/ https://www.hivelocity.net/kb/how-to-troubleshoot-your-cgi-scripts/#respond Sat, 13 Nov 2010 07:30:01 +0000 https://kb.hivelocity.net/?p=1002 If you try to use a CGI script on your web page and you get an Internal Server Error 500, this means that the CGI script did not execute properly. There are several causes that can generate this error, so a few things will need to be checked.   STEP 1: Check Permissions and Group …

How To Troubleshoot Your CGI Scripts – Internal Server Error 500 Read More »

The post How To Troubleshoot Your CGI Scripts – Internal Server Error 500 appeared first on Hivelocity Hosting.

]]>
If you try to use a CGI script on your web page and you get an Internal Server Error 500, this means that the CGI script did not execute properly. There are several causes that can generate this error, so a few things will need to be checked.

 

STEP 1: Check Permissions and Group Ownership

To start, you’ll want to check the /var/log/httpd/suexec_log. The log contains any errors that would result from not having correct permissions set on the file.

The file needs to be in a cgi-bin and must have the owner/group as the username who owns the site. If it’s owned be anyone else, it will not run. Also, the script must have execute permission.

The most common chmod permission is 755 (or rwxr-xr-x). You’ll need to go through all your directories from the public_html down to the directory the script is in, making sure that all permissions are set to 755 (*Note: public_html can be 750 *only* if it has a group of apache).

 

If Using a Hivelocity Server (Special Requirements)

If you’re one of our customers and you’re experiencing an Internal Server Error 500 on your CGI scripts, then it might be due to missing requirements specific to our servers. The Apache Server software that we run on our Hivelocity web servers has certain group ownership and permissions requirements for CGI scripts. Please check to see that your script meets the following requirements:

  • The directory the CGI script resides in must not be writable by other or by group users.
  • The CGI script itself must not be writable by other or by group users.
  • CGI script must not have the setuid bit set.
  • You must call SSI execs by their full pathname. For example, if you are running a UNIX command located on the web server it would look something like this:

    <!--#exec cmd="/usr/bin/date"-->

    If you are running a script that is in your pcgi-bin, it might look something like this for corp-web customers:

    <!--#exec cmd="/htdocs/youruserid/pcgi-bin/bar.pl"-->

    and like this for cheap-web and personal web customers:

    <!--#exec cmd="/htdocs/userdirs/youruserid/pcgi-bin/bar.pl"-->

  • The target userid may not be < 100 and the target gid may not be < 20. This rule only affects staffers’ CGI scripts. Staffers must chgrp their scripts to group users or some other group.
  • The minimum permissions for CGI scripts is mode 500. For CGI compiled programs, the minimum permissions is mode 100. You can of course grant more permissions if you wish.
  • The minimum permissions for server-parsed-html (.shtml) files is mode 004 (readable by other), and exec files included therein must be at least mode 700 for scripts and mode 500 for binaries.

 

STEP 2: Troubleshooting your CGI Script

If you’ve checked the suexec_log and it only shows the script being run, then it might not be an issue with permissions. The cause of the error may be within the script code itself.

The easiest way to figure out script coding problems is to first run the script manually from an ssh prompt. You can do that using a variation of the following commands:

cd /home/username/domains/domain.com/public_html/cgi-bin

./script.cgi

One common error is the use of an incorrect interpreter. The two most common interpreters are:

#!/usr/bin/perl

and

#!/usr/local/bin/php

This code must appear on the first line of the script.

Sometimes, a file is uploaded in Windows format causing the trailing newline (return) character to form incorrectly. In this instance, the file would need to be re-uploaded in a different format.

Another error that could be generated when running the script manually from ssh would be missing perl modules. If you’re missing perl modules, you’ll need to install them manually. Using CPAN (The Comprehensive Perl Archive Network) is the easiest method to install new perl modules. This can be done with the following command:

eg: perl -e shell -MCPAN install Bundle::DBD::mysql

 

Popular Links

Looking for more information on CGI Scripts? Search our Knowledge Base!

Interested in more articles about Coding? Navigate to our Categories page using the bar on the left or check out these popular articles:

Popular tags within this category include: CGI Scripts, Zend Optimizer, PIP, Python, and more.

Don’t see what you’re looking for? Use the search bar at the top to search our entire Knowledge Base.

 

The Hivelocity Difference

Seeking a better Dedicated Server solution? In the market for Private Cloud or Colocation services? Check out Hivelocity’s extensive list of products for great deals and offers.

With best-in-class customer service, affordable pricing, a wide-range of fully-customizable options, and a network like no other, Hivelocity is the hosting solution you’ve been waiting for.

Unsure which of our services is best for your particular needs? Call or live chat with one of our sales agents today and see the difference Hivelocity can make for you.

The post How To Troubleshoot Your CGI Scripts – Internal Server Error 500 appeared first on Hivelocity Hosting.

]]>
https://www.hivelocity.net/kb/how-to-troubleshoot-your-cgi-scripts/feed/ 0
Basics of installing CGI & Perl scripts https://www.hivelocity.net/kb/what-are-the-basics-of-installing-cgi-perl-scripts/ https://www.hivelocity.net/kb/what-are-the-basics-of-installing-cgi-perl-scripts/#respond Tue, 09 Nov 2010 11:03:48 +0000 https://kb.hivelocity.net/?p=545 1) Be sure the file permissions are set correctly on the cgi that you are trying to run start with 755. 2) Always upload and download a cgi in ASCII transfer mode.

The post Basics of installing CGI & Perl scripts appeared first on Hivelocity Hosting.

]]>
1) Be sure the file permissions are set correctly on the cgi that you are trying to run start with 755.

2) Always upload and download a cgi in ASCII transfer mode.

The post Basics of installing CGI & Perl scripts appeared first on Hivelocity Hosting.

]]>
https://www.hivelocity.net/kb/what-are-the-basics-of-installing-cgi-perl-scripts/feed/ 0