Where'd my Apache config util go?


Ok this is the Linux-knownothing again, but oh well :) I used to have RedHat 5.2 installed, and it had a menu item or so somewhere for Apache configuration... but now I formatted my pc and installed RedHat 6.1 and that Apache config thingy seems to have disappeared.
I think I need this, cause I wrote (well, copy&pasted) a CGI script thingy, placed it in the /home/httpd/cgi-bin directory and I tried accessing it from another (Windoze) computer... which gave me an internal server error... so I think that cgi is somehow turned off or something....
Ok and if this is as wrong as can be, don't laugh :)
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

If you've used a default Red Hat installation, the config file for the Apache web server is located in /etc/httpd/conf. The file itself is called httpd.conf.

This file needs to be modified for it to function properly...details such as file location for script, web, and logging.

A few things of note here: First off, an internal server error can be one of various things. First off, the script you have uploaded has improper permissions (ie, it cannot be executed by the server...it's read only, instead of read and execute, at least). Secondly, if uploaded improperly, the file may have become corrupted (ie, uploading a perl script in binary will leave lots of ugly ^M characters trailing). Lastly, the server is not configured correctly.

Make sure the server is running (ps aux | grep http). If it is, try viewing the httpd logs. Again, assuming this is a default RH install, the web logs would more than likely be in /var/log/httpd. You'd want to view both the access_log and error_log files. They will give you more detail as to what the precise error may be.


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
mgdPaulAuthor Commented:
Thanks!!!! :)

I did what you said, first used "ps aux | grep httpd" (whatever the hell that may do) and everything seemed fine, then checked the error log, and whaddayaknow, permission denied on my file :)
I'm a Windoze (98) guy, I'm not used to permissions and all that.... oops :)

And yes I used more or less the default installation, I selected what packages I wanted and which ones I didn't want, but I don't even dare touching the paths and all.... I can't even do simple things on Linux let alone do more advanced things :)

Btw what happened to this nice little Apache config util? Was a program which started out with a dialog with 2 buttons or so on it and an indian pic or so.... and there you could choose to config the thing... what happened to that? lol that was my only way of understanding a bit of it :)
mgdPaulAuthor Commented:
dammit I seem to be doing something else wrong, but what?

My script thingy is (i did not write it, copy&pasted it from a book):

echo Content-type: text/html

if [ -x $FINGER ]; then
    if [ $* = 0 ]; then
        cat << EOM
<TITLE>Finger Gateway</TITLE>
<H1>Finger Gateway</H1>


This is a gateway to "finger". Type a user@host combination in your browser's search dialog.<P>
        echo \<PRE\>
        $FINGER "$*"
    echo Cannot find finger on this system.

When I try to open it on a different machine than the Linux machine itself I get an internal server error (I use "") and when I open it in Netscape on the Linux machine itself I see a search dialog thingy that is generated by the <ISINDEX> tag, but I also see the rest of the script on the page.... I have no idea why..... do I need some kind of CGI-translator or engine or whatever?
Best guess is a few things:

First off, you're missing (at least in the post) the basic header that would start any script. This would be:


Since this is calling a shell process (ie, finger), you'll need this.

Secondly, if you've 'copied and pasted', you may have some trailing spaces left at the end of each line. Since each line is a statement or command, you need to make sure that the command is in fact .ended., and that you don't have any 'empty space' left after each line.

For example, pretend * denotes a space. If you list a statement/command like this:
FINGER=/usr/bin/finger, there may be empty whitespace at the end of the line...so it will actually be FINGER=/usr/bin/finger** (remember, ** in this instance I'm using to denote whitespace).

Copy and paste generally won't work when you're dealing with scripts, because you often leave trailing spaces at the end of each line. FWIW, I'd suggest double-checking, or manually typing it out. And dont, most importantly, forget the #!/bin/sh at the beginning =:)

mgdPaulAuthor Commented:
Thanks :)
Seems that #!/bin/sh did the trick.... when I open it locally (on my Linux machine) in Netscape it redisplays the entire script,but oh well... and when I open it on a remote computer it shows what the script's supposed to do :) Woo hoo :)
And with 'copy&pasted' I meant I typed it over exactly from the book, not actual copy&pasting.... I wouldn't even know how to do that on Linux :)

I really should buy a book on Linux someday and learn it, since it all seems mighty interesting but I really understand jack **** of it :)

Thanks a lot :)
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Linux Distributions

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.