Apache CGI Perl error encountered and resolved
2014-07-26 00:13
405 查看
Tested the Apache CGI perl encountered quite a few problem and solved,
1, configure the /etc/httpd/conf/httpd.conf
uncomment the line as:
AddHandler cgi-script .cgi .pl
get the the access right of the CGI directory, add below lines,
<Directory "/var/www/html/cgi">
Options +ExecCGI
AllowOverride None
Order allow,deny
Allow from all
</Directory>
Restart the httpd
/etc/init.d/httpd restart
mkdir /var/www/html/cgi
2, create the perl scripts, helloworld.pl and change the access condition of the perl script
chmod a+x helloworld.pl
3, (13)Permission denied: exec of '/var/www/html/cgi/helloworld.pl' failed
this error caused by selinux, use the command to change folder Selinux security context:
chcon -R -t httpd_sys_script_exec_t /var/www/html/cgi
result as:
[root@localhost cgi]# ll -Z
-rwxr-xr-x. root root unconfined_u:object_r:httpd_sys_script_exec_t:s0 helloworld.pl
4, Premature end of script headers
not familiar about the perl language, not sure about the error cause, might caused by the perl command
added the below line, solved, weird,
print "Content-type: text/html\r\n\r\n";
1, configure the /etc/httpd/conf/httpd.conf
uncomment the line as:
AddHandler cgi-script .cgi .pl
get the the access right of the CGI directory, add below lines,
<Directory "/var/www/html/cgi">
Options +ExecCGI
AllowOverride None
Order allow,deny
Allow from all
</Directory>
Restart the httpd
/etc/init.d/httpd restart
mkdir /var/www/html/cgi
2, create the perl scripts, helloworld.pl and change the access condition of the perl script
chmod a+x helloworld.pl
3, (13)Permission denied: exec of '/var/www/html/cgi/helloworld.pl' failed
this error caused by selinux, use the command to change folder Selinux security context:
chcon -R -t httpd_sys_script_exec_t /var/www/html/cgi
result as:
[root@localhost cgi]# ll -Z
-rwxr-xr-x. root root unconfined_u:object_r:httpd_sys_script_exec_t:s0 helloworld.pl
4, Premature end of script headers
not familiar about the perl language, not sure about the error cause, might caused by the perl command
added the below line, solved, weird,
print "Content-type: text/html\r\n\r\n";
相关文章推荐
- The specified CGI application encountered an error and the server terminated the processThe specified CGI application encountered an error and the server terminated the process
- IE打不开MSDN,出现提示The specified CGI application encountered an error and the server terminated the proc
- The specified CGI application encountered an error and the server terminated the process
- Chrome访问MSDN主页失败,显示The specified CGI application encountered an error and the server terminated the process.的解决办法
- IE打不开MSDN,出现提示The specified CGI application encountered an error and the server terminated the proc
- 打不开MSDN,出现提示The specified CGI application encountered an error and the server terminated the process
- linux+apache2.52+cgi(perl)
- Uploading Files Using CGI and Perl
- Export op results in error "EXP.EXE has encountered a problem and needs to
- Windows Apache环境下运行Perl写的CGI
- apache perl cgi
- An error was encountered. Please return to the previous page and try again.
- Zend Server 错误:The server encountered an internal error or misconfiguration and was unable to comple
- How to Add Perl CGI Script Support to Your Apache Server on Windows
- The server encountered an internal error misconfiguration and was unable to complete your request.
- org.apache.solr.common.SolrException: ERROR: multiple values encountered for non multiValued copy
- 才开始接触linux+apache+perl+CGI
- Apache环境下 如何运行Perl写的cgi
- Apache环境下 如何运行Perl写的cgi
- ERROR: The import org.apache.commons.logging cannot be resolved