[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 596
  • Last Modified:

Using webserver Redhat 9.0

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
Paulmul
Asked:
Paulmul
  • 8
  • 6
1 Solution
 
liddlerCommented:
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
 
PaulmulAuthor Commented:
My linux isn't great, could you explian that a little simpler, how to do it?

Thanks
0
 
liddlerCommented:
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
Free Backup Tool for VMware and Hyper-V

Restore full virtual machine or individual guest files from 19 common file systems directly from the backup file. Schedule VM backups with PowerShell scripts. Set desired time, lean back and let the script to notify you via email upon completion.  

 
PaulmulAuthor Commented:
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
 
PaulmulAuthor Commented:
Found <URL:http://httpd.apache.org/docs-2.0/> in the file, I suppose that means it i s apache 2.0

Paul
0
 
PaulmulAuthor Commented:
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
 
liddlerCommented:
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
 
PaulmulAuthor Commented:
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
 
liddlerCommented:
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
 
PaulmulAuthor Commented:
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
 
liddlerCommented:
Something like
application/perl    pl
You need to start apache (apachectl start)
0
 
PaulmulAuthor Commented:
When I type that it says command not found, I have tried it in several directories including the one where apachectl is located.

0
 
PaulmulAuthor Commented:
I'm getting closer, Still not seeing perl properly but I think I nearly have it.

Thanks again
0
 
liddlerCommented:
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
 
memdyCommented:
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

Restore individual SQL databases with ease

Veeam Explorer for Microsoft SQL Server delivers an easy-to-use, wizard-driven interface for restoring your databases from a backup. No expert SQL background required. Web interface provides a complete view of all available SQL databases to simplify the recovery of lost database

  • 8
  • 6
Tackle projects and never again get stuck behind a technical roadblock.
Join Now