The HTTP
Daemon packaged by default with Red Hat 6.2 (and most distributions
for that matter) is Apache.
The apache server should work straight out of the box. i.e.
it is automatically setup during the installation process.
To test it if works simply open up a web browser and type
in your Optus@Home IP Address,
e.g. http://<ip_address>/.
If your Apache web server works correctly you should see a
page similar to this example.
If your server doesn't then you will probably need to change
some configuration options.
To modify
your Apache setup you must edit the file /etc/httpd/conf/httpd.conf,
this file contains the configuration details of the Apache
web server. All the options in this file are clearly described
in some detail so it should be straight forward to edit.
To start
and stop your Apache web server you will have to run the main
Apache executable and pass it the appropriate option. The
executable file is /etc/httpd/conf/apachectl,
and this is its usage details:
usage:
./apachectl (start|stop|restart|fullstatus|status|graceful|configtest|help)
start - start httpd
stop - stop httpd
restart - restart httpd if running by sending a SIGHUP or
start if not running
fullstatus - dump a full status screen; requires lynx and
mod_status enabled
status - dump a short status screen; requires lynx and mod_status
enabled
graceful - do a graceful restart by sending a SIGUSR1 or start
if not running
configtest - do a configuration syntax test
help - this screen
When
you have your own site ready or you want to post some files
on you Apache web server all the html files go in the /home/httpd/html/
directory, while all your cgi and perl scripts go in
the /home/httpd/cgi-bin/
directory. Remember cgi and perl files must be executable
so you will want to chmod them with the appropriate values.
This
is a custom UPTIME cgi script that is useful for all those
out there who want to show off there box's, simply create
a file called uptime.cgi
and chmod o+x uptime.cgi,
here is the code for the script (you will need to change the
203.164.?.? to your Optus@Home
IP Address):
#!/bin/csh
# Uptime CGI Script
# Coded by Mayhem (C)2000
echo "Content-type:text/html\n"
echo "<HTML><HEAD><TITLE>SERVER UPTIME (C) 2000"
echo "</TITLE></HEAD><BODY><H1><CENTER>"
echo "Server Uptime for: <FONT COLOR=blue> 203.164.?.?
</FONT></H1>"
echo "<HR><BR><B><CENTER>"
echo `uptime`
echo "</B><BR><BR><HR><BR>"
echo "<A HREF="/index.html"> [ HOME ] </A><BR><BR>"
echo "Copyright (C) 2000, Mayhem. All Rights Reserved."
echo "</CENTER></BODY></HTML>"
If you
want to configure your Apache server to allow SSI (Server
Side Includes - such as text CGI counters) then go to this
page
as it details exactly how to do it. This will allow you do
so server side commands and therefore increase the capabilities
of your web server.
Apache
has a nice feature by which users of your Linuxbox can have
their own html
directory on your site, in order for them to do this they
will need to create a
html directory in their home directory (e.g. /home/joe/html/)
and this will need to be given the appropriate permissions,
chmod 755 html/ (it
may be a good idea to see what the naming convention in your
version of Apache is, sometimes their html directory might
need to be public_html).
Along
with this you might also want to give you users a cgi-bin
directory of their own, so that they can run their own scripts,
this will require you to add the following line into your
httpd.conf
file (directly following the line ScriptAlias
/cgi-bin/ "/home/httpd/cgi-bin/"):
ScriptAliasMatch
^/~([^/]*)/cgi-bin/(.*) /home/$1/cgi-bin/$2
This
will now allow you users to have a cgi-bin directory similar
to their html directory (e.g. /home/joe/cgi-bin/script.cgi
can now be called http://www.yourdomain.com/~joe/cgi-bin/script.cgi
as long as the permissions for the directory and script are
setup correctly).
|