Solved

Using webserver Redhat 9.0

Posted on 2003-11-27
15
591 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
Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

 
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
 
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

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

Suggested Solutions

Title # Comments Views Activity
AWS ELB 5 95
RHEL 6.7 Gnome Desktop on VMware 6 VM 9 66
IP 10.0.1.2 / 255.0.0.0 61 56
Syslog-ng works. Now what? How to filter and manage? 8 59
I am a long time windows user and for me it is normal to have spaces in directory and file names. Changing to Linux I found myself frustrated when I moved my windows data over to my new Linux computer. The problem occurs when at the command line.…
If you have a server on collocation with the super-fast CPU, that doesn't mean that you get it running at full power. Here is a preamble. When doing inventory of Linux servers, that I'm administering, I've found that some of them are running on l…
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…

840 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