Solved

Where'd my Apache config util go?

Posted on 2000-04-25
5
204 Views
Last Modified: 2013-12-06
Hi,

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 :)
0
Comment
Question by:mgdPaul
  • 3
  • 2
5 Comments
 

Accepted Solution

by:
Reisu earned 35 total points
ID: 2750294
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.

Cheers.
0
 

Author Comment

by:mgdPaul
ID: 2750313
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 :)
0
 

Author Comment

by:mgdPaul
ID: 2750341
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):
------------------------------
FINGER=/usr/bin/finger

echo Content-type: text/html
echo

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

<ISINDEX>

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

When I try to open it on a different machine than the Linux machine itself I get an internal server error (I use "http://169.254.100.90/cgi-bin/test.cgi") 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?
0
 

Expert Comment

by:Reisu
ID: 2752885
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:

#!/bin/sh

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 =:)

Cheers.
0
 

Author Comment

by:mgdPaul
ID: 2752953
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 :)
0

Featured Post

Back Up Your Microsoft Windows Server®

Back up all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I found this questions asking how to do this in many different forums, so I will describe here how to implement a solution using PHP and AJAX. The logical flow for the problem should be: Write an event handler for the first drop down box to get …
JavaScript has plenty of pieces of code people often just copy/paste from somewhere but never quite fully understand. Self-Executing functions are just one good example that I'll try to demystify here.
Viewers will learn about arithmetic and Boolean expressions in Java and the logical operators used to create Boolean expressions. We will cover the symbols used for arithmetic expressions and define each logical operator and how to use them in Boole…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

828 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question