Solved

Using webserver Redhat 9.0

Posted on 2003-11-27
15
588 Views
Last Modified: 2013-12-16
Hi,

how do I use the webserver in redhat 9.0 I have it installed but do not know how I can test my HTML/CGI files using it. I am only planning on using it locally and not putting it online.

Thanks,

Paul
0
Comment
Question by:Paulmul
  • 8
  • 6
15 Comments
 
LVL 18

Expert Comment

by:liddler
ID: 9831911
Assuming your webserver is apache, find your config file (httpd.conf), which might be in /usr/local/apache/conf or /etc/apache/conf, and in it set your DocumentRoot to the directory your HTML files are stored
0
 
LVL 1

Author Comment

by:Paulmul
ID: 9832155
My linux isn't great, could you explian that a little simpler, how to do it?

Thanks
0
 
LVL 18

Expert Comment

by:liddler
ID: 9832192
first do you know where your httpd.conf file is?
If not
find / -name httpd.conf

Do you know whether you are running apache 1.3 or 2?

Then in the file, you need a directives like:

ServerName www.example.com
DocumentRoot /var/www/http

If you are not sure, post your httpd.conf here
0
 
LVL 1

Author Comment

by:Paulmul
ID: 9832266
I don't even know if it is apache, I just installed what came with the redhat 9.0 cd. I found my httpd.conf it is a very long file. I will post it if you like but if you tell me what part to post or where I should write this in I can do that.

Thanks
0
 
LVL 1

Author Comment

by:Paulmul
ID: 9832276
Found <URL:http://httpd.apache.org/docs-2.0/> in the file, I suppose that means it i s apache 2.0

Paul
0
 
LVL 1

Author Comment

by:Paulmul
ID: 9832369
Ok I made some progress on my own. I have found my httpd directory. Should I set up cgi-bin and html folders in here?
0
 
LVL 18

Expert Comment

by:liddler
ID: 9832444
Yes,
Most of the default httpd.conf file is commented out and it has lots of comments in it trying to explain to you what is does.
Really you should try and read them (I know it is long and boring)
You can make a copy of the httpd.conf file with out the comments in by doing this
grep -v ^# httpd.conf >httpd.conf.new
mv httpd.conf httpd.conf.old
mv httpd.conf.new httpd.conf
This will be a much smaller and simpler file, then if you don't understand any of the directives, go to the relevent section of the httpd.conf.old file or look at the directions section on the apache website.

There should be a logs directory next to the conf directory where you found the httpd.conf, try and start apache (apachectl start) and look in the errors file
0
Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

 
LVL 1

Author Comment

by:Paulmul
ID: 9832683
I found (I know I'm lazy) a www folder with http and cgi-bin sub directories. I assume this is my webserver. I have put files in the relevant directories but when I try to run perl it just opens the file, how do I change this?

Also I upped the points since this is technically another question.

Paul
0
 
LVL 18

Expert Comment

by:liddler
ID: 9832756
Yes thats where you can put your html & cgi docs.
You should have another file in the conf directory called mime.types, this will associate different extensions (i.e. .cgi or .pl) with different applications

0
 
LVL 1

Author Comment

by:Paulmul
ID: 9832792
Ok I found that, how do I add perl to it? When I add perl should the webserver see .pl and .cgi files?
Do I have to start apache or is that running?

Sorry about all the questions.
0
 
LVL 18

Accepted Solution

by:
liddler earned 80 total points
ID: 9832853
Something like
application/perl    pl
You need to start apache (apachectl start)
0
 
LVL 1

Author Comment

by:Paulmul
ID: 9832913
When I type that it says command not found, I have tried it in several directories including the one where apachectl is located.

0
 
LVL 1

Author Comment

by:Paulmul
ID: 9832957
I'm getting closer, Still not seeing perl properly but I think I nearly have it.

Thanks again
0
 
LVL 18

Expert Comment

by:liddler
ID: 9833119
IF you are in a directory (any directory) and you want to run a command that is located in that directory, you need to prepend your command with ./
so in the apache bin direcetory type
./apachectl start
0
 

Expert Comment

by:memdy
ID: 9924213
in RedHat 9 you can type

service httpd start

from the command line to get Apache started or

service httpd restart

to restart the Apache service if you have made any changes to the /etc/httpd/conf/httpd.conf file
0

Featured Post

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

SSH (Secure Shell) - Tips and Tricks As you all know SSH(Secure Shell) is a network protocol, which we use to access/transfer files securely between two networked devices. SSH was actually designed as a replacement for insecure protocols that sen…
The purpose of this article is to demonstrate how we can use conditional statements using Python.
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.

743 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now