LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   I have a problem with /cgi-bin/ (https://www.linuxquestions.org/questions/linux-newbie-8/i-have-a-problem-with-cgi-bin-4175414682/)

DrMix 07-03-2012 11:42 AM

I have a problem with /cgi-bin/
 
hello


I have a problem with /cgi-bin/

I worked on the server settings cgi

Was run cgi. Example

http://www.up7c.com/cgi-bin/test2.cgi

PHP Code:

Hello World

Can not run some cgi files

As an example

http://www.up7c.com/cgi-bin/cgienv.cgi

PHP Code:

Internal Server Error

The server encountered an internal error 
or misconfiguration and was unable to complete your request.

Please contact the server administrator,  and inform them of the time the error occurred, and anything you might have done that may have caused the error.

More information about this error may be available in the server error log


Kustom42 07-03-2012 11:55 AM

First things first, what does your error log tell you?

Take a look at /var/log/httpd/error_log and look for the ERROR reported. Post it here if you want some input from the community, but this is going the be the best place to look to tell you what is misconfigured.

DrMix 07-03-2012 12:02 PM

tail -f /var/log/httpd/up7c.com-error_log

PHP Code:

[root@server ~]# tail -f /var/log/httpd/up7c.com-error_log 
[Tue Jul 03 18:57:28 2012] [noticecannot use a full URL in a 401 ErrorDocument directive --- ignoring!
[
Tue Jul 03 18:57:28 2012] [error] [client 77.31.705.177File does not exist: /home/xxx/public_html/favicon.ico
[Tue Jul 03 18:57:28 2012] [noticecannot use a full URL in a 401 ErrorDocument directive --- ignoring!
[
Tue Jul 03 18:57:29 2012] [noticecannot use a full URL in a 401 ErrorDocument directive --- ignoring!
[
Tue Jul 03 18:57:29 2012] [error] [client 77.31.705.177Can't locate CGI.pm in @INC (@INC contains: /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5 .) at /home/xxx/public_html/cgi-bin/cgienv.cgi line 5.
[Tue Jul 03 18:57:29 2012] [error] [client 77.31.705.177] BEGIN failed--compilation aborted at /home/xxx/public_html/cgi-bin/cgienv.cgi line 5.
[Tue Jul 03 18:57:29 2012] [error] [client 77.31.705.177] Premature end of script headers: cgienv.cgi
[Tue Jul 03 18:57:29 2012] [notice] cannot use a full URL in a 401 ErrorDocument directive --- ignoring!
[Tue Jul 03 18:57:29 2012] [error] [client 77.31.705.177] File does not exist: /home/xxx/public_html/favicon.ico
[Tue Jul 03 18:57:29 2012] [notice] cannot use a full URL in a 401 ErrorDocument directive --- ignoring!
[Tue Jul 03 18:57:56 2012] [notice] cannot use a full URL in a 401 ErrorDocument directive --- ignoring!
[Tue Jul 03 18:57:56 2012] [notice] cannot use a full URL in a 401 ErrorDocument directive --- ignoring!
[Tue Jul 03 18:57:56 2012] [error] [client 77.31.705.177] File does not exist: /home/xxx/public_html/favicon.ico
[Tue Jul 03 18:57:56 2012] [notice] cannot use a full URL in a 401 ErrorDocument directive --- ignoring!
[Tue Jul 03 18:57:58 2012] [notice] cannot use a full URL in a 401 ErrorDocument directive --- ignoring!
[Tue Jul 03 18:57:58 2012] [error] [client 77.31.705.177] Can'
t locate CGI.pm in @INC (@INC contains: /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5 .) at /home/xxx/public_html/cgi-bin/cgienv.cgi line 5.
[Tue Jul 03 18:57:58 2012] [error] [client 77.31.705.177BEGIN failed--compilation aborted at /home/xxx/public_html/cgi-bin/cgienv.cgi line 5.
[Tue Jul 03 18:57:58 2012] [error] [client 77.31.705.177Premature end of script headerscgienv.cgi
[Tue Jul 03 18:57:59 2012] [noticecannot use a full URL in a 401 ErrorDocument directive --- ignoring!
[
Tue Jul 03 18:57:59 2012] [error] [client 77.31.705.177File does not exist: /home/xxx/public_html/favicon.ico
[Tue Jul 03 18:57:59 2012] [noticecannot use a full URL in a 401 ErrorDocument directive --- ignoring


Kustom42 07-03-2012 12:08 PM

Ah the premature end of script headers error. This one can make some people pull their hair out as it has many possible causes and the error is really generic. However, with these symptoms I would bet its something as simple as not having the +ExecCGI option enabled for the Directory/Vhost.

Can you take a look at the Options directive for your virtual host and make sure +ExecCGI is listed? If it's not add it and restart apache.

DrMix 07-04-2012 03:31 AM

There exists ExecCGI


PHP Code:

<Directory "/home/xxx/public_html/cgi-bin/">
AllowOverride None
Options 
+ExecCGI -MultiViews +SymLinksIfOwnerMatch
Order allow
,deny 
Allow from all 



All times are GMT -5. The time now is 06:31 AM.