Instead of executing perl script,Mozilla Firefox opens it,why?
Linux - ServerThis forum is for the discussion of Linux Software used in a server related context.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
but when I run it in the web environment (fedora9, with Apache), it does not executes the script. Instead browser show open with or download message box. Please help me.
How are you expecting the Perl script to be executed? Is it supposed to be used through CGI or through mod_perl? Do you have the Perl script in a directory configured to use CGI or mod_perl? Do you have these set up correctly in your server config? It sounds like Apache is just displaying it as a normal file, rather than running it as a script.
Also, see John VV's comment about Fedora 9 being out of support.
OK guys. Immediately after my exam(Oct 10), I will thrust myself to upgrading my fedora9. But at the time please make me do it with whatever I have by telling me how I have to configure the Perl script in a directory to use CGI or mod_perl?
That is to say I was not telling Apache where to find the interpreter for Perl Scripts, and
2. I was saving the .pl files in directory /var/www/myowndirectory/ instead of saving it in /var/www/cgi-bin
What now I get is
Quote:
500 Internal Error
The server encountered an internal error or misconfiguration and was unable to complete your request.
Please contact the server administrator, root@localhost and inform them of the time the error occurred, and anything you might have done that may have caused the error.
More information about this error may be available in the server error log.
I 100% agree with you John VV and deeply thank you for that. But please give only the HINT at least.
Believe me, if I were not to appear in exam on coming 10th, I would happily hangout with it as long as it would take. But now the problem is of my exam..
at the moment i am not running an apache server so this is from memory ...
first can you post the part of the apache log when you try to run the script
and
the part of your httpd.conf for the folder that the perl script is in ( cgi-bin AND /var/www both folders)
AND the file permissions of both folders you can get them this way
Code:
cd /var
ls -l
cd www
ls -l
also is mod perl listed in the top of "httpd.conf" .The section near the top where all the mods are.
( mod perl might be built in so it might not be there)
and this ( default )
LoadModule cgi_module modules/mod_cgi.so
this tells me that perl IS working
"The following perl script successfully runs in the terminal:"
so it is apache OR there is one other "SELinux" is there an error in SELinux TroubleShooter ???
it is in the menu under Applacations/systemtools
and i take it that this is at the top of the perl script? " #!/usr/bin/perl "
I have already shown the apache logs when I try to run the script [in 9th post, 500 Internal Server Error]
Part of httpd.conf for cgi-bin:
Quote:
# ScriptAlias: This controls which directories contain server scripts.
# ScriptAliases are essentially the same as Aliases, except that
# documents in the realname directory are treated as applications and
# run by the server when requested rather than as documents sent to the client.
# The same rules about trailing "/" apply to ScriptAlias directives as to
# Alias.
#
ScriptAlias /cgi-bin/ "/var/www/cgi-bin/"
#
# "/var/www/cgi-bin" should be changed to whatever your ScriptAliased
# CGI directory exists, if you have that configured.
#
<Directory "/var/www/cgi-bin">
AllowOverride None
Options None
Order allow,deny
Allow from all
</Directory>
Part of httpd.conf for /var/www/:
Quote:
#
# DocumentRoot: The directory out of which you will serve your
# documents. By default, all requests are taken from this directory, but
# symbolic links and aliases may be used to point to other locations.
#
DocumentRoot "/var/www/html"
I did not find any mod perl in the top of httpd.conf
LoadModule:
#
# The following modules are not loaded by default:
#
#LoadModule cern_meta_module modules/mod_cern_meta.so
#LoadModule asis_module modules/mod_asis.so
SELinux does not show any thing for cgi-bin etc
Permissions for /var:
I also have the same problem. But I am not running the perl file on my localhost. I run it on a different server and when I try to run it on the browser it opens a download window instead. This is what I have written on my shebang line #!/usr/bin/env perl . I have checked the usr/bin/env of the server and it exists. perl.exe is also there. the server follows linux environment.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.