GuidesGetting Started with Apache 1.3 Page 9

Getting Started with Apache 1.3 Page 9

ServerWatch content and product recommendations are editorially independent. We may make money when you click on links to our partners. Learn More.




By default, following an Apache installation the main page in your
DocumentRoot directory will say something reassuring — to you —
about the success of the installation. It’s sort of like the
ReadMe.txt file you get to see after installing an application on
Windows; it’s just there to a) give the installer (you) a warm, fuzzy
feeling that everything worked, and b) provide something other
than a list of files to anyone who hits the site before it’s ready.
Unfortunately, there are a lot of people on the Internet that don’t
understand how the Web works, or the whole idea of clients and servers,
and if they see that page saying ‘Apache has been successfully installed!’
they’re going to think it’s beein installed on their desktop
system. Or, if you just upgraded an existing Web site, they’re
going to think the Apache Software Foundation has just invaded you
and taken over your site.

So please, please, please replace the default
index.html* file (or files) with something of your own,
perhaps saying something like “Welcome to Joe’s Web Pages. They’re
off getting dusted and cleaned right now, but they’ll be back soon.
Please come back in a couple of days!” Or something like that.

One way to do this, of course, is to modify the index.html.en
file itself, since this is the one Apache will display by default.
Another way is to create another directory somewhere, such as
/usr/local/web/apache/realdocs (or
C:Progam FilesApache GroupApacherealdocs,
if you’re using Windows), put your own content files in it, and
change the DocumentRoot line in your httpd.conf
file to point to it. You’ll need to change all occurences in the config file
of the old htdocs directory to your new realdocs
one, and restart the server after saving the file, but this is probably the
cleaner solution.

Testing Your Installation

If you didn’t get any errors when you started Apache, hopefully
that means it’s running. Try it out; use a browser to access the
default page: http://localhost/>.
You should see a page declaiming that the installation was a
success. If you don’t, make a note of what you see instead, and
the contents of the error log under the ServerRoot location, in
the logs subdirectory. It’s called ‘error_log
on Unix, but ‘error.log‘ on Windows. With that information,
go search the
Apache FAQ
or other resources listed under
Going Further. If all else fails, you can
send me email, but please
try to find a ready-made answer elsewhere first!

Reloading After Changes

Whevever you make changes to the server configuration files (such as
httpd.conf, they won’t take effect until the server
is restarted and reloaded. On Unix, the command to do this is:

  
    # /usr/local/web/apache/bin/apachectl graceful
  

On Windows, the equivalent command (run in a DOS window) is:

    C:Program FilesApache GroupAPACHE>apache -k restart
  

Going Further

Once you've got your Apache Web server up and running, the first
hurdle has been surmounted. Now you can move on to exploring its
capabilities and features. Here are some pointers to resources
for further investigation:

Get the Free Newsletter!

Subscribe to Daily Tech Insider for top news, trends & analysis

Latest Posts

Related Stories