Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
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.
I'm not sure exactly what my ScriptAliasing line should be in the httpd.conf for me to be able to run CGI scripts on my computer. Is it as simple as the path to the Perl 'compiler'??
Do I need to do anything else to be able to run my CGI scripts??
Originally posted by jacksmash Ok, I'm going to try this one more time. Nobody so far has been able to help unfortunately. I'm very new to Linux, however, I would like to set up my machine so I can run cgi-scripts, php etc. So one thing at a time. I'm trying to get cgi to run properly.
I installed RedHat 9.0. I'm assuming it has apache installed already. My question is:
how do I check if apache is configured properly??
I went to /etc/httpd/conf/httpd.conf and was able to look at the file. The ScriptAlias says /cgi-bin/ "/var/www/cgi-bin/"
I'm assuming this is correct.
But my browser just displays my source code when I try to run a perl program. For example:
#!/usr/local/bin/perl -w
print "Content-type: text/html \n\n";
print "This is a test";
Can anyone help me with this??? people have already directed my to lampp, and that is not the route I want to go. I really want to learn this stuff.
Appreciate any suggestions.
Did you make sure your cgi script in your cgi-bin is executable?
Something wrong with your config file then or missing something. Script works on my end but are you sure perl is located in /usr/local/bin and not just in /usr/bin ? That is usually the default location of perl.
i've actually tried running the script both ways - with the "/local" and without - simply because I can find Perl under both directories.
Maybe another problem is this:
when I run the file from my browser, do I just type in the path to it exactly the way it is? For example, /var/www/cgi-bin/test.pl is the path to my perl file.
I've read all the documentation I can find. I suggests that I might need to access it some other way (like via the server) but I am unsure of how to d this.
Sorry if I pissed you off about the 3 different threads. To me it was a matter of strategy and not a matter of "breaking the rules". You're right, I should have read the rules previously. I won't let it happen again.
In response to a question re. my httpd.conf file, I am posting some of it here. Please don't laugh if I've messed it up! I'm new at this!!
ScriptAlias /cgi-bin/ "/var/www/cgi-bin/"
<IfModule mod_cgid.c>
#
# Additional to mod_cgid.c settings, mod_cgid has Scriptsock <path>
# for setting UNIX socket for communicating with cgid.
#
Scriptsock run/httpd.cgid
</IfModule>
#
# "/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
AddHandler cgi-script cgi pl
Order allow,deny
Allow from all
</Directory>
I added the "AddHandler" line. If I need to post more please let me know.
I'm not sure which version I'm running! Whatever version that comes with RedHat 9.0 I guess. Is there any way I can do a check to see if it is even running? SOrry if that's a dumb question.
Originally posted by jacksmash I'm not sure which version I'm running! Whatever version that comes with RedHat 9.0 I guess. Is there any way I can do a check to see if it is even running? SOrry if that's a dumb question.
What does "afaik" mean??
AFAIK = As Far As I Know
Umm.. to find your version, just type this at a console or terminal as root:
httpd -V
Oh and easiest way to check and make sure its running would be:
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.