Gossamer Forum
Home : Products : Links 2.0 : Installation -- Unix :

Can't run admin.cgi. Error: No such file or directory; Premature end of script headers

Quote Reply
Can't run admin.cgi. Error: No such file or directory; Premature end of script headers
New, first-time install, to Linux Red Hat 7.1.
Can't run http://localhost/cgi-bin/links/admin/admin.cgi
Error log:
tail -f /var/log/httpd/error_log
Code:
[error] (2)No such file or directory: exec of /var/www/cgi-bin/links/admin/admin.cgi failed
[error] [client 192.168.0.147] Premature end of script headers: /var/www/cgi-bin/links/admin/admin.cgi failed

I've searched the Forum and seen a couple of people reporting similar.

CR/LF??
One person reported (link below) that the files in the .ZIP had MS-Windows CR/LF (0D 0A) vs. the single character for Unix (which is it, 0D? only? and 0A only for Macintosh I think?). [They noted they only downloaded from gossamer-threads.com direct to Linux (no Windows machine); same is true of my download. To unzip, I used 'unzip' 5.41 by Info-ZIP (came with my Red Hat Linux).]

Anyway, I think I agree, for when I threw (e-mailed) the admin.cgi file over to Windows, my Hex editor there (Uedit) shows me the 0D 0A. (Re: Hex on Linux, can anyone help? I tried to get a Linux Hex editor; "HexCurses" I installed and got to start, but have _absolutely no_ idea how to use, even how to get a single key or mouse movement to cause the program to do anything; they don't deign to write one word about that in the README etc. Anyhow, that's another matter...)
http://www.gossamer-threads.com/...;guest=115783#146366

I tried removing the 0A leaving 0D; but no success. (Didn't try the opposite; maybe I should...)

Apache httpd.conf ??
I hope/expect this is not the issue?
I have only the defaults for ScriptAlias and for ExecCGI.
[Am I correct in understanding that if my topmost cgi-bin directory (the one Apache creates) has "ExecCGI," then any dirs I create beneath that will also inherit ExecCGI? (e.g. of course cgi-bin/links/admin)?]
[Also, if/when I get this to work, I'd like to learn what's involved in re-arranging things to get the 'cgi-bin' out of my final, user URL... That can wait for the moment.]
Code:
ScriptAlias /cgi-bin/ "/var/www/cgi-bin/"
<Directory "/var/www/cgi-bin">
AllowOverride None
Options ExecCGI
Order allow, deny
Allow from all
</Directory>

Links.cfg
Code:
# Paths and URL's to Important Stuff
# --------------------------------------------------------
# PATH and URL of Admin CGI directory. No Trailing Slash.
$db_script_path = "/var/www/cgi-bin/links/admin";
$db_dir_url = "http://localhost/cgi-bin/links/admin";

# URL of User CGI directory. No Trailing Slash.
$db_cgi_url = "http://localhost/cgi-bin/links";

# PATH and URL of Pages to be built. No Trailing Slash.
$build_root_path = "/var/www/html/links";
$build_root_url = "http://localhost/links";
# PATH of sendmail. # SMTP Server
$db_mail_path = '/usr/sbin/sendmail'; $db_smtp_server = '';

# Email address of the administrator. BE SURE TO SET!
$db_admin_email = 'william@reilly2001.info';

Links2 README Isn't Right (?!) Maybe?
http://gossamer-threads.com/...pts/links/Readme.txt
Finally, I have to say I'm amazed that what looks to be a by now three-year old error (1998) in the very README to the product still stands as the How To install this?
Unsure Or am I just getting this all wrong: ??

This part says set up "/links/cgi-bin/"...
Code:
4. Edit links.cfg and set as a minimum:
- PATH to your admin directory, this is a system path, not a URL! If you
get an error message about not finding a file, look at the SCRIPT_FILENAME
variable for clues on the proper path!
$db_script_path = "/alex/links/cgi-bin/admin";
- URL to your admin directory. This should start with 'http://'.
$db_dir_url = "http://localhost/links/cgi-bin/admin";
- URL of where your user cgi is kept. If you kept the default installation,
it will just be one level below the admin directory.
$db_cgi_url = "http://localhost/links/cgi-bin";

Whereas this part says "/cgi-bin/links/":
Code:
6. Give it a test! Go to: http://yourserver.com/cgi-bin/links/admin/admin.cgi or wherever you setup admin.cgi, and you should see the admin screen. Try (in this order): ...

Sorry, but with all the other confusion about (see Forum), this sort of typo (?) you would think sort of isn't helping... Unimpressed

---------------------------------------------
What else can I provide, information-wise?

Thanks for any help anyone can offer.
I do appreciate it.
William Reilly