Apache cgi-script problem
I wrote a simple perl script (hello world) and put it into /usr/lib/cgi-bin.if i try to see the output by giving http://localhost/cgi-bin/hello.pl.,a new window opened and asking whether i want to save the file to disk or open it using any application.In errorlog there is no entry.I am a starter.forgive me for asking stupid qns like this.
|
The following are things located in httpd.conf, the apache main config file.
ScriptAlias /cgi-bin/ "/usr/local/apache2/cgi-bin/" Is /cgi-bin supposed to be located in /usr/lib? By default, it shouldn't be. # # "/usr/local/apache2/cgi-bin" should be changed to whatever your ScriptAliased # CGI directory exists, if you have that configured. # <Directory "/usr/local/apache2/cgi-bin"> AllowOverride None Options None Order allow,deny Allow from all </Directory> Likewise...by defualt, should be set to something like the above. |
It is the same configuration i too have got.when i tried to restart apache In /var/log/messages i have found a error.NO such file or DIRECTORY:MOD_MIME_MAGIC:can't read magic file /etc/apache/share//magic.What is this?.Any thing realted with CGI execution??????.It is very confusing
|
Hello....
Quote:
ScriptAlias /cgi-bin/ "/usr/local/apache2/cgi-bin/" That means, it is aliasing the /cgi-bin directory to /usr/local/apache2/cgi-bin/ 1. You can do one thing.....move your cgi-bin directory to the root directory (/cgi-bin) and also check for the permissions too ..make sure they are set to 755 OR 2. As an Alternate way, you can change the default cgi-bin directory path to /usr/lib/cgi-bin ...this way, your ScriptAlias line will look like this.. ScriptAlias /cgi-bin/ "/usr/lib/cgi-bin/" However, I recommend that you follow step (1).... Regards, amit |
Quote:
Thanks.I tried it is also not working.I again the "save as dialog box" is opening.Well for ur ref I am pasting the entries in my httpd.conf ScriptAlias /cgi-bin/ "/usr/lib/cgi-bin" <Directory /usr/lib/cgi-bin> AllowOverride none options ExecCGI order allow,deny Allow from all </Directory> then i enabled AddHandler cgi-script .cgi .sh .pl LoadModule cgi_module /usr/lib/apache/1.3/modcgi.so. --I am clueless. |
when i am restaring apache in my /var/log/apache/error.log,I have found a error message.
[error]NO such file or directory:mod_mime_magic:can't read magic file /et/apache/share/magic ---What is this magig file.Any thing to do with CGI execution???? |
I had the same problem. Check to be sure the path is right. I located a file /etc/webmin/perl-path which told me the path was /usr/bin/perl where I was using /usr/local/bin/perl I'm sure there is a way to put a link in /usr/local/bin/perl to /usr/bin/perl but I don't know how. Maybe someone else may know.
|
All times are GMT -5. The time now is 09:59 AM. |