Fedora Core 4 Apache 2.0.54 I seem to be having this same problem. I read the manual at: http://httpd.apache.org/docs/2.0/howto/cgi.html#writingand created the "first.pl" file. when I run "./first.pl" from the command line, all it prints is:
Content-type: text/html and does not print the "Hello, World." at all. And in my browser - it gives me the "Internal Server Error" All it says in my error logs is:[Thu Feb 23 08:55:35 2006] [error] [client xx.xx.xx.xx] Premature end of script headers: first.pl
If anyone could point me in the direction where I need to look, it would be greatly appriciated
In following the directions from the manual above, here's the pertanant info from my httpd.conf file:
# LoadModule foo_module modules/mod_foo.so # LoadModule access_module modules/mod_access.so LoadModule auth_module modules/mod_auth.so LoadModule auth_anon_module modules/mod_auth_anon.so LoadModule auth_dbm_module modules/mod_auth_dbm.so LoadModule auth_digest_module modules/mod_auth_digest.so LoadModule ldap_module modules/mod_ldap.so LoadModule auth_ldap_module modules/mod_auth_ldap.so LoadModule include_module modules/mod_include.so LoadModule log_config_module modules/mod_log_config.so LoadModule logio_module modules/mod_logio.so LoadModule env_module modules/mod_env.so LoadModule mime_magic_module modules/mod_mime_magic.so LoadModule cern_meta_module modules/mod_cern_meta.so LoadModule expires_module modules/mod_expires.so LoadModule deflate_module modules/mod_deflate.so LoadModule headers_module modules/mod_headers.so LoadModule usertrack_module modules/mod_usertrack.so LoadModule setenvif_module modules/mod_setenvif.so LoadModule mime_module modules/mod_mime.so LoadModule dav_module modules/mod_dav.so LoadModule status_module modules/mod_status.so LoadModule autoindex_module modules/mod_autoindex.so LoadModule asis_module modules/mod_asis.so LoadModule info_module modules/mod_info.so LoadModule dav_fs_module modules/mod_dav_fs.so LoadModule vhost_alias_module modules/mod_vhost_alias.so LoadModule negotiation_module modules/mod_negotiation.so LoadModule dir_module modules/mod_dir.so LoadModule actions_module modules/mod_actions.so LoadModule speling_module modules/mod_speling.so LoadModule userdir_module modules/mod_userdir.so LoadModule alias_module modules/mod_alias.so LoadModule rewrite_module modules/mod_rewrite.so LoadModule proxy_module modules/mod_proxy.so LoadModule proxy_ftp_module modules/mod_proxy_ftp.so LoadModule proxy_http_module modules/mod_proxy_http.so LoadModule proxy_connect_module modules/mod_proxy_connect.so LoadModule cache_module modules/mod_cache.so LoadModule suexec_module modules/mod_suexec.so LoadModule disk_cache_module modules/mod_disk_cache.so LoadModule file_cache_module modules/mod_file_cache.so LoadModule mem_cache_module modules/mod_mem_cache.so LoadModule cgi_module modules/mod_cgi.so (I changed the actual domain name for this post) <VirtualHost xx.xx.xx.xx:80> SuexecUserGroup "#506" "#506" ServerName domain.com ServerAlias www.domain.com DocumentRoot /home/domain/public_html ErrorLog /home/domain/logs/error_log CustomLog /home/domain/logs/access_log common ScriptAlias /cgi-bin/ /home/domain/cgi-bin/ AddHandler cgi-script .cgi .pl <Directory /home/domain/public_html> Options Indexes IncludesNOEXEC FollowSymLinks +ExecCGI allow from all </Directory> </VirtualHost> Thanks for your help. Scott
To clear up some of the confusing advice you've been getting: - the extension is not important, .cgi is fine.- you don't need the CGI:Carp module (don't complicate life unnecessarily)Thanks! When I removed this line, it all of a sudden started working. Maybe I had a typo or something.- your problem is simply that you script does not output a content-type header. Did you read the doc I referred you to?Weird, I got your "first" message, shortly after I got your "2nd"message. It's quite useful. Thanks again!
--------------------------------------------------------------------- The official User-To-User support forum of the Apache HTTP Server Project. See <URL:http://httpd.apache.org/userslist.html> for more info. To unsubscribe, e-mail: users-unsubscribe@xxxxxxxxxxxxxxxx " from the digest: users-digest-unsubscribe@xxxxxxxxxxxxxxxx For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx