*alexandre* has asked for the wisdom of the Perl Monks concerning the following question:

Hi, I just do some test before the deployment of my application and I got the Following error when attemting to execute a script. here is the error I got
[Tue Aug 06 15:31:25.389867 2019] [cgi:error] [pid 21795] [client 83.7 +8.41.48:51364] End of script output before headers: cgi.cgi [Tue Aug 06 15:34:05.945545 2019] [cgi:error] [pid 21797] [client 83.7 +8.41.48:51417] AH01215: (2)No such file or directory: exec of '/usr/l +ib/cgi-bin/cgi.cgi' failed: /usr/lib/cgi-bin/cgi.cgi [Tue Aug 06 15:34:05.945861 2019] [cgi:error] [pid 21797] [client 83.7 +8.41.48:51417] End of script output before headers: cgi.cgi [Tue Aug 06 15:43:04.576601 2019] [mpm_prefork:notice] [pid 21790] AH0 +0169: caught SIGTERM, shutting down [Tue Aug 06 15:44:55.853925 2019] [mpm_prefork:notice] [pid 22117] AH0 +0163: Apache/2.4.18 (Ubuntu) mod_perl/2.0.9 Perl/v5.22.1 configured - +- resuming normal operations [Tue Aug 06 15:44:55.853958 2019] [core:notice] [pid 22117] AH00094: C +ommand line: '/usr/sbin/apache2' [Tue Aug 06 15:45:02.206748 2019] [cgi:error] [pid 22123] [client 83.7 +8.41.48:51526] AH01215: (2)No such file or directory: exec of '/usr/l +ib/cgi-bin/cgi.cgi' failed: /usr/lib/cgi-bin/cgi.cgi [Tue Aug 06 15:45:02.207300 2019] [cgi:error] [pid 22123] [client 83.7 +8.41.48:51526] End of script output before headers: cgi.cgi [Tue Aug 06 15:45:04.178975 2019] [cgi:error] [pid 22122] [client 83.7 +8.41.48:51528] AH01215: (2)No such file or directory: exec of '/usr/l +ib/cgi-bin/cgi.cgi' failed: /usr/lib/cgi-bin/cgi.cgi [Tue Aug 06 15:45:04.179385 2019] [cgi:error] [pid 22122] [client 83.7 +8.41.48:51528] End of script output before headers: cgi.cgi
This a fresh installation of Ubuntu, Apaache, mod perl, perl. And here is the Following code I'm trying to execute :
#!/usr/bin/perl print "Content-Type: text/html\n\n"; print "Hello world";
I also setted chmod +x to cgi.cgi but no change and the file exist in the directory /usr/lib/cgi-bin My 000-default.conf contains :
<VirtualHost *:80> ServerAdmin webmaster@localhost DocumentRoot /var/www/recordz ErrorLog ${APACHE_LOG_DIR}/error.log CustomLog ${APACHE_LOG_DIR}/access.log combined Include conf-available/serve-cgi-bin.conf </VirtualHost>
serve-cgi-bin :
<IfModule mod_alias.c> <IfModule mod_cgi.c> Define ENABLE_USR_LIB_CGI_BIN </IfModule> <IfModule mod_cgid.c> Define ENABLE_USR_LIB_CGI_BIN </IfModule> <IfDefine ENABLE_USR_LIB_CGI_BIN> ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/ <Directory "/usr/lib/cgi-bin"> AllowOverride None Options +ExecCGI -MultiViews +SymLinksIfOwnerM +atch Require all granted </Directory> </IfDefine> </IfModule>
What do I've missed ??

Replies are listed 'Best First'.
Re: No such file or directory: exec of '/usr/lib/cgi-bin/cgi.cgi'
by *alexandre* (Scribe) on Aug 06, 2019 at 13:33 UTC
    Response here : https://stackoverflow.com/questions/7858987/apache-2-throws-no-such-file-or-directory-exec-of-usr-lib-cgi-bin-fst-cgi/8629849#8629849